From 2991c76b8f01a32adfdaeb366da920678db76f50 Mon Sep 17 00:00:00 2001 From: Tobiasgraf <4622393+tobiasgraf@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:37:25 +0200 Subject: [PATCH 01/96] Refactor Resource Monitoring to Separate out The Delegate functionality (#28725) * Move Constructors And Destructors To The Top Of The Instance * Add Delegate Instead Of Just The Instance Following the Mode Base Cluster, to make it more similar. * Use New Delegate In Resource-Monitoring-App Example * Rename "instances" Folder to "delegates" also adjust include paths and BUILD.gn paths * Use New Resource Monitoring Delegate In All-Cluster-App Example * Fix Typo * Rename "resource-monitoring-instances.h/cpp" To "resource-monitoring-delegates.h/cpp" * Add Shutdown Methods For All-Cluster-App * Fix Some Comments And Logs * Restyled by whitespace * Restyled by clang-format * Fix Build Error From Merge * Fix Build Error * Add Missing Destructor needs to unregister Command Handler and Attribute Accesser * Restyled by whitespace * Restyled by clang-format * Fix Spelling * Remove `isValidAliascluster` method it should be the SDK user's responsibility to select the correct cluster ID and that it also requires the maintenance of a global list. * Make Instance A Friend Of Delegate -> make mInstance private with private setter and protected getter * Restyled by whitespace * Restyled by clang-format * Fix Build Error --------- Co-authored-by: Restyled.io --- .../include/resource-monitoring-delegates.h | 71 ++++++++ ....cpp => resource-monitoring-delegates.cpp} | 100 ++++++++---- .../all-clusters-app/ameba/chip_main.cmake | 2 +- examples/all-clusters-app/asr/BUILD.gn | 2 +- .../all-clusters-app/cc13x2x7_26x2x7/BUILD.gn | 2 +- .../all-clusters-app/cc13x4_26x4/BUILD.gn | 2 +- .../all-clusters-app/infineon/psoc6/BUILD.gn | 2 +- examples/all-clusters-app/linux/BUILD.gn | 2 +- .../all-clusters-app/linux/main-common.cpp | 3 + examples/all-clusters-app/mbed/CMakeLists.txt | 2 +- .../nrfconnect/CMakeLists.txt | 2 +- examples/all-clusters-app/nxp/mw320/BUILD.gn | 2 +- .../openiotsdk/CMakeLists.txt | 2 +- .../all-clusters-app/telink/CMakeLists.txt | 2 +- examples/all-clusters-app/tizen/BUILD.gn | 2 +- examples/placeholder/linux/apps/app1/BUILD.gn | 2 +- examples/placeholder/linux/apps/app2/BUILD.gn | 2 +- .../include/resource-monitoring-delegates.h} | 42 ++--- .../include/resource-monitoring-instances.h | 63 -------- ....cpp => resource-monitoring-delegates.cpp} | 63 +++++--- .../resource-monitoring-app/linux/BUILD.gn | 6 +- .../linux/src/main.cpp | 18 ++- .../resource-monitoring-common/BUILD.gn | 2 +- .../ActivatedCarbonFilterMonitoring.h | 13 +- .../HepaFilterMonitoring.h | 11 +- .../ActivatedCarbonFilterMonitoring.cpp | 16 +- .../HepaFilterMonitoring.cpp} | 18 +-- .../resource-monitoring-cluster-objects.h | 1 - .../resource-monitoring-server.cpp | 147 ++++++++--------- .../resource-monitoring-server.h | 153 ++++++++++-------- 30 files changed, 421 insertions(+), 334 deletions(-) create mode 100644 examples/all-clusters-app/all-clusters-common/include/resource-monitoring-delegates.h rename examples/all-clusters-app/all-clusters-common/src/{resource-monitoring-instances.cpp => resource-monitoring-delegates.cpp} (50%) rename examples/{all-clusters-app/all-clusters-common/include/resource-monitoring-instances.h => placeholder/linux/include/resource-monitoring-delegates.h} (52%) delete mode 100644 examples/placeholder/linux/include/resource-monitoring-instances.h rename examples/placeholder/linux/{resource-monitoring-instances.cpp => resource-monitoring-delegates.cpp} (60%) rename examples/resource-monitoring-app/resource-monitoring-common/include/{instances => delegates}/ActivatedCarbonFilterMonitoring.h (68%) rename examples/resource-monitoring-app/resource-monitoring-common/include/{instances => delegates}/HepaFilterMonitoring.h (68%) rename examples/resource-monitoring-app/resource-monitoring-common/src/{instances => delegates}/ActivatedCarbonFilterMonitoring.cpp (82%) rename examples/resource-monitoring-app/resource-monitoring-common/src/{instances/HepafilterMonitoring.cpp => delegates/HepaFilterMonitoring.cpp} (74%) diff --git a/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-delegates.h b/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-delegates.h new file mode 100644 index 00000000000000..ea7aecd59b736f --- /dev/null +++ b/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-delegates.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2023 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 +#include + +namespace chip { +namespace app { +namespace Clusters { + +namespace ActivatedCarbonFilterMonitoring { +/// This is an application level Delegate to handle ActivatedCarbonfilterMonitoringDelegate commands according to the specific +/// business logic. +class ActivatedCarbonFilterMonitoringDelegate : public ResourceMonitoring::Delegate +{ +private: + CHIP_ERROR Init() override; + chip::Protocols::InteractionModel::Status PreResetCondition() override; + chip::Protocols::InteractionModel::Status PostResetCondition() override; + +public: + ~ActivatedCarbonFilterMonitoringDelegate() override = default; +}; + +void Shutdown(); + +} // namespace ActivatedCarbonFilterMonitoring + +namespace HepaFilterMonitoring { +/// This is an application level Delegate to handle HepaFilterMonitoringDelegate commands according to the specific business logic. +class HepaFilterMonitoringDelegate : public ResourceMonitoring::Delegate +{ +private: + CHIP_ERROR Init() override; + chip::Protocols::InteractionModel::Status PreResetCondition() override; + chip::Protocols::InteractionModel::Status PostResetCondition() override; + +public: + ~HepaFilterMonitoringDelegate() override = default; +}; + +class ImmutableReplacementProductListManager : public ResourceMonitoring::ReplacementProductListManager +{ +public: + CHIP_ERROR + Next(chip::app::Clusters::ResourceMonitoring::ReplacementProductStruct & item) override; +}; + +void Shutdown(); + +} // namespace HepaFilterMonitoring + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp b/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp similarity index 50% rename from examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp rename to examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp index dc4283539b437b..e0924b8b5c0a30 100644 --- a/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp @@ -19,77 +19,117 @@ #include #include #include -#include +#include using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::ResourceMonitoring; +using namespace chip::app::Clusters::ActivatedCarbonFilterMonitoring; +using namespace chip::app::Clusters::HepaFilterMonitoring; using chip::Protocols::InteractionModel::Status; -constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) | - static_cast(Feature::kReplacementProductList) }; -constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) | - static_cast(Feature::kReplacementProductList) }; +constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; +constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; + +static ActivatedCarbonFilterMonitoringDelegate * gActivatedCarbonFilterDelegate = nullptr; +static ResourceMonitoring::Instance * gActivatedCarbonFilterInstance = nullptr; + +static HepaFilterMonitoringDelegate * gHepaFilterDelegate = nullptr; +static ResourceMonitoring::Instance * gHepaFilterInstance = nullptr; -static HepaFilterMonitoringInstance * gHepaFilterInstance = nullptr; -static ActivatedCarbonFilterMonitoringInstance * gActivatedCarbonFilterInstance = nullptr; static ImmutableReplacementProductListManager sReplacementProductListManager; -//-- Activated Carbon Filter Monitoring Instance methods -CHIP_ERROR ActivatedCarbonFilterMonitoringInstance::AppInit() +//-- Activated Carbon Filter Monitoring delegate methods +CHIP_ERROR ActivatedCarbonFilterMonitoringDelegate::Init() { ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::Init()"); - SetReplacementProductListManagerInstance(&sReplacementProductListManager); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); return CHIP_NO_ERROR; } -Status ActivatedCarbonFilterMonitoringInstance::PreResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status ActivatedCarbonFilterMonitoringInstance::PostResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } -//-- Hepa Filter Monitoring instance methods -CHIP_ERROR HepaFilterMonitoringInstance::AppInit() +void ActivatedCarbonFilterMonitoring::Shutdown() +{ + if (gActivatedCarbonFilterInstance != nullptr) + { + delete gActivatedCarbonFilterInstance; + gActivatedCarbonFilterInstance = nullptr; + } + if (gActivatedCarbonFilterDelegate != nullptr) + { + delete gActivatedCarbonFilterDelegate; + gActivatedCarbonFilterDelegate = nullptr; + } +} + +//-- Hepa Filter Monitoring delegate methods +CHIP_ERROR HepaFilterMonitoringDelegate::Init() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::Init()"); - SetReplacementProductListManagerInstance(&sReplacementProductListManager); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::Init()"); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); return CHIP_NO_ERROR; } -Status HepaFilterMonitoringInstance::PreResetCondition() +Status HepaFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status HepaFilterMonitoringInstance::PostResetCondition() +Status HepaFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } +void HepaFilterMonitoring::Shutdown() +{ + if (gHepaFilterInstance != nullptr) + { + delete gHepaFilterInstance; + gHepaFilterInstance = nullptr; + } + if (gHepaFilterDelegate != nullptr) + { + delete gHepaFilterDelegate; + gHepaFilterDelegate = nullptr; + } +} + void emberAfActivatedCarbonFilterMonitoringClusterInitCallback(chip::EndpointId endpoint) { - VerifyOrDie(gActivatedCarbonFilterInstance == nullptr); - gActivatedCarbonFilterInstance = new ActivatedCarbonFilterMonitoringInstance( - endpoint, static_cast(gActivatedCarbonFeatureMap.to_ulong()), DegradationDirectionEnum::kDown, true); + VerifyOrDie(gActivatedCarbonFilterInstance == nullptr && gActivatedCarbonFilterDelegate == nullptr); + gActivatedCarbonFilterDelegate = new ActivatedCarbonFilterMonitoringDelegate; + gActivatedCarbonFilterInstance = new ResourceMonitoring::Instance( + gActivatedCarbonFilterDelegate, endpoint, ActivatedCarbonFilterMonitoring::Id, + static_cast(gActivatedCarbonFeatureMap.to_ulong()), ResourceMonitoring::DegradationDirectionEnum::kDown, true); gActivatedCarbonFilterInstance->Init(); } + void emberAfHepaFilterMonitoringClusterInitCallback(chip::EndpointId endpoint) { - VerifyOrDie(gHepaFilterInstance == nullptr); - gHepaFilterInstance = new HepaFilterMonitoringInstance(endpoint, static_cast(gHepaFilterFeatureMap.to_ulong()), - DegradationDirectionEnum::kDown, true); + VerifyOrDie(gHepaFilterInstance == nullptr && gHepaFilterDelegate == nullptr); + + gHepaFilterDelegate = new HepaFilterMonitoringDelegate; + gHepaFilterInstance = new ResourceMonitoring::Instance(gHepaFilterDelegate, endpoint, HepaFilterMonitoring::Id, + static_cast(gHepaFilterFeatureMap.to_ulong()), + ResourceMonitoring::DegradationDirectionEnum::kDown, true); gHepaFilterInstance->Init(); } diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 82423baf24f607..d635c806c42375 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -156,7 +156,7 @@ list( ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp diff --git a/examples/all-clusters-app/asr/BUILD.gn b/examples/all-clusters-app/asr/BUILD.gn index aa67f8cd72042f..e023a48cb3643e 100755 --- a/examples/all-clusters-app/asr/BUILD.gn +++ b/examples/all-clusters-app/asr/BUILD.gn @@ -74,7 +74,7 @@ asr_executable("clusters_app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn index 34ba1c1d3e72c9..5c166468dffea2 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn @@ -79,7 +79,7 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index c8d6f5a21acd5d..ff5f7815168486 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -79,7 +79,7 @@ ti_simplelink_executable("all-clusters-app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/all-clusters-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-app/infineon/psoc6/BUILD.gn index 61ce1a58961802..aa0acaf2bee415 100644 --- a/examples/all-clusters-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-app/infineon/psoc6/BUILD.gn @@ -110,7 +110,7 @@ psoc6_executable("clusters_app") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/all-clusters-app/linux/BUILD.gn b/examples/all-clusters-app/linux/BUILD.gn index a3ecb76807fa3e..6321a838f2c689 100644 --- a/examples/all-clusters-app/linux/BUILD.gn +++ b/examples/all-clusters-app/linux/BUILD.gn @@ -31,7 +31,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp index b3c942dfe09da3..3315f6c84297fe 100644 --- a/examples/all-clusters-app/linux/main-common.cpp +++ b/examples/all-clusters-app/linux/main-common.cpp @@ -24,6 +24,7 @@ #include "laundry-washer-controls-delegate-impl.h" #include "laundry-washer-mode.h" #include "operational-state-delegate-impl.h" +#include "resource-monitoring-delegates.h" #include "rvc-modes.h" #include "tcc-mode.h" #include @@ -227,6 +228,8 @@ void ApplicationShutdown() Clusters::RvcCleanMode::Shutdown(); Clusters::RvcRunMode::Shutdown(); Clusters::RefrigeratorAndTemperatureControlledCabinetMode::Shutdown(); + Clusters::HepaFilterMonitoring::Shutdown(); + Clusters::ActivatedCarbonFilterMonitoring::Shutdown(); Clusters::AirQuality::Shutdown(); Clusters::OperationalState::Shutdown(); diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index 0424e3a6484e38..b784bc0c32e163 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -62,7 +62,7 @@ target_sources(${APP_TARGET} PRIVATE ${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-instances.cpp + ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp ${ALL_CLUSTERS_COMMON}/src/smco-stub.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-temperature-levels.cpp diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index 9593bb7232c9a2..69521548530d47 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -64,7 +64,7 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-instances.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) chip_configure_data_model(app diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index f00d4d597c6087..2a227860192d7c 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -77,7 +77,7 @@ mw320_executable("shell_mw320") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/all-clusters-app/openiotsdk/CMakeLists.txt b/examples/all-clusters-app/openiotsdk/CMakeLists.txt index eb9e3faa8688c3..ea02c19c076ad0 100644 --- a/examples/all-clusters-app/openiotsdk/CMakeLists.txt +++ b/examples/all-clusters-app/openiotsdk/CMakeLists.txt @@ -56,7 +56,7 @@ target_sources(${APP_TARGET} ${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-instances.cpp + ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp ${ALL_CLUSTERS_COMMON}/src/static-supported-modes-manager.cpp ${ALL_CLUSTERS_COMMON}/src/binding-handler.cpp ) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index d3165fb7500d3d..25b0d1ec279e5b 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -78,7 +78,7 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp - ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-instances.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp ${TELINK_COMMON}/common/src/mainCommon.cpp ${TELINK_COMMON}/common/src/AppTaskCommon.cpp ${TELINK_COMMON}/util/src/LEDWidget.cpp diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index 5b4d63336949b7..e755bcaef060ea 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -27,7 +27,7 @@ source_set("chip-all-clusters-common") { "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp", + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", diff --git a/examples/placeholder/linux/apps/app1/BUILD.gn b/examples/placeholder/linux/apps/app1/BUILD.gn index 99b3547b81e7c8..ef7c277ec7f663 100644 --- a/examples/placeholder/linux/apps/app1/BUILD.gn +++ b/examples/placeholder/linux/apps/app1/BUILD.gn @@ -30,7 +30,7 @@ source_set("app1") { ] sources = [ - "../../resource-monitoring-instances.cpp", + "../../resource-monitoring-delegates.cpp", "../../src/bridged-actions-stub.cpp", "../../static-supported-modes-manager.cpp", ] diff --git a/examples/placeholder/linux/apps/app2/BUILD.gn b/examples/placeholder/linux/apps/app2/BUILD.gn index 91777971875d15..5c18b7d2dc0914 100644 --- a/examples/placeholder/linux/apps/app2/BUILD.gn +++ b/examples/placeholder/linux/apps/app2/BUILD.gn @@ -30,7 +30,7 @@ source_set("app2") { ] sources = [ - "../../resource-monitoring-instances.cpp", + "../../resource-monitoring-delegates.cpp", "../../src/bridged-actions-stub.cpp", "../../static-supported-modes-manager.cpp", ] diff --git a/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-instances.h b/examples/placeholder/linux/include/resource-monitoring-delegates.h similarity index 52% rename from examples/all-clusters-app/all-clusters-common/include/resource-monitoring-instances.h rename to examples/placeholder/linux/include/resource-monitoring-delegates.h index 276e423626c1d7..00bdb02091cddb 100644 --- a/examples/all-clusters-app/all-clusters-common/include/resource-monitoring-instances.h +++ b/examples/placeholder/linux/include/resource-monitoring-delegates.h @@ -20,39 +20,39 @@ #include #include -/// This is an application level Instance to handle ActivatedCarbonfilterMonitoringInstance commands according to the specific +namespace chip { +namespace app { +namespace Clusters { + +namespace ActivatedCarbonFilterMonitoring { + +/// This is an application level Delegate to handle ActivatedCarbonFilterMonitoringDelegate commands according to the specific /// business logic. -class ActivatedCarbonFilterMonitoringInstance : public chip::app::Clusters::ResourceMonitoring::Instance +class ActivatedCarbonFilterMonitoringDelegate : public ResourceMonitoring::Delegate { private: - CHIP_ERROR AppInit() override; + CHIP_ERROR Init() override; chip::Protocols::InteractionModel::Status PreResetCondition() override; chip::Protocols::InteractionModel::Status PostResetCondition() override; public: - ActivatedCarbonFilterMonitoringInstance( - chip::EndpointId aEndpointId, uint32_t aFeature, - chip::app::Clusters::ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id, aFeature, aDegradationDirection, - aResetConditionCommandSupported){}; + ~ActivatedCarbonFilterMonitoringDelegate() override = default; }; -/// This is an application level instance to handle HepaFilterMonitoringInstance commands according to the specific business logic. -class HepaFilterMonitoringInstance : public chip::app::Clusters::ResourceMonitoring::Instance +} // namespace ActivatedCarbonFilterMonitoring + +namespace HepaFilterMonitoring { + +/// This is an application level delegate to handle HepaFilterMonitoringDelegate commands according to the specific business logic. +class HepaFilterMonitoringDelegate : public ResourceMonitoring::Delegate { private: - CHIP_ERROR AppInit() override; + CHIP_ERROR Init() override; chip::Protocols::InteractionModel::Status PreResetCondition() override; chip::Protocols::InteractionModel::Status PostResetCondition() override; public: - HepaFilterMonitoringInstance( - chip::EndpointId aEndpointId, uint32_t aFeature, - chip::app::Clusters::ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, chip::app::Clusters::HepaFilterMonitoring::Id, aFeature, aDegradationDirection, - aResetConditionCommandSupported){}; + ~HepaFilterMonitoringDelegate() override = default; }; class ImmutableReplacementProductListManager : public chip::app::Clusters::ResourceMonitoring::ReplacementProductListManager @@ -61,3 +61,9 @@ class ImmutableReplacementProductListManager : public chip::app::Clusters::Resou CHIP_ERROR Next(chip::app::Clusters::ResourceMonitoring::ReplacementProductStruct & item) override; }; + +} // namespace HepaFilterMonitoring + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/placeholder/linux/include/resource-monitoring-instances.h b/examples/placeholder/linux/include/resource-monitoring-instances.h deleted file mode 100644 index 276e423626c1d7..00000000000000 --- a/examples/placeholder/linux/include/resource-monitoring-instances.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * - * Copyright (c) 2023 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 -#include - -/// This is an application level Instance to handle ActivatedCarbonfilterMonitoringInstance commands according to the specific -/// business logic. -class ActivatedCarbonFilterMonitoringInstance : public chip::app::Clusters::ResourceMonitoring::Instance -{ -private: - CHIP_ERROR AppInit() override; - chip::Protocols::InteractionModel::Status PreResetCondition() override; - chip::Protocols::InteractionModel::Status PostResetCondition() override; - -public: - ActivatedCarbonFilterMonitoringInstance( - chip::EndpointId aEndpointId, uint32_t aFeature, - chip::app::Clusters::ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, chip::app::Clusters::ActivatedCarbonFilterMonitoring::Id, aFeature, aDegradationDirection, - aResetConditionCommandSupported){}; -}; - -/// This is an application level instance to handle HepaFilterMonitoringInstance commands according to the specific business logic. -class HepaFilterMonitoringInstance : public chip::app::Clusters::ResourceMonitoring::Instance -{ -private: - CHIP_ERROR AppInit() override; - chip::Protocols::InteractionModel::Status PreResetCondition() override; - chip::Protocols::InteractionModel::Status PostResetCondition() override; - -public: - HepaFilterMonitoringInstance( - chip::EndpointId aEndpointId, uint32_t aFeature, - chip::app::Clusters::ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, chip::app::Clusters::HepaFilterMonitoring::Id, aFeature, aDegradationDirection, - aResetConditionCommandSupported){}; -}; - -class ImmutableReplacementProductListManager : public chip::app::Clusters::ResourceMonitoring::ReplacementProductListManager -{ -public: - CHIP_ERROR - Next(chip::app::Clusters::ResourceMonitoring::ReplacementProductStruct & item) override; -}; diff --git a/examples/placeholder/linux/resource-monitoring-instances.cpp b/examples/placeholder/linux/resource-monitoring-delegates.cpp similarity index 60% rename from examples/placeholder/linux/resource-monitoring-instances.cpp rename to examples/placeholder/linux/resource-monitoring-delegates.cpp index a030beed78c7e6..f7a5662d6f5577 100644 --- a/examples/placeholder/linux/resource-monitoring-instances.cpp +++ b/examples/placeholder/linux/resource-monitoring-delegates.cpp @@ -19,78 +19,89 @@ #include #include #include -#include +#include using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::ResourceMonitoring; +using namespace chip::app::Clusters::ActivatedCarbonFilterMonitoring; +using namespace chip::app::Clusters::HepaFilterMonitoring; using chip::Protocols::InteractionModel::Status; -constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) | - static_cast(Feature::kReplacementProductList) }; -constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) | - static_cast(Feature::kReplacementProductList) }; +constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; +constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(ResourceMonitoring::Feature::kCondition) | + static_cast(ResourceMonitoring::Feature::kWarning) | + static_cast(ResourceMonitoring::Feature::kReplacementProductList) }; -static HepaFilterMonitoringInstance * gHepaFilterInstance = nullptr; -static ActivatedCarbonFilterMonitoringInstance * gActivatedCarbonFilterInstance = nullptr; +static ActivatedCarbonFilterMonitoringDelegate * gActivatedCarbonFilterDelegate = nullptr; +static ResourceMonitoring::Instance * gActivatedCarbonFilterInstance = nullptr; + +static HepaFilterMonitoringDelegate * gHepaFilterDelegate = nullptr; +static ResourceMonitoring::Instance * gHepaFilterInstance = nullptr; static ImmutableReplacementProductListManager sReplacementProductListManager; //-- Activated Carbon Filter Monitoring Instance methods -CHIP_ERROR ActivatedCarbonFilterMonitoringInstance::AppInit() +CHIP_ERROR ActivatedCarbonFilterMonitoringDelegate::Init() { ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::Init()"); - SetReplacementProductListManagerInstance(&sReplacementProductListManager); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); return CHIP_NO_ERROR; } -Status ActivatedCarbonFilterMonitoringInstance::PreResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status ActivatedCarbonFilterMonitoringInstance::PostResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } //-- Hepa Filter Monitoring instance methods -CHIP_ERROR HepaFilterMonitoringInstance::AppInit() +CHIP_ERROR HepaFilterMonitoringDelegate::Init() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::Init()"); - SetReplacementProductListManagerInstance(&sReplacementProductListManager); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::Init()"); + GetInstance()->SetReplacementProductListManagerInstance(&sReplacementProductListManager); return CHIP_NO_ERROR; } -Status HepaFilterMonitoringInstance::PreResetCondition() +Status HepaFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status HepaFilterMonitoringInstance::PostResetCondition() +Status HepaFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } void emberAfActivatedCarbonFilterMonitoringClusterInitCallback(chip::EndpointId endpoint) { VerifyOrDie(gActivatedCarbonFilterInstance == nullptr); - gActivatedCarbonFilterInstance = new ActivatedCarbonFilterMonitoringInstance( - endpoint, static_cast(gActivatedCarbonFeatureMap.to_ulong()), DegradationDirectionEnum::kDown, true); + + gActivatedCarbonFilterDelegate = new ActivatedCarbonFilterMonitoringDelegate; + gActivatedCarbonFilterInstance = new ResourceMonitoring::Instance( + gActivatedCarbonFilterDelegate, endpoint, ActivatedCarbonFilterMonitoring::Id, + static_cast(gActivatedCarbonFeatureMap.to_ulong()), ResourceMonitoring::DegradationDirectionEnum::kDown, true); gActivatedCarbonFilterInstance->Init(); } void emberAfHepaFilterMonitoringClusterInitCallback(chip::EndpointId endpoint) { VerifyOrDie(gHepaFilterInstance == nullptr); - gHepaFilterInstance = new HepaFilterMonitoringInstance(endpoint, static_cast(gHepaFilterFeatureMap.to_ulong()), - DegradationDirectionEnum::kDown, true); + + gHepaFilterDelegate = new HepaFilterMonitoringDelegate; + gHepaFilterInstance = new ResourceMonitoring::Instance(gHepaFilterDelegate, endpoint, HepaFilterMonitoring::Id, + static_cast(gHepaFilterFeatureMap.to_ulong()), + ResourceMonitoring::DegradationDirectionEnum::kDown, true); gHepaFilterInstance->Init(); } diff --git a/examples/resource-monitoring-app/linux/BUILD.gn b/examples/resource-monitoring-app/linux/BUILD.gn index e9d5e391def96c..b9a1e41f92b053 100644 --- a/examples/resource-monitoring-app/linux/BUILD.gn +++ b/examples/resource-monitoring-app/linux/BUILD.gn @@ -31,8 +31,8 @@ config("includes") { executable("chip-resource-monitoring-app") { sources = [ "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/ReplacementProductListManager.cpp", - "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp", - "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepaFilterMonitoring.cpp", + "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/ActivatedCarbonFilterMonitoring.cpp", + "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/HepaFilterMonitoring.cpp", "include/CHIPProjectAppConfig.h", "src/main.cpp", ] @@ -40,7 +40,7 @@ executable("chip-resource-monitoring-app") { deps = [ "${chip_root}/examples/platform/linux:app-main", "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common", - "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common:instances", + "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common:delegates", "${chip_root}/src/lib", ] diff --git a/examples/resource-monitoring-app/linux/src/main.cpp b/examples/resource-monitoring-app/linux/src/main.cpp index dd6e1231d6a9e2..b6059739ced19f 100644 --- a/examples/resource-monitoring-app/linux/src/main.cpp +++ b/examples/resource-monitoring-app/linux/src/main.cpp @@ -20,8 +20,8 @@ #include #include #include -#include -#include +#include +#include #include using namespace chip; @@ -36,11 +36,17 @@ constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Featu static_cast(Feature::kWarning) | static_cast(Feature::kReplacementProductList) }; -static HepaFilterMonitoringInstance gHepaFilterInstance(0x1, static_cast(gHepaFilterFeatureMap.to_ulong()), +static HepaFilterMonitoringDelegate gHepaFilterDelegate; +static ResourceMonitoring::Instance gHepaFilterInstance(&gHepaFilterDelegate, 0x1, HepaFilterMonitoring::Id, + static_cast(gHepaFilterFeatureMap.to_ulong()), Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, true); -static ActivatedCarbonFilterMonitoringInstance - gActivatedCarbonFilterInstance(0x1, static_cast(gActivatedCarbonFeatureMap.to_ulong()), - Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, true); + +static ActivatedCarbonFilterMonitoringDelegate gActivatedCarbonFilterDelegate; +static ResourceMonitoring::Instance gActivatedCarbonFilterInstance(&gActivatedCarbonFilterDelegate, 0x1, + ActivatedCarbonFilterMonitoring::Id, + static_cast(gActivatedCarbonFeatureMap.to_ulong()), + Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, + true); void ApplicationInit() { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/BUILD.gn b/examples/resource-monitoring-app/resource-monitoring-common/BUILD.gn index 9156c450353a66..0d33513378e9c7 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/BUILD.gn +++ b/examples/resource-monitoring-app/resource-monitoring-common/BUILD.gn @@ -19,7 +19,7 @@ config("config") { include_dirs = [ "include" ] } -source_set("instances") { +source_set("delegates") { public_configs = [ ":config" ] } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/include/instances/ActivatedCarbonFilterMonitoring.h b/examples/resource-monitoring-app/resource-monitoring-common/include/delegates/ActivatedCarbonFilterMonitoring.h similarity index 68% rename from examples/resource-monitoring-app/resource-monitoring-common/include/instances/ActivatedCarbonFilterMonitoring.h rename to examples/resource-monitoring-app/resource-monitoring-common/include/delegates/ActivatedCarbonFilterMonitoring.h index a077a6b9a7209f..9b064f8526906e 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/include/instances/ActivatedCarbonFilterMonitoring.h +++ b/examples/resource-monitoring-app/resource-monitoring-common/include/delegates/ActivatedCarbonFilterMonitoring.h @@ -32,22 +32,17 @@ namespace Clusters { namespace ResourceMonitoring { -/// This is an application level Instance to handle ActivatedCarbonfilterMonitoringInstance commands according to the specific +/// This is an application level delegate to handle ActivatedCarbonFilterMonitoringDelegate commands according to the specific /// business logic. -class ActivatedCarbonFilterMonitoringInstance : public ResourceMonitoring::Instance +class ActivatedCarbonFilterMonitoringDelegate : public ResourceMonitoring::Delegate { private: - CHIP_ERROR AppInit() override; + CHIP_ERROR Init() override; chip::Protocols::InteractionModel::Status PreResetCondition() override; chip::Protocols::InteractionModel::Status PostResetCondition() override; public: - ActivatedCarbonFilterMonitoringInstance( - EndpointId aEndpointId, uint32_t aFeature, - ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, ActivatedCarbonFilterMonitoring::Id, aFeature, aDegradationDirection, - aResetConditionCommandSupported){}; + ~ActivatedCarbonFilterMonitoringDelegate() override = default; }; } // namespace ResourceMonitoring diff --git a/examples/resource-monitoring-app/resource-monitoring-common/include/instances/HepaFilterMonitoring.h b/examples/resource-monitoring-app/resource-monitoring-common/include/delegates/HepaFilterMonitoring.h similarity index 68% rename from examples/resource-monitoring-app/resource-monitoring-common/include/instances/HepaFilterMonitoring.h rename to examples/resource-monitoring-app/resource-monitoring-common/include/delegates/HepaFilterMonitoring.h index a5ef89785e0a35..ea7b4f76da973e 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/include/instances/HepaFilterMonitoring.h +++ b/examples/resource-monitoring-app/resource-monitoring-common/include/delegates/HepaFilterMonitoring.h @@ -32,19 +32,16 @@ namespace Clusters { namespace ResourceMonitoring { -/// This is an application level instance to handle HepaFilterMonitoringInstance commands according to the specific business logic. -class HepaFilterMonitoringInstance : public ResourceMonitoring::Instance +/// This is an application level delegate to handle HepaFilterMonitoringDelegate commands according to the specific business logic. +class HepaFilterMonitoringDelegate : public ResourceMonitoring::Delegate { private: - CHIP_ERROR AppInit() override; + CHIP_ERROR Init() override; chip::Protocols::InteractionModel::Status PreResetCondition() override; chip::Protocols::InteractionModel::Status PostResetCondition() override; public: - HepaFilterMonitoringInstance(EndpointId aEndpointId, uint32_t aFeature, - ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - Instance(aEndpointId, HepaFilterMonitoring::Id, aFeature, aDegradationDirection, aResetConditionCommandSupported){}; + ~HepaFilterMonitoringDelegate() override = default; }; } // namespace ResourceMonitoring diff --git a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp b/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/ActivatedCarbonFilterMonitoring.cpp similarity index 82% rename from examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp rename to examples/resource-monitoring-app/resource-monitoring-common/src/delegates/ActivatedCarbonFilterMonitoring.cpp index 3ab33e675e02a9..2c00ee8b80a115 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp +++ b/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/ActivatedCarbonFilterMonitoring.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -46,24 +46,24 @@ StaticReplacementProductListManager sActivatedCarbonFilterReplacementProductListManager(&sActivatedCarbonFilterReplacementProductsList[0], ArraySize(sActivatedCarbonFilterReplacementProductsList)); -//-- Activated carbon filter Monitoring Instance methods -CHIP_ERROR ActivatedCarbonFilterMonitoringInstance::AppInit() +//-- Activated carbon filter Monitoring Delegate methods +CHIP_ERROR ActivatedCarbonFilterMonitoringDelegate::Init() { ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::Init()"); - SetReplacementProductListManagerInstance(&sActivatedCarbonFilterReplacementProductListManager); + GetInstance()->SetReplacementProductListManagerInstance(&sActivatedCarbonFilterReplacementProductListManager); return CHIP_NO_ERROR; } -Status ActivatedCarbonFilterMonitoringInstance::PreResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status ActivatedCarbonFilterMonitoringInstance::PostResetCondition() +Status ActivatedCarbonFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp b/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/HepaFilterMonitoring.cpp similarity index 74% rename from examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp rename to examples/resource-monitoring-app/resource-monitoring-common/src/delegates/HepaFilterMonitoring.cpp index 6404f973a95097..31a7a478093d99 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp +++ b/examples/resource-monitoring-app/resource-monitoring-common/src/delegates/HepaFilterMonitoring.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,24 +36,24 @@ using chip::Protocols::InteractionModel::Status; static ImmutableReplacementProductListManager sHepaFilterReplacementProductListManager; -//-- Hepa filter Monitoring instance methods -CHIP_ERROR HepaFilterMonitoringInstance::AppInit() +//-- Hepa filter Monitoring Delegate methods +CHIP_ERROR HepaFilterMonitoringDelegate::Init() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::Init()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::Init()"); - SetReplacementProductListManagerInstance(&sHepaFilterReplacementProductListManager); + GetInstance()->SetReplacementProductListManagerInstance(&sHepaFilterReplacementProductListManager); return CHIP_NO_ERROR; } -Status HepaFilterMonitoringInstance::PreResetCondition() +Status HepaFilterMonitoringDelegate::PreResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PreResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PreResetCondition()"); return Status::Success; } -Status HepaFilterMonitoringInstance::PostResetCondition() +Status HepaFilterMonitoringDelegate::PostResetCondition() { - ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::PostResetCondition()"); + ChipLogDetail(Zcl, "HepaFilterMonitoringDelegate::PostResetCondition()"); return Status::Success; } diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h index 970a85c957bdf3..61d90da007df0a 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h @@ -31,7 +31,6 @@ namespace ResourceMonitoring { // max of 20 characters as defined by the constraint on the ProductIdentifierValue in the specification static constexpr size_t kProductIdentifierValueMaxNameLength = 20u; -static constexpr std::array AliasedClusters = { HepaFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Id }; // Enum for ChangeIndicationEnum enum class ChangeIndicationEnum : uint8_t diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index 8b2f9ea467fc37..c8d8d44bb59d9a 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -45,11 +45,26 @@ namespace app { namespace Clusters { namespace ResourceMonitoring { +Instance::Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, uint32_t aFeatureMap, + ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, + bool aResetConditionCommandSupported) : + CommandHandlerInterface(Optional(aEndpointId), aClusterId), + AttributeAccessInterface(Optional(aEndpointId), aClusterId), mDelegate(aDelegate), mEndpointId(aEndpointId), + mClusterId(aClusterId), mDegradationDirection(aDegradationDirection), mFeatureMap(aFeatureMap), + mResetConditionCommandSupported(aResetConditionCommandSupported) +{ + mDelegate->SetInstance(this); +}; + +Instance::~Instance() +{ + InteractionModelEngine::GetInstance()->UnregisterCommandHandler(this); + unregisterAttributeAccessOverride(this); +} + CHIP_ERROR Instance::Init() { ChipLogDetail(Zcl, "ResourceMonitoring: Init"); - // Check that the cluster ID given is a valid mode select alias cluster ID. - VerifyOrDie(IsValidAliasCluster()); // Check if the cluster has been selected in zap VerifyOrDie(emberAfContainsServer(mEndpointId, mClusterId)); @@ -58,8 +73,8 @@ CHIP_ERROR Instance::Init() ReturnErrorOnFailure(chip::app::InteractionModelEngine::GetInstance()->RegisterCommandHandler(this)); VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); - ChipLogDetail(Zcl, "ResourceMonitoring: calling AppInit()"); - ReturnErrorOnFailure(AppInit()); + ChipLogDetail(Zcl, "ResourceMonitoring: calling mDelegate->Init()"); + ReturnErrorOnFailure(mDelegate->Init()); return CHIP_NO_ERROR; } @@ -157,63 +172,6 @@ ReplacementProductListManager * Instance::GetReplacementProductListManagerInstan return mReplacementProductListManager; } -Status Instance::OnResetCondition() -{ - ChipLogDetail(Zcl, "ResourceMonitoringServer::OnResetCondition()"); - - // call application specific pre reset logic, - // anything other than Success will cause the command to fail, and not do any of the resets - auto status = PreResetCondition(); - if (status != Status::Success) - { - return status; - } - // Handle the reset of the condition attribute, if supported - if (emberAfContainsAttribute(GetEndpointId(), mClusterId, Attributes::Condition::Id)) - { - if (GetDegradationDirection() == DegradationDirectionEnum::kDown) - { - UpdateCondition(100); - } - else if (GetDegradationDirection() == DegradationDirectionEnum::kUp) - { - UpdateCondition(0); - } - } - - // handle the reset of the ChangeIndication attribute, mandatory - UpdateChangeIndication(ChangeIndicationEnum::kOk); - - // Handle the reset of the LastChangedTime attribute, if supported - if (emberAfContainsAttribute(GetEndpointId(), mClusterId, Attributes::LastChangedTime::Id)) - { - System::Clock::Milliseconds64 currentUnixTimeMS; - System::Clock::ClockImpl clock; - CHIP_ERROR err = clock.GetClock_RealTimeMS(currentUnixTimeMS); - if (err == CHIP_NO_ERROR) - { - System::Clock::Seconds32 currentUnixTime = std::chrono::duration_cast(currentUnixTimeMS); - UpdateLastChangedTime(DataModel::MakeNullable(currentUnixTime.count())); - } - } - - // call application specific post reset logic - status = PostResetCondition(); - return status; -} - -Status Instance::PreResetCondition() -{ - ChipLogDetail(Zcl, "ResourceMonitoringServer::PreResetCondition()"); - return Status::Success; -} - -Status Instance::PostResetCondition() -{ - ChipLogDetail(Zcl, "ResourceMonitoringServer::PostResetCondition()"); - return Status::Success; -} - // This method is called by the interaction model engine when a command destined for this instance is received. void Instance::InvokeCommand(HandlerContext & handlerContext) { @@ -242,7 +200,7 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust return CHIP_NO_ERROR; } -CHIP_ERROR Instance::ReadReplacableProductList(AttributeValueEncoder & aEncoder) +CHIP_ERROR Instance::ReadReplaceableProductList(AttributeValueEncoder & aEncoder) { CHIP_ERROR err = CHIP_NO_ERROR; if (HasFeature(ResourceMonitoring::Feature::kReplacementProductList)) @@ -301,7 +259,7 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu break; } case Attributes::ReplacementProductList::Id: { - return ReadReplacableProductList(aEncoder); + return ReadReplaceableProductList(aEncoder); break; } } @@ -373,24 +331,69 @@ void Instance::LoadPersistentAttributes() } } -bool Instance::IsValidAliasCluster() const +void Instance::HandleResetCondition(HandlerContext & ctx, + const ResourceMonitoring::Commands::ResetCondition::DecodableType & commandData) +{ + + Status resetConditionStatus = mDelegate->OnResetCondition(); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, resetConditionStatus); +} + +Status Delegate::OnResetCondition() { - for (unsigned int AliasedCluster : AliasedClusters) + ChipLogDetail(Zcl, "ResourceMonitoringServer::OnResetCondition()"); + + // call application specific pre reset logic, + // anything other than Success will cause the command to fail, and not do any of the resets + auto status = PreResetCondition(); + if (status != Status::Success) + { + return status; + } + // Handle the reset of the condition attribute, if supported + if (emberAfContainsAttribute(mInstance->GetEndpointId(), mInstance->GetClusterId(), Attributes::Condition::Id)) + { + if (mInstance->GetDegradationDirection() == DegradationDirectionEnum::kDown) + { + mInstance->UpdateCondition(100); + } + else if (mInstance->GetDegradationDirection() == DegradationDirectionEnum::kUp) + { + mInstance->UpdateCondition(0); + } + } + + // handle the reset of the ChangeIndication attribute, mandatory + mInstance->UpdateChangeIndication(ChangeIndicationEnum::kOk); + + // Handle the reset of the LastChangedTime attribute, if supported + if (emberAfContainsAttribute(mInstance->GetEndpointId(), mInstance->GetClusterId(), Attributes::LastChangedTime::Id)) { - if (mClusterId == AliasedCluster) + System::Clock::Milliseconds64 currentUnixTimeMS; + System::Clock::ClockImpl clock; + CHIP_ERROR err = clock.GetClock_RealTimeMS(currentUnixTimeMS); + if (err == CHIP_NO_ERROR) { - return true; + System::Clock::Seconds32 currentUnixTime = std::chrono::duration_cast(currentUnixTimeMS); + mInstance->UpdateLastChangedTime(DataModel::MakeNullable(currentUnixTime.count())); } } - return false; + + // call application specific post reset logic + status = PostResetCondition(); + return status; } -void Instance::HandleResetCondition(HandlerContext & ctx, - const ResourceMonitoring::Commands::ResetCondition::DecodableType & commandData) +Status Delegate::PreResetCondition() { + ChipLogDetail(Zcl, "ResourceMonitoringServer::PreResetCondition()"); + return Status::Success; +} - Status resetConditionStatus = OnResetCondition(); - ctx.mCommandHandler.AddStatus(ctx.mRequestPath, resetConditionStatus); +Status Delegate::PostResetCondition() +{ + ChipLogDetail(Zcl, "ResourceMonitoringServer::PostResetCondition()"); + return Status::Success; } } // namespace ResourceMonitoring diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index f793b36c95cb32..80c6da82d37431 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -36,10 +36,37 @@ namespace app { namespace Clusters { namespace ResourceMonitoring { +// forward declarations +class Delegate; + class Instance : public CommandHandlerInterface, public AttributeAccessInterface { public: + /** + * Creates a resource monitoring cluster instance. The Init() method needs to be called for this instance to be registered and + * called by the interaction model at the appropriate times. + * + * @param aDelegate A pointer to the delegate to be used by this server. + * Note: the caller must ensure that the delegate lives throughout the instance's lifetime. + * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. + * @param aClusterId The ID of the ResourceMonitoring aliased cluster to be instantiated. + * @param aFeatureMap The feature map of the cluster. + * @param aDegradationDirection The degradation direction of the cluster. + * @param aResetConditionCommandSupported Whether the ResetCondition command is supported by the cluster. + */ + Instance(Delegate * aDelegate, EndpointId aEndpointId, ClusterId aClusterId, uint32_t aFeatureMap, + ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, + bool aResetConditionCommandSupported); + + ~Instance() override; + + // Not copyable or movable + Instance(const Instance &) = delete; + Instance & operator=(const Instance &) = delete; + Instance(Instance &&) = delete; + Instance & operator=(Instance &&) = delete; + /** * Initialise the Resource Monitoring cluster. * @@ -79,32 +106,69 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface DataModel::Nullable GetLastChangedTime() const; EndpointId GetEndpointId() const { return mEndpointId; } + ClusterId GetClusterId() const { return mClusterId; } + +private: + Delegate * mDelegate; + + EndpointId mEndpointId{}; + ClusterId mClusterId{}; + + // attribute Data Store + chip::Percent mCondition = 100; + DegradationDirectionEnum mDegradationDirection = DegradationDirectionEnum::kDown; + ChangeIndicationEnum mChangeIndication = ChangeIndicationEnum::kOk; + bool mInPlaceIndicator = true; + DataModel::Nullable mLastChangedTime; + ReplacementProductListManager * mReplacementProductListManager = nullptr; + + uint32_t mFeatureMap; + + bool mResetConditionCommandSupported = false; + + ReplacementProductListManager * GetReplacementProductListManagerInstance(); + + CHIP_ERROR ReadReplaceableProductList(AttributeValueEncoder & aEncoder); + + // CommandHandlerInterface + void InvokeCommand(HandlerContext & ctx) override; + CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override; + + // AttributeAccessInterface + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + template + void HandleCommand(HandlerContext & handlerContext, FuncT func); + + void LoadPersistentAttributes(); /** - * Creates a resource monitoring cluster instance. The Init() method needs to be called for this instance to be registered and - * called by the interaction model at the appropriate times. - * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. - * @param aClusterId The ID of the ResourceMonitoring aliased cluster to be instantiated. - * @param aFeatureMap The feature map of the cluster. - * @param aDegradationDirection The degradation direction of the cluster. - * @param aResetConditionCommandSupported Whether the ResetCondition command is supported by the cluster. + * Internal method to handle the ResetCondition command. */ - Instance(EndpointId aEndpointId, ClusterId aClusterId, uint32_t aFeatureMap, - ResourceMonitoring::Attributes::DegradationDirection::TypeInfo::Type aDegradationDirection, - bool aResetConditionCommandSupported) : - CommandHandlerInterface(Optional(aEndpointId), aClusterId), - AttributeAccessInterface(Optional(aEndpointId), aClusterId), mEndpointId(aEndpointId), mClusterId(aClusterId), - mDegradationDirection(aDegradationDirection), mFeatureMap(aFeatureMap), - mResetConditionCommandSupported(aResetConditionCommandSupported) - {} + void HandleResetCondition(HandlerContext & ctx, + const ResourceMonitoring::Commands::ResetCondition::DecodableType & commandData); +}; // class Instance - ~Instance() = default; +class Delegate +{ + friend class Instance; - // Not copyable or movable - Instance(const Instance &) = delete; - Instance & operator=(const Instance &) = delete; - Instance(Instance &&) = delete; - Instance & operator=(Instance &&) = delete; +private: + Instance * mInstance = nullptr; + + /** + * This method is used by the SDK to set the instance pointer. This is done during the instantiation of an Instance object. + * @param aInstance A pointer to the Instance object related to this delegate object. + */ + void SetInstance(Instance * aInstance) { mInstance = aInstance; } + +protected: + Instance * GetInstance() { return mInstance; } + +public: + Delegate() = default; + virtual ~Delegate() = default; // The following methods should be overridden by the SDK user to implement the business logic of their application @@ -116,7 +180,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * @return CHIP_NO_ERROR If the application was initialized successfully. All other values will cause the initialization to * fail. */ - virtual CHIP_ERROR AppInit() = 0; + virtual CHIP_ERROR Init() = 0; /** * This method may be overwritten by the SDK User, if the default behaviour is not desired. @@ -154,51 +218,6 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface * the failure. */ virtual chip::Protocols::InteractionModel::Status PostResetCondition(); - -private: - EndpointId mEndpointId{}; - ClusterId mClusterId{}; - - // attribute Data Store - chip::Percent mCondition = 100; - DegradationDirectionEnum mDegradationDirection = DegradationDirectionEnum::kDown; - ChangeIndicationEnum mChangeIndication = ChangeIndicationEnum::kOk; - bool mInPlaceIndicator = true; - DataModel::Nullable mLastChangedTime; - ReplacementProductListManager * mReplacementProductListManager = nullptr; - - uint32_t mFeatureMap; - - bool mResetConditionCommandSupported = false; - - ReplacementProductListManager * GetReplacementProductListManagerInstance(); - - CHIP_ERROR ReadReplacableProductList(AttributeValueEncoder & aEncoder); - - // CommandHandlerInterface - void InvokeCommand(HandlerContext & ctx) override; - CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override; - - // AttributeAccessInterface - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; - - template - void HandleCommand(HandlerContext & handlerContext, FuncT func); - - void LoadPersistentAttributes(); - - /** - * This checks if the clusters instance is a valid ResourceMonitoring cluster based on the AliasedClusters list. - * @return true if the cluster is a valid ResourceMonitoring cluster. - */ - bool IsValidAliasCluster() const; - - /** - * Internal method to handle the ResetCondition command. - */ - void HandleResetCondition(HandlerContext & ctx, - const ResourceMonitoring::Commands::ResetCondition::DecodableType & commandData); }; } // namespace ResourceMonitoring From 35bce82cbbd77cba5abc13c7ffbd5cfef7dc271b Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 31 Aug 2023 14:18:01 +0100 Subject: [PATCH 02/96] Improvements to API for Concentration Measurement Clusters (#28965) * Improved the use of the template args to compile out the entire function * Added a detail namespace with attribute classes that can be inherited based on feature settings * Fixed the hard to read constraints functions to be a bit more logical and better documented * Using overload of MatterReportingAttributeChangeCallback so as to avoid using ConcreteAttributePath * made the checking code in the constraints functions more succinct and removed the need for an old variable in the reporting check --- .../concentration-measurement-server.h | 425 ++++++++---------- 1 file changed, 182 insertions(+), 243 deletions(-) diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index 9c4bbeae6bf613..391674bb844d95 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -32,10 +32,56 @@ namespace app { namespace Clusters { namespace ConcentrationMeasurement { -struct DummyType +namespace Detail { + +struct DummyNumericMeasurementMembers +{ +}; + +struct DummyPeakMeasurementMembers +{ +}; + +struct DummyAverageMeasurementMembers +{ +}; + +struct DummyLevelIndicationMembers +{ +}; + +class NumericMeasurementMembers +{ +protected: + DataModel::Nullable mMeasuredValue; + DataModel::Nullable mMinMeasuredValue; + DataModel::Nullable mMaxMeasuredValue; + MeasurementUnitEnum mMeasurementUnit; + float mUncertainty; +}; + +class PeakMeasurementMembers +{ +protected: + DataModel::Nullable mPeakMeasuredValue; + uint32_t mPeakMeasuredValueWindow; +}; + +class AverageMeasurementMembers +{ +protected: + DataModel::Nullable mAverageMeasuredValue; + uint32_t mAverageMeasuredValueWindow; +}; + +class LevelIndicationMembers { +protected: + LevelValueEnum mLevel; }; +} // namespace Detail + /** * This class provides the base implementation for the server side of the Concentration Measurement cluster as well as an API for * setting the values of the attributes. @@ -49,7 +95,14 @@ struct DummyType */ template -class Instance : public AttributeAccessInterface +class Instance + : public AttributeAccessInterface, + protected std::conditional_t, + protected std::conditional_t, + protected std::conditional_t, + protected std::conditional_t { private: static const int WINDOW_MAX = 604800; @@ -57,18 +110,7 @@ class Instance : public AttributeAccessInterface EndpointId mEndpointId{}; ClusterId mClusterId{}; - // Attribute data store MeasurementMediumEnum mMeasurementMedium; - std::conditional_t, DummyType> mMeasuredValue; - std::conditional_t, DummyType> mMinMeasuredValue; - std::conditional_t, DummyType> mMaxMeasuredValue; - std::conditional_t mMeasurementUnit; - std::conditional_t mUncertainty; - std::conditional_t, DummyType> mPeakMeasuredValue; - std::conditional_t mPeakMeasuredValueWindow; - std::conditional_t, DummyType> mAverageMeasuredValue; - std::conditional_t mAverageMeasuredValueWindow; - std::conditional_t mLevel; uint32_t mFeature = 0; @@ -80,67 +122,70 @@ class Instance : public AttributeAccessInterface case Attributes::MeasuredValue::Id: if constexpr (NumericMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mMeasuredValue)); + ReturnErrorOnFailure(aEncoder.Encode(this->mMeasuredValue)); } break; case Attributes::MinMeasuredValue::Id: if constexpr (NumericMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mMinMeasuredValue)); + ReturnErrorOnFailure(aEncoder.Encode(this->mMinMeasuredValue)); } break; case Attributes::MaxMeasuredValue::Id: if constexpr (NumericMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mMaxMeasuredValue)); + ReturnErrorOnFailure(aEncoder.Encode(this->mMaxMeasuredValue)); } break; case Attributes::Uncertainty::Id: if constexpr (NumericMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mUncertainty)); + ReturnErrorOnFailure(aEncoder.Encode(this->mUncertainty)); } break; case Attributes::MeasurementUnit::Id: - ReturnErrorOnFailure(aEncoder.Encode(mMeasurementUnit)); - break; + if constexpr (NumericMeasurementEnabled) + { + ReturnErrorOnFailure(aEncoder.Encode(this->mMeasurementUnit)); + break; + } case Attributes::PeakMeasuredValue::Id: if constexpr (PeakMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mPeakMeasuredValue)); + ReturnErrorOnFailure(aEncoder.Encode(this->mPeakMeasuredValue)); } break; case Attributes::PeakMeasuredValueWindow::Id: if constexpr (PeakMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mPeakMeasuredValueWindow)); + ReturnErrorOnFailure(aEncoder.Encode(this->mPeakMeasuredValueWindow)); } break; case Attributes::AverageMeasuredValue::Id: if constexpr (AverageMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mAverageMeasuredValue)); + ReturnErrorOnFailure(aEncoder.Encode(this->mAverageMeasuredValue)); } break; case Attributes::AverageMeasuredValueWindow::Id: if constexpr (AverageMeasurementEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mAverageMeasuredValueWindow)); + ReturnErrorOnFailure(aEncoder.Encode(this->mAverageMeasuredValueWindow)); } break; case Attributes::LevelValue::Id: if constexpr (LevelIndicationEnabled) { - ReturnErrorOnFailure(aEncoder.Encode(mLevel)); + ReturnErrorOnFailure(aEncoder.Encode(this->mLevel)); } break; @@ -210,58 +255,42 @@ class Instance : public AttributeAccessInterface }; /** - * This checks is a given value is within the min and max constraints. + * This checks if a given nullable float is within the min and max constraints or two other nullable floats. * @param value The value to check. * @param minValue The minimum value. * @param maxValue The maximum value. - * @return true if the value is within the min and max constraints. + * @return true if the value is within the min and max constraints. If either of the pair of values being compared is null, + * that's considered to be within the constraint. */ static bool CheckConstraintMinMax(DataModel::Nullable value, DataModel::Nullable minValue, DataModel::Nullable maxValue) { - if (!minValue.IsNull() && !value.IsNull() && (minValue.Value() > value.Value())) - { - return false; - } - - if (!maxValue.IsNull() && !value.IsNull() && (maxValue.Value() < value.Value())) - { - return false; - } - - return true; + return (minValue.IsNull() || value.IsNull() || (value.Value() >= minValue.Value())) && + (maxValue.IsNull() || value.IsNull() || (value.Value() <= maxValue.Value())); }; /** - * This checks is a given value is greater than a given value. + * This checks if a given nullable float is less than or equal to another given nullable float. * @param value The value to check. - * @param valueToBeGreaterThan The value to be greater than. - * @return true if the value is greater than the given value. + * @param valueToBeLessThanOrEqualTo The value to be less than or equal to. + * @return true if value is less than or equal to valueToBeLessThanOrEqualTo, or if either of the values is Null. */ - static bool CheckConstraintsGreaterThan(DataModel::Nullable value, DataModel::Nullable valueToBeGreaterThan) + static bool CheckConstraintsLessThanOrEqualTo(DataModel::Nullable value, + DataModel::Nullable valueToBeLessThanOrEqualTo) { - if (!valueToBeGreaterThan.IsNull() && !value.IsNull() && (valueToBeGreaterThan.Value() > value.Value())) - { - return false; - } - - return true; + return valueToBeLessThanOrEqualTo.IsNull() || value.IsNull() || (value.Value() <= valueToBeLessThanOrEqualTo.Value()); }; /** - * This checks is a given value is less than a given value. + * This checks if a given nullable float is greater than or equal to another given nullable float. * @param value The value to check. - * @param valueToBeLessThan The value to be less than. - * @return true if the value is less than the given value. + * @param valueToBeGreaterThanOrEqualTo The value to be greater than or equal to. + * @return true if value is greater than or equal to valueToBeGreaterThanOrEqualTo, or if either of the values is Null. */ - static bool CheckConstraintsLessThan(DataModel::Nullable value, DataModel::Nullable valueToBeLessThan) + static bool CheckConstraintsGreaterThanOrEqualTo(DataModel::Nullable value, + DataModel::Nullable valueToBeGreaterThanOrEqualTo) { - if (!valueToBeLessThan.IsNull() && !value.IsNull() && (valueToBeLessThan.Value() < value.Value())) - { - return false; - } - - return true; + return valueToBeGreaterThanOrEqualTo.IsNull() || value.IsNull() || (value.Value() >= valueToBeGreaterThanOrEqualTo.Value()); }; public: @@ -289,8 +318,10 @@ class Instance : public AttributeAccessInterface Instance(EndpointId aEndpointId, ClusterId aClusterId, MeasurementMediumEnum aMeasurementMedium, MeasurementUnitEnum aMeasurementUnit) : AttributeAccessInterface(Optional(aEndpointId), aClusterId), - mEndpointId(aEndpointId), mClusterId(aClusterId), mMeasurementMedium(aMeasurementMedium), - mMeasurementUnit(aMeasurementUnit){}; + mEndpointId(aEndpointId), mClusterId(aClusterId), mMeasurementMedium(aMeasurementMedium) + { + this->mMeasurementUnit = aMeasurementUnit; + }; ~Instance() override { unregisterAttributeAccessOverride(this); }; @@ -325,256 +356,164 @@ class Instance : public AttributeAccessInterface return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetMeasuredValue(DataModel::Nullable aMeasuredValue) { - if constexpr (NumericMeasurementEnabled) + if (!CheckConstraintMinMax(aMeasuredValue, this->mMinMeasuredValue, this->mMaxMeasuredValue)) { - if (!CheckConstraintMinMax(aMeasuredValue, mMinMeasuredValue, mMaxMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + return CHIP_ERROR_INVALID_ARGUMENT; + } - DataModel::Nullable oldValue = mMeasuredValue; - mMeasuredValue = aMeasuredValue; + // Check to see if a change has ocurred + VerifyOrReturnError(this->mMeasuredValue != aMeasuredValue, CHIP_NO_ERROR); + this->mMeasuredValue = aMeasuredValue; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MeasuredValue::Id); - if (oldValue != mMeasuredValue) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MeasuredValue::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetMinMeasuredValue(DataModel::Nullable aMinMeasuredValue) { - if constexpr (NumericMeasurementEnabled) + if (!CheckConstraintsLessThanOrEqualTo(aMinMeasuredValue, this->mMaxMeasuredValue)) { - if (!CheckConstraintsLessThan(aMinMeasuredValue, mMaxMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - if (!CheckConstraintsLessThan(aMinMeasuredValue, mMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - DataModel::Nullable oldValue = mMinMeasuredValue; - mMinMeasuredValue = aMinMeasuredValue; - - if (oldValue != mMinMeasuredValue) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MinMeasuredValue::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; + return CHIP_ERROR_INVALID_ARGUMENT; } - else + + if (!CheckConstraintsLessThanOrEqualTo(aMinMeasuredValue, this->mMeasuredValue)) { - return CHIP_ERROR_INCORRECT_STATE; + return CHIP_ERROR_INVALID_ARGUMENT; } + + // Check to see if a change has ocurred + VerifyOrReturnError(this->mMinMeasuredValue != aMinMeasuredValue, CHIP_NO_ERROR); + this->mMinMeasuredValue = aMinMeasuredValue; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MinMeasuredValue::Id); + + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetMaxMeasuredValue(DataModel::Nullable aMaxMeasuredValue) { - if constexpr (NumericMeasurementEnabled) + if (!CheckConstraintsGreaterThanOrEqualTo(aMaxMeasuredValue, this->mMinMeasuredValue)) { - if (!CheckConstraintsGreaterThan(aMaxMeasuredValue, mMinMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - if (!CheckConstraintsGreaterThan(aMaxMeasuredValue, mMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - DataModel::Nullable oldValue = mMaxMeasuredValue; - mMaxMeasuredValue = aMaxMeasuredValue; - - if (oldValue != mMaxMeasuredValue) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::MaxMeasuredValue::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; + return CHIP_ERROR_INVALID_ARGUMENT; } - else + + if (!CheckConstraintsGreaterThanOrEqualTo(aMaxMeasuredValue, this->mMeasuredValue)) { - return CHIP_ERROR_INCORRECT_STATE; + return CHIP_ERROR_INVALID_ARGUMENT; } + + // Check to see if a change has ocurred + VerifyOrReturnError(this->mMaxMeasuredValue != aMaxMeasuredValue, CHIP_NO_ERROR); + this->mMaxMeasuredValue = aMaxMeasuredValue; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::MaxMeasuredValue::Id); + + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetUncertainty(float aUncertainty) { - if constexpr (NumericMeasurementEnabled) - { - float oldValue = mUncertainty; - mUncertainty = aUncertainty; + // Check to see if a change has ocurred + VerifyOrReturnError(this->mUncertainty != aUncertainty, CHIP_NO_ERROR); + this->mUncertainty = aUncertainty; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::Uncertainty::Id); - if (oldValue != mUncertainty) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::Uncertainty::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetPeakMeasuredValue(DataModel::Nullable aPeakMeasuredValue) { - if constexpr (PeakMeasurementEnabled) + if (!CheckConstraintMinMax(aPeakMeasuredValue, this->mMinMeasuredValue, this->mMaxMeasuredValue)) { - if (!CheckConstraintMinMax(aPeakMeasuredValue, mMinMeasuredValue, mMaxMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - DataModel::Nullable oldValue = mPeakMeasuredValue; - mPeakMeasuredValue = aPeakMeasuredValue; + return CHIP_ERROR_INVALID_ARGUMENT; + } - if (oldValue != mPeakMeasuredValue) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::PeakMeasuredValue::Id); - MatterReportingAttributeChangeCallback(path); - } + // Check to see if a change has ocurred + VerifyOrReturnError(this->mPeakMeasuredValue != aPeakMeasuredValue, CHIP_NO_ERROR); + this->mPeakMeasuredValue = aPeakMeasuredValue; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PeakMeasuredValue::Id); - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetPeakMeasuredValueWindow(uint32_t aPeakMeasuredValueWindow) { - if constexpr (PeakMeasurementEnabled) + if (aPeakMeasuredValueWindow > WINDOW_MAX) { - if (aPeakMeasuredValueWindow > WINDOW_MAX) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + return CHIP_ERROR_INVALID_ARGUMENT; + } - uint32_t oldValue = mPeakMeasuredValueWindow; - mPeakMeasuredValueWindow = aPeakMeasuredValueWindow; + // Check to see if a change has ocurred + VerifyOrReturnError(this->mPeakMeasuredValueWindow != aPeakMeasuredValueWindow, CHIP_NO_ERROR); + this->mPeakMeasuredValueWindow = aPeakMeasuredValueWindow; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::PeakMeasuredValueWindow::Id); - if (oldValue != mPeakMeasuredValueWindow) - { - ConcreteAttributePath path = - ConcreteAttributePath(mEndpointId, mClusterId, Attributes::PeakMeasuredValueWindow::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetAverageMeasuredValue(DataModel::Nullable aAverageMeasuredValue) { - if constexpr (AverageMeasurementEnabled) + if (!CheckConstraintMinMax(aAverageMeasuredValue, this->mMinMeasuredValue, this->mMaxMeasuredValue)) { - if (!CheckConstraintMinMax(aAverageMeasuredValue, mMinMeasuredValue, mMaxMeasuredValue)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - DataModel::Nullable oldValue = mAverageMeasuredValue; - mAverageMeasuredValue = aAverageMeasuredValue; + return CHIP_ERROR_INVALID_ARGUMENT; + } - if (oldValue != mAverageMeasuredValue) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AverageMeasuredValue::Id); - MatterReportingAttributeChangeCallback(path); - } + // Check to see if a change has ocurred + VerifyOrReturnError(this->mAverageMeasuredValue != aAverageMeasuredValue, CHIP_NO_ERROR); + this->mAverageMeasuredValue = aAverageMeasuredValue; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::AverageMeasuredValue::Id); - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetAverageMeasuredValueWindow(uint32_t aAverageMeasuredValueWindow) { - if constexpr (AverageMeasurementEnabled) + if (aAverageMeasuredValueWindow > WINDOW_MAX) { - if (aAverageMeasuredValueWindow > WINDOW_MAX) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + return CHIP_ERROR_INVALID_ARGUMENT; + } - uint32_t oldValue = mAverageMeasuredValueWindow; - mAverageMeasuredValueWindow = aAverageMeasuredValueWindow; + // Check to see if a change has ocurred + VerifyOrReturnError(this->mAverageMeasuredValueWindow != aAverageMeasuredValueWindow, CHIP_NO_ERROR); + this->mAverageMeasuredValueWindow = aAverageMeasuredValueWindow; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::AverageMeasuredValueWindow::Id); - if (oldValue != mAverageMeasuredValueWindow) - { - ConcreteAttributePath path = - ConcreteAttributePath(mEndpointId, mClusterId, Attributes::AverageMeasuredValueWindow::Id); - MatterReportingAttributeChangeCallback(path); - } - - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; + template > CHIP_ERROR SetLevelValue(LevelValueEnum aLevel) { - if constexpr (LevelIndicationEnabled) + if constexpr (!MediumLevelEnabled) { - if constexpr (!MediumLevelEnabled) + if (aLevel == LevelValueEnum::kMedium) { - if (aLevel == LevelValueEnum::kMedium) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + return CHIP_ERROR_INVALID_ARGUMENT; } + } - if constexpr (!CriticalLevelEnabled) + if constexpr (!CriticalLevelEnabled) + { + if (aLevel == LevelValueEnum::kCritical) { - if (aLevel == LevelValueEnum::kCritical) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } + return CHIP_ERROR_INVALID_ARGUMENT; } + } - LevelValueEnum oldValue = mLevel; - mLevel = aLevel; - - if (oldValue != mLevel) - { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::LevelValue::Id); - MatterReportingAttributeChangeCallback(path); - } + // Check to see if a change has ocurred + VerifyOrReturnError(this->mLevel != aLevel, CHIP_NO_ERROR); + this->mLevel = aLevel; + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::LevelValue::Id); - return CHIP_NO_ERROR; - } - else - { - return CHIP_ERROR_INCORRECT_STATE; - } + return CHIP_NO_ERROR; }; }; From e633905c7681d567c923374677c7ac70a0dca11d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 31 Aug 2023 09:20:31 -0400 Subject: [PATCH 03/96] Remove non-spec-compliant Binding server from door lock device. (#28972) Per spec, there is no Binding server here. --- src/app/zap-templates/zcl/data-model/chip/matter-devices.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 38b30a0fa68e2b..f72c3298856906 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -1449,9 +1449,6 @@ limitations under the License. CLIENT_LIST PARTS_LIST - - BINDING - From 3f7d03c9e97f82908c0cc6d6f56877c6b5d07891 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Thu, 31 Aug 2023 09:26:10 -0400 Subject: [PATCH 04/96] Fix requirements in the matter-device.xml for Ligthing device types (#28971) --- .../zcl/data-model/chip/matter-devices.xml | 128 +++--------------- 1 file changed, 19 insertions(+), 109 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index f72c3298856906..6b398976a387d3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -195,7 +195,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -218,10 +217,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -236,6 +231,8 @@ limitations under the License. RecallScene GetSceneMembership GetSceneMembershipResponse + CopyScene + CopySceneResponse ON_OFF @@ -254,6 +251,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -281,7 +280,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -307,10 +305,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -325,6 +319,8 @@ limitations under the License. RecallScene GetSceneMembership GetSceneMembershipResponse + CopyScene + CopySceneResponse ON_OFF @@ -343,6 +339,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -370,7 +368,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -393,10 +390,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -411,6 +404,8 @@ limitations under the License. RecallScene GetSceneMembership GetSceneMembershipResponse + CopyScene + CopySceneResponse ON_OFF @@ -429,6 +424,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -444,47 +441,14 @@ limitations under the License. COLOR_CONTROL_COLOR_TEMPERATURE COLOR_CONTROL_COLOR_MODE COLOR_CONTROL_OPTIONS + COLOR_CONTROL_ENHANCED_COLOR_MODE COLOR_CONTROL_NUMBER_OF_PRIMARIES - COLOR_CONTROL_PRIMARY_1_X - COLOR_CONTROL_PRIMARY_1_Y - COLOR_CONTROL_PRIMARY_1_INTENSITY - COLOR_CONTROL_PRIMARY_2_X - COLOR_CONTROL_PRIMARY_2_Y - COLOR_CONTROL_PRIMARY_2_INTENSITY - COLOR_CONTROL_PRIMARY_3_X - COLOR_CONTROL_PRIMARY_3_Y - COLOR_CONTROL_PRIMARY_3_INTENSITY - COLOR_CONTROL_PRIMARY_4_X - COLOR_CONTROL_PRIMARY_4_Y - COLOR_CONTROL_PRIMARY_4_INTENSITY - COLOR_CONTROL_PRIMARY_5_X - COLOR_CONTROL_PRIMARY_5_Y - COLOR_CONTROL_PRIMARY_5_INTENSITY - COLOR_CONTROL_PRIMARY_6_X - COLOR_CONTROL_PRIMARY_6_Y - COLOR_CONTROL_PRIMARY_6_INTENSITY - COLOR_CONTROL_ENHANCED_CURRENT_HUE COLOR_CONTROL_COLOR_CAPABILITIES COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX COLOR_CONTROL_TEMPERATURE_LEVEL_MIN_MIREDS START_UP_COLOR_TEMPERATURE_MIREDS - MoveToHue - MoveHue - StepHue - MoveToSaturation - MoveSaturation - StepSaturation - MoveToHueAndSaturation - MoveToColor - MoveColor - StepColor MoveToColorTemperature - EnhancedMoveToHue - EnhancedMoveHue - EnhancedStepHue - EnhancedMoveToHueAndSaturation - ColorLoopSet StopMoveStep MoveColorTemperature StepColorTemperature @@ -505,7 +469,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -528,10 +491,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -564,6 +523,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -575,8 +536,6 @@ limitations under the License. StopWithOnOff - COLOR_CONTROL_CURRENT_HUE - COLOR_CONTROL_CURRENT_SATURATION COLOR_CONTROL_REMAINING_TIME COLOR_CONTROL_CURRENT_X COLOR_CONTROL_CURRENT_Y @@ -584,52 +543,16 @@ limitations under the License. COLOR_CONTROL_COLOR_MODE COLOR_CONTROL_OPTIONS COLOR_CONTROL_NUMBER_OF_PRIMARIES - COLOR_CONTROL_PRIMARY_1_X - COLOR_CONTROL_PRIMARY_1_Y - COLOR_CONTROL_PRIMARY_1_INTENSITY - COLOR_CONTROL_PRIMARY_2_X - COLOR_CONTROL_PRIMARY_2_Y - COLOR_CONTROL_PRIMARY_2_INTENSITY - COLOR_CONTROL_PRIMARY_3_X - COLOR_CONTROL_PRIMARY_3_Y - COLOR_CONTROL_PRIMARY_3_INTENSITY - COLOR_CONTROL_PRIMARY_4_X - COLOR_CONTROL_PRIMARY_4_Y - COLOR_CONTROL_PRIMARY_4_INTENSITY - COLOR_CONTROL_PRIMARY_5_X - COLOR_CONTROL_PRIMARY_5_Y - COLOR_CONTROL_PRIMARY_5_INTENSITY - COLOR_CONTROL_PRIMARY_6_X - COLOR_CONTROL_PRIMARY_6_Y - COLOR_CONTROL_PRIMARY_6_INTENSITY - COLOR_CONTROL_ENHANCED_CURRENT_HUE COLOR_CONTROL_ENHANCED_COLOR_MODE - COLOR_CONTROL_COLOR_LOOP_ACTIVE - COLOR_CONTROL_COLOR_LOOP_DIRECTION - COLOR_CONTROL_COLOR_LOOP_TIME - COLOR_CONTROL_COLOR_LOOP_START_ENHANCED_HUE - COLOR_CONTROL_COLOR_LOOP_STORED_ENHANCED_HUE COLOR_CONTROL_COLOR_CAPABILITIES COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MIN COLOR_CONTROL_COLOR_TEMP_PHYSICAL_MAX COLOR_CONTROL_TEMPERATURE_LEVEL_MIN_MIREDS START_UP_COLOR_TEMPERATURE_MIREDS - MoveToHue - MoveHue - StepHue - MoveToSaturation - MoveSaturation - StepSaturation - MoveToHueAndSaturation MoveToColor MoveColor StepColor MoveToColorTemperature - EnhancedMoveToHue - EnhancedMoveHue - EnhancedStepHue - EnhancedMoveToHueAndSaturation - ColorLoopSet StopMoveStep MoveColorTemperature StepColorTemperature @@ -649,7 +572,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -672,10 +594,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -708,6 +626,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -733,7 +653,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -756,10 +675,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse @@ -792,6 +707,8 @@ limitations under the License. CURRENT_LEVEL OPTIONS LEVEL_CONTROL_REMAINING_TIME + MINIMUM_LEVEL + ON_LEVEL START_UP_CURRENT_LEVEL MoveToLevel Move @@ -897,7 +814,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -959,7 +875,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -1022,7 +937,6 @@ limitations under the License. IDENTIFY_TIME IDENTIFY_TYPE Identify - IdentifyQuery TriggerEffect @@ -1048,10 +962,6 @@ limitations under the License. AddGroupIfIdentifying - SCENE_COUNT - CURRENT_SCENE - CURRENT_GROUP - SCENE_VALID SCENE_NAME_SUPPORT AddScene AddSceneResponse From b3c0ac1c23dea519aa0699c16781cad59f212801 Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Thu, 31 Aug 2023 23:21:06 +0800 Subject: [PATCH 05/96] [Feature]add refrigerator example (#28390) * Add refrigerator example build script * Add refrigerator app * Restyled by whitespace * Restyled by gn * Restyled by prettier-markdown * fix document missing * Restyled by prettier-markdown * fix document build error * update zap and matter with #28299 * optimize code and add composition type for endpoint * Restyled by clang-format * Optimize endpoint 1: 1. remove Refrigerator And Temperature Controlled Cabinet Mode cluster 2. remove Refrigerator alarm cluster 3. remove Binding and Group cluster in endpoint 1 * Restyled by clang-format * fix build error * fix bug: test fail in TC-SM-1.1/TC-DT-1.1 * remove identify and groups cluster in root node * add tag list feauture in endpoint 2 and endpoint 3 * Restyled by clang-format --------- Co-authored-by: Restyled.io --- docs/examples/index.md | 9 + examples/refrigerator-app/asr/.gn | 29 + examples/refrigerator-app/asr/BUILD.gn | 129 + examples/refrigerator-app/asr/args.gni | 27 + examples/refrigerator-app/asr/build_overrides | 1 + examples/refrigerator-app/asr/cfg.gni | 23 + .../refrigerator-app/asr/include/AppConfig.h | 45 + .../refrigerator-app/asr/include/AppTask.h | 43 + .../asr/include/CHIPProjectConfig.h | 111 + .../asr/include/DeviceCallbacks.h | 40 + examples/refrigerator-app/asr/src/AppTask.cpp | 139 + .../asr/src/DeviceCallbacks.cpp | 122 + examples/refrigerator-app/asr/src/main.cpp | 92 + .../asr/third_party/connectedhomeip | 1 + examples/refrigerator-app/linux/.gn | 25 + examples/refrigerator-app/linux/BUILD.gn | 51 + examples/refrigerator-app/linux/README.md | 145 + examples/refrigerator-app/linux/args.gni | 26 + .../refrigerator-app/linux/build_overrides | 1 + .../linux/include/CHIPProjectAppConfig.h | 34 + examples/refrigerator-app/linux/main.cpp | 73 + .../linux/third_party/connectedhomeip | 1 + .../refrigerator-common/BUILD.gn | 28 + .../static-supported-temperature-levels.h | 64 + .../refrigerator-app.matter | 1210 ++ .../refrigerator-common/refrigerator-app.zap | 12752 ++++++++++++++++ .../static-supported-temperature-levels.cpp | 73 + scripts/build/build/targets.py | 2 + scripts/build/builders/asr.py | 5 + scripts/build/builders/host.py | 6 + .../build/testdata/all_targets_linux_x64.txt | 4 +- 31 files changed, 15309 insertions(+), 2 deletions(-) create mode 100755 examples/refrigerator-app/asr/.gn create mode 100755 examples/refrigerator-app/asr/BUILD.gn create mode 100755 examples/refrigerator-app/asr/args.gni create mode 120000 examples/refrigerator-app/asr/build_overrides create mode 100755 examples/refrigerator-app/asr/cfg.gni create mode 100644 examples/refrigerator-app/asr/include/AppConfig.h create mode 100644 examples/refrigerator-app/asr/include/AppTask.h create mode 100755 examples/refrigerator-app/asr/include/CHIPProjectConfig.h create mode 100644 examples/refrigerator-app/asr/include/DeviceCallbacks.h create mode 100644 examples/refrigerator-app/asr/src/AppTask.cpp create mode 100644 examples/refrigerator-app/asr/src/DeviceCallbacks.cpp create mode 100644 examples/refrigerator-app/asr/src/main.cpp create mode 120000 examples/refrigerator-app/asr/third_party/connectedhomeip create mode 100644 examples/refrigerator-app/linux/.gn create mode 100644 examples/refrigerator-app/linux/BUILD.gn create mode 100644 examples/refrigerator-app/linux/README.md create mode 100644 examples/refrigerator-app/linux/args.gni create mode 120000 examples/refrigerator-app/linux/build_overrides create mode 100644 examples/refrigerator-app/linux/include/CHIPProjectAppConfig.h create mode 100644 examples/refrigerator-app/linux/main.cpp create mode 120000 examples/refrigerator-app/linux/third_party/connectedhomeip create mode 100644 examples/refrigerator-app/refrigerator-common/BUILD.gn create mode 100644 examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h create mode 100644 examples/refrigerator-app/refrigerator-common/refrigerator-app.matter create mode 100644 examples/refrigerator-app/refrigerator-common/refrigerator-app.zap create mode 100644 examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp diff --git a/docs/examples/index.md b/docs/examples/index.md index 3f16f71f69d024..9c74b1f5360e6a 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -201,6 +201,15 @@ pump-controller-app/**/README pump-controller-app/cc13x2x7_26x2x7/doc/programming* ``` +## Refrigerator example + +```{toctree} +:glob: +:maxdepth: 1 + +refrigerator-app/**/README +``` + ## Shell example ```{toctree} diff --git a/examples/refrigerator-app/asr/.gn b/examples/refrigerator-app/asr/.gn new file mode 100755 index 00000000000000..8d75f1eafcdb89 --- /dev/null +++ b/examples/refrigerator-app/asr/.gn @@ -0,0 +1,29 @@ +# Copyright (c) 2023 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") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/refrigerator-app/asr/BUILD.gn b/examples/refrigerator-app/asr/BUILD.gn new file mode 100755 index 00000000000000..5ec5ae20d35c48 --- /dev/null +++ b/examples/refrigerator-app/asr/BUILD.gn @@ -0,0 +1,129 @@ +# Copyright (c) 2023 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/asr.gni") +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("${asr_sdk_build_root}/asr_sdk.gni") +import("${build_root}/config/defaults.gni") +import("${chip_root}/src/lib/lib.gni") +import("${chip_root}/src/platform/device.gni") +import("${chip_root}/third_party/asr/asr_executable.gni") + +import("cfg.gni") + +assert(current_os == "freertos") + +asr_project_dir = "${chip_root}/examples/refrigerator-app/asr" +examples_plat_dir = "${chip_root}/examples/platform/asr" + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false +} + +asr_sdk_sources("refrigerator_app_sdk_sources") { + include_dirs = [ + "${chip_root}/src/platform/ASR", + "${asr_project_dir}/include", + "${examples_plat_dir}", + ] + + defines = [ + "ASR_LOG_ENABLED=1", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", + ] + + if (chip_enable_factory_data) { + defines += [ + "CONFIG_ENABLE_ASR_FACTORY_DATA_PROVIDER=1", + "CONFIG_ENABLE_ASR_FACTORY_DEVICE_INFO_PROVIDER=1", + ] + } + + if (chip_lwip_ip6_hook) { + defines += [ + "CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT", + "CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT", + ] + } + + sources = [ "${asr_project_dir}/include/CHIPProjectConfig.h" ] + + public_configs = [ "${asr_sdk_build_root}:asr_sdk_config" ] +} + +asr_executable("refrigerator_app") { + include_dirs = [] + defines = [] + output_name = "chip-asr-refrigerator-example.out" + + sources = [ + "${chip_root}/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp", + "${examples_plat_dir}/CHIPDeviceManager.cpp", + "${examples_plat_dir}/init_Matter.cpp", + "${examples_plat_dir}/init_asrPlatform.cpp", + "${examples_plat_dir}/shell/matter_shell.cpp", + "src/AppTask.cpp", + "src/DeviceCallbacks.cpp", + "src/main.cpp", + ] + + if (chip_enable_ota_requestor) { + sources += [ "${examples_plat_dir}/init_OTARequestor.cpp" ] + } + + deps = [ + ":refrigerator_app_sdk_sources", + "${chip_root}/examples/common/QRCode", + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/examples/refrigerator-app/refrigerator-common", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] + + include_dirs += [ + "include", + "${examples_plat_dir}", + "${asr_project_dir}/include", + "${chip_root}/src/lib", + "${chip_root}/examples/refrigerator-app/refrigerator-common/include", + ] + + defines = [ "ASR_NETWORK_LAYER_BLE=${chip_config_network_layer_ble}" ] + + if (chip_build_libshell) { + defines += [ "CONFIG_ENABLE_CHIP_SHELL=1" ] + sources += [ "${examples_plat_dir}/shell/launch_shell.cpp" ] + include_dirs += [ "${examples_plat_dir}/shell" ] + } + + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + output_dir = root_out_dir +} + +group("asr") { + deps = [ ":refrigerator_app" ] +} + +group("default") { + deps = [ ":asr" ] +} diff --git a/examples/refrigerator-app/asr/args.gni b/examples/refrigerator-app/asr/args.gni new file mode 100755 index 00000000000000..1acb6544ebeb99 --- /dev/null +++ b/examples/refrigerator-app/asr/args.gni @@ -0,0 +1,27 @@ +# Copyright (c) 2023 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/chip.gni") +import("//build_overrides/pigweed.gni") +import("//cfg.gni") +import("${chip_root}/src/platform/ASR/args.gni") + +asr_target_project = + get_label_info(":refrigerator_app_sdk_sources", "label_no_toolchain") + +declare_args() { + # Disable lock tracking, since our FreeRTOS configuration does not set + # INCLUDE_xSemaphoreGetMutexHolder + chip_stack_lock_tracking = "none" +} diff --git a/examples/refrigerator-app/asr/build_overrides b/examples/refrigerator-app/asr/build_overrides new file mode 120000 index 00000000000000..194ee0b812dc3d --- /dev/null +++ b/examples/refrigerator-app/asr/build_overrides @@ -0,0 +1 @@ +../../build_overrides/ \ No newline at end of file diff --git a/examples/refrigerator-app/asr/cfg.gni b/examples/refrigerator-app/asr/cfg.gni new file mode 100755 index 00000000000000..15fe50e79efb6d --- /dev/null +++ b/examples/refrigerator-app/asr/cfg.gni @@ -0,0 +1,23 @@ +# Copyright (c) 2023 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. + +declare_args() { + chip_enable_factory_data = false + + chip_lwip_ip6_hook = false + + setupPinCode = 20202021 + + setupDiscriminator = 3840 +} diff --git a/examples/refrigerator-app/asr/include/AppConfig.h b/examples/refrigerator-app/asr/include/AppConfig.h new file mode 100644 index 00000000000000..edfe488326c3e1 --- /dev/null +++ b/examples/refrigerator-app/asr/include/AppConfig.h @@ -0,0 +1,45 @@ +/* + * + * Copyright (c) 2023 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 + +// ---- Refrigerator Example App Config ---- + +#if (CFG_EASY_LOG_ENABLE == 1) +#include "elog.h" +#endif + +#define APP_TASK_NAME "APP" + +#define APP_TASK_STACK_SIZE (1024 * 4) + +#define MATTER_DEVICE_NAME "Refrigerator" + +#ifdef __cplusplus +extern "C" { +#endif + +void appError(int err); +void ASR_LOG(const char * aFormat, ...); + +#ifdef __cplusplus +} + +#include +void appError(CHIP_ERROR error); +#endif diff --git a/examples/refrigerator-app/asr/include/AppTask.h b/examples/refrigerator-app/asr/include/AppTask.h new file mode 100644 index 00000000000000..138c1b7260c63f --- /dev/null +++ b/examples/refrigerator-app/asr/include/AppTask.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2023 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 + +#include +#include + +class AppTask +{ + +public: + CHIP_ERROR StartAppTask(); + static void AppTaskMain(void * pvParameter); + +private: + friend AppTask & GetAppTask(void); + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/refrigerator-app/asr/include/CHIPProjectConfig.h b/examples/refrigerator-app/asr/include/CHIPProjectConfig.h new file mode 100755 index 00000000000000..79294d2a7ffbed --- /dev/null +++ b/examples/refrigerator-app/asr/include/CHIPProjectConfig.h @@ -0,0 +1,111 @@ +/* + * + * Copyright (c) 2023 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +/** + * CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY + * + * Enables the use of a hard-coded default Chip device id and credentials if no device id + * is found in Chip NV storage. + * + * This option is for testing only and should be disabled in production releases. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_TEST_DEVICE_IDENTITY 34 + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +// define Device type based on the application +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 112 // 0x0070 Refrigerator + +// For convenience, Chip Security Test Mode can be enabled and the +// requirement for authentication in various protocols can be disabled. +// +// WARNING: These options make it possible to circumvent basic Chip security functionality, +// including message encryption. Because of this they MUST NEVER BE ENABLED IN PRODUCTION BUILDS. +// +#define CHIP_CONFIG_SECURITY_TEST_MODE 0 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.0" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION + * + * A uint32_t identifying the software version running on the device. + */ +/* The SoftwareVersion attribute of the Basic cluster. */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION 1 +#endif + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE + * + * A size, in bytes, of the individual debug event logging buffer. + */ +#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512) diff --git a/examples/refrigerator-app/asr/include/DeviceCallbacks.h b/examples/refrigerator-app/asr/include/DeviceCallbacks.h new file mode 100644 index 00000000000000..dcd71806f6f2d3 --- /dev/null +++ b/examples/refrigerator-app/asr/include/DeviceCallbacks.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2023 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. + */ + +/** + * @file DeviceCallbacks.h + * + * Implementations for the DeviceManager callbacks for this application + * + **/ + +#pragma once + +#include "CHIPDeviceManager.h" +#include +#include +#include + +class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks +{ +public: + virtual void DeviceEventCallback(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) override; + +private: + void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); +}; diff --git a/examples/refrigerator-app/asr/src/AppTask.cpp b/examples/refrigerator-app/asr/src/AppTask.cpp new file mode 100644 index 00000000000000..fb54a1f1c59503 --- /dev/null +++ b/examples/refrigerator-app/asr/src/AppTask.cpp @@ -0,0 +1,139 @@ +/* + * + * Copyright (c) 2023 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 "AppTask.h" +#include "AppConfig.h" +#include "CHIPDeviceManager.h" +#include "DeviceCallbacks.h" +#include "qrcodegen.h" +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "init_Matter.h" +#if CONFIG_ENABLE_CHIP_SHELL +#include "matter_shell.h" +#endif +#include +#include + +namespace { +lega_thread_t sAppTaskHandle; +} // namespace + +using namespace chip; +using namespace ::chip; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceManager; +using namespace ::chip::DeviceLayer; +using namespace ::chip::System; + +AppTask AppTask::sAppTask; + +namespace { +constexpr EndpointId kNetworkCommissioningEndpointMain = 0; +constexpr EndpointId kNetworkCommissioningEndpointSecondary = 0xFFFE; + +app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(kNetworkCommissioningEndpointMain /* Endpoint Id */, + &(NetworkCommissioning::ASRWiFiDriver::GetInstance())); + +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceRefrigerator = 0x41; +// Refrigerator Namespace: 0x41, tag 0x00 (Refrigerator) +constexpr const uint8_t kTagRefrigerator = 0x00; +// Refrigerator Namespace: 0x41, tag 0x01 (Freezer) +constexpr const uint8_t kTagFreezer = 0x01; +const app::Clusters::Descriptor::Structs::SemanticTagStruct::Type refrigeratorTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagRefrigerator } }; +const app::Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagFreezer } }; +} // namespace + +void NetWorkCommissioningInstInit() +{ + sWiFiNetworkCommissioningInstance.Init(); + + // We only have network commissioning on endpoint 0. + emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); +} + +static DeviceCallbacks EchoCallbacks; + +CHIP_ERROR AppTask::StartAppTask() +{ + // Start App task. + OSStatus result = lega_rtos_create_thread(&sAppTaskHandle, 2, APP_TASK_NAME, (lega_thread_function_t) AppTaskMain, + APP_TASK_STACK_SIZE, (lega_thread_arg_t) this); + return (result == kNoErr) ? CHIP_NO_ERROR : CHIP_APPLICATION_ERROR(0x02); +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + ASR_LOG("App Task started"); + + if (MatterInitializer::Init_Matter_Stack(MATTER_DEVICE_NAME) != CHIP_NO_ERROR) + appError(CHIP_ERROR_INTERNAL); + + CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + + if (deviceMgr.Init(&EchoCallbacks) != CHIP_NO_ERROR) + appError(CHIP_ERROR_INTERNAL); + + if (MatterInitializer::Init_Matter_Server() != CHIP_NO_ERROR) + appError(CHIP_ERROR_INTERNAL); + + NetWorkCommissioningInstInit(); + + ASR_LOG("Current Firmware Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + + ConfigurationMgr().LogDeviceConfig(); + + // Print setup info +#if CONFIG_NETWORK_LAYER_BLE + PrintOnboardingCodes(RendezvousInformationFlag(RendezvousInformationFlag::kBLE)); +#else + PrintOnboardingCodes(RendezvousInformationFlag(RendezvousInformationFlag::kOnNetwork)); +#endif /* CONFIG_NETWORK_LAYER_BLE */ + + // set Parent Endpoint and Composition Type for an Endpoint + EndpointId kRefEndpointId = 1; + EndpointId kColdCabinetEndpointId = 2; + EndpointId kFreezeCabinetEndpointId = 3; + app::SetTreeCompositionForEndpoint(kRefEndpointId); + app::SetParentEndpointForEndpoint(kColdCabinetEndpointId, kRefEndpointId); + app::SetParentEndpointForEndpoint(kFreezeCabinetEndpointId, kRefEndpointId); + + // set TagList + SetTagList(kColdCabinetEndpointId, + Span(refrigeratorTagList)); + SetTagList(kFreezeCabinetEndpointId, Span(freezerTagList)); + + app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); + + /* Delete task */ + lega_rtos_delete_thread(NULL); +} diff --git a/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp b/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp new file mode 100644 index 00000000000000..23e6de9a118b03 --- /dev/null +++ b/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp @@ -0,0 +1,122 @@ +/* + * + * Copyright (c) 2020 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. + */ + +/** + * @file DeviceCallbacks.cpp + * + * Implements all the callbacks to the application from the CHIP Stack + * + **/ +#include "DeviceCallbacks.h" +#include "AppConfig.h" +#include "CHIPDeviceManager.h" +#include "init_OTARequestor.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if defined CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT || defined CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT +#include "route_hook/asr_route_hook.h" +#endif + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::System; +using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceManager; +using namespace ::chip::Logging; + +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR +constexpr uint32_t kInitOTARequestorDelaySec = 3; + +void InitOTARequestorHandler(System::Layer * systemLayer, void * appState) +{ + OTAInitializer::Instance().InitOTARequestor(); +} +#endif +void DeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, intptr_t arg) +{ + switch (event->Type) + { + case DeviceEventType::kInternetConnectivityChange: + OnInternetConnectivityChange(event); + break; + + case DeviceEventType::kInterfaceIpAddressChanged: + if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || + (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) + { + // MDNS server restart on any ip assignment: if link local ipv6 is configured, that + // will not trigger a 'internet connectivity change' as there is no internet + // connectivity. MDNS still wants to refresh its listening interfaces to include the + // newly selected address. + app::DnssdServer::Instance().StartServer(); + + if (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned) + { +#if defined CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT || defined CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT + ChipLogProgress(NotSpecified, "Initializing route hook..."); + asr_route_hook_init(); +#endif + } + } + break; + } +} + +void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event) +{ +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + static bool isOTAInitialized = false; +#endif + if (event->InternetConnectivityChange.IPv4 == kConnectivity_Established) + { + ASR_LOG("IPv4 Server ready..."); + app::DnssdServer::Instance().StartServer(); + } + else if (event->InternetConnectivityChange.IPv4 == kConnectivity_Lost) + { + ASR_LOG("Lost IPv4 connectivity..."); + } + if (event->InternetConnectivityChange.IPv6 == kConnectivity_Established) + { + ASR_LOG("IPv6 Server ready..."); + app::DnssdServer::Instance().StartServer(); +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR + // Init OTA requestor only when we have gotten IPv6 address + if (!isOTAInitialized) + { + DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds32(kInitOTARequestorDelaySec), InitOTARequestorHandler, + nullptr); + isOTAInitialized = true; + } +#endif + } + else if (event->InternetConnectivityChange.IPv6 == kConnectivity_Lost) + { + ASR_LOG("Lost IPv6 connectivity..."); + } +} diff --git a/examples/refrigerator-app/asr/src/main.cpp b/examples/refrigerator-app/asr/src/main.cpp new file mode 100644 index 00000000000000..31c3543bd27b69 --- /dev/null +++ b/examples/refrigerator-app/asr/src/main.cpp @@ -0,0 +1,92 @@ +/* + * + * Copyright (c) 2023 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 + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "AppConfig.h" +#include "init_asrPlatform.h" +#include + +using namespace ::chip; +using namespace ::chip::Inet; +using namespace ::chip::DeviceLayer; + +volatile int apperror_cnt; +// ================================================================================ +// App Error +//================================================================================= +void appError(int err) +{ + ASR_LOG("!!!!!!!!!!!! App Critical Error: %d !!!!!!!!!!!", err); + lega_rtos_declare_critical(); + lega_rtos_enter_critical(); + while (1) + ; +} + +void appError(CHIP_ERROR error) +{ + appError(static_cast(error.AsInteger())); +} + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +extern "C" void vApplicationIdleHook(void) +{ + // FreeRTOS Idle callback +} + +// ================================================================================ +// Main Code +// ================================================================================ +int main(void) +{ + init_asrPlatform(); + + CHIP_ERROR ret = GetAppTask().StartAppTask(); + if (ret != CHIP_NO_ERROR) + { + ASR_LOG("GetAppTask().Init() failed"); + appError(ret); + } + /* Start the FreeRTOS scheduler */ + vTaskStartScheduler(); + + chip::Platform::MemoryShutdown(); + PlatformMgr().StopEventLoopTask(); + PlatformMgr().Shutdown(); + + // Should never get here. + ASR_LOG("vTaskStartScheduler() failed"); + appError(ret); +} diff --git a/examples/refrigerator-app/asr/third_party/connectedhomeip b/examples/refrigerator-app/asr/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/refrigerator-app/asr/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/refrigerator-app/linux/.gn b/examples/refrigerator-app/linux/.gn new file mode 100644 index 00000000000000..5d1ce757507582 --- /dev/null +++ b/examples/refrigerator-app/linux/.gn @@ -0,0 +1,25 @@ +# 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") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + import("//args.gni") +} diff --git a/examples/refrigerator-app/linux/BUILD.gn b/examples/refrigerator-app/linux/BUILD.gn new file mode 100644 index 00000000000000..1ec3a7f67c1a63 --- /dev/null +++ b/examples/refrigerator-app/linux/BUILD.gn @@ -0,0 +1,51 @@ +# 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_overrides/chip.gni") + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("chip-refrigerator-app") { + sources = [ + "${chip_root}/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp", + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/examples/refrigerator-app/refrigerator-common", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "include", + "${chip_root}/examples/refrigerator-app/refrigerator-common/include", + ] + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":chip-refrigerator-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/refrigerator-app/linux/README.md b/examples/refrigerator-app/linux/README.md new file mode 100644 index 00000000000000..fc51f2fc39d6d6 --- /dev/null +++ b/examples/refrigerator-app/linux/README.md @@ -0,0 +1,145 @@ +# CHIP Linux Refrigerator Example + +An example showing the use of CHIP on the Linux. The document will describe how +to build and run CHIP Linux Refrigerator Example on Raspberry Pi. This doc is +tested on **Ubuntu for Raspberry Pi Server 20.04 LTS (aarch64)** and **Ubuntu +for Raspberry Pi Desktop 20.10 (aarch64)** + +To cross-compile this example on x64 host and run on **NXP i.MX 8M Mini** +**EVK**, see the associated +[README document](../../../docs/guides/nxp_imx8m_linux_examples.md) for details. + +
+ +- [CHIP Linux Refrigerator Example](#chip-linux-refrigerator-example) + - [Building](#building) + - [Commandline Arguments](#commandline-arguments) + - [Running the Complete Example on Raspberry Pi 4](#running-the-complete-example-on-raspberry-pi-4) + - [Running RPC console](#running-rpc-console) + - [Device Tracing](#device-tracing) + +
+ +## Building + +- Install tool chain + + $ sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev ninja-build python3-venv python3-dev unzip + +- Build the example application: + + $ cd ~/connectedhomeip/examples/refrigerator-app/linux + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ gn gen out/debug + $ ninja -C out/debug + +- To delete generated executable, libraries and object files use: + + $ cd ~/connectedhomeip/examples/refrigerator-app/linux + $ rm -rf out/ + +- Build the example with pigweed RPC + + $ cd ~/connectedhomeip/examples/refrigerator-app/linux + $ git submodule update --init + $ source third_party/connectedhomeip/scripts/activate.sh + $ gn gen out/debug --args='import("//with_pw_rpc.gni")' + $ ninja -C out/debug + +## Commandline arguments + +- `--wifi` + + Enables WiFi management feature. Required for WiFi commissioning. + +- `--thread` + + Enables Thread management feature, requires ot-br-posix dbus daemon running. + Required for Thread commissioning. + +- `--ble-device ` + + Use specific bluetooth interface for BLE advertisement and connections. + + `interface id`: the number after `hci` when listing BLE interfaces by + `hciconfig` command, for example, `--ble-device 1` means using `hci1` + interface. Default: `0`. + +## Running the Complete Example on Raspberry Pi 4 + +> If you want to test Echo protocol, please enable Echo handler +> +> gn gen out/debug --args='chip_app_use_echo=true' +> ninja -C out/debug + +- Prerequisites + + 1. A Raspberry Pi 4 board + 2. A USB Bluetooth Dongle, Ubuntu desktop will send Bluetooth advertisement, + which will block CHIP from connecting via BLE. On Ubuntu server, you need + to install `pi-bluetooth` via APT. + 3. Ubuntu 20.04 or newer image for ARM64 platform. + +- Building + + Follow [Building](#building) section of this document. + +- Running + + - [Optional] Plug USB Bluetooth dongle + + - Plug USB Bluetooth dongle and find its bluetooth device number. The + number after `hci` is the bluetooth device number, `1` in this + example. + + $ hciconfig + hci1: Type: Primary Bus: USB + BD Address: 00:1A:7D:AA:BB:CC ACL MTU: 310:10 SCO MTU: 64:8 + UP RUNNING PSCAN ISCAN + RX bytes:20942 acl:1023 sco:0 events:1140 errors:0 + TX bytes:16559 acl:1011 sco:0 commands:121 errors:0 + + hci0: Type: Primary Bus: UART + BD Address: B8:27:EB:AA:BB:CC ACL MTU: 1021:8 SCO MTU: 64:1 + UP RUNNING PSCAN ISCAN + RX bytes:8609495 acl:14 sco:0 events:217484 errors:0 + TX bytes:92185 acl:20 sco:0 commands:5259 errors:0 + + - Run Linux Refrigerator Example App + + $ cd ~/connectedhomeip/examples/refrigerator-app/linux + $ sudo out/debug/chip-refrigerator-app --ble-device [bluetooth device number] + # In this example, the device we want to use is hci1 + $ sudo out/debug/chip-refrigerator-app --ble-device 1 + + - Test the device using ChipDeviceController on your laptop / + workstation etc. + +## Running RPC Console + +- As part of building the example with RPCs enabled the chip_rpc python + interactive console is installed into your venv. The python wheel files are + also created in the output folder: out/debug/chip_rpc_console_wheels. To + install the wheel files without rebuilding: + `pip3 install out/debug/chip_rpc_console_wheels/*.whl` + +- To use the chip-rpc console after it has been installed run: + `chip-console -s localhost:33000 -o //pw_log.out` + +- Then you can Get and Set the light using the RPCs: + `rpcs.chip.rpc.Lighting.Get()` + + `rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5))` + +## Device Tracing + +Device tracing is available to analyze the device performance. To turn on +tracing, build with RPC enabled. See [Building with RPC enabled](#building). + +Obtain tracing json file. + +``` + $ ./{PIGWEED_REPO}/pw_trace_tokenized/py/pw_trace_tokenized/get_trace.py -s localhost:33000 \ + -o {OUTPUT_FILE} -t {ELF_FILE} {PIGWEED_REPO}/pw_trace_tokenized/pw_trace_protos/trace_rpc.proto +``` diff --git a/examples/refrigerator-app/linux/args.gni b/examples/refrigerator-app/linux/args.gni new file mode 100644 index 00000000000000..e52eb7aac29ed6 --- /dev/null +++ b/examples/refrigerator-app/linux/args.gni @@ -0,0 +1,26 @@ +# 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. + +# CHIPProjectConfig.h + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" +chip_project_config_include_dirs = + [ "${chip_root}/examples/refrigerator-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/refrigerator-app/linux/build_overrides b/examples/refrigerator-app/linux/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/refrigerator-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/refrigerator-app/linux/include/CHIPProjectAppConfig.h b/examples/refrigerator-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..988ccb4c2340b5 --- /dev/null +++ b/examples/refrigerator-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2023 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 112 // 0x0070 = 112 = Matter Refrigerator +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Refrigerator" diff --git a/examples/refrigerator-app/linux/main.cpp b/examples/refrigerator-app/linux/main.cpp new file mode 100644 index 00000000000000..820dbfbaa5b079 --- /dev/null +++ b/examples/refrigerator-app/linux/main.cpp @@ -0,0 +1,73 @@ +/* + * + * Copyright (c) 2023 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 +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +namespace { +app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; + +// Please refer to https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/master/src/namespaces +constexpr const uint8_t kNamespaceRefrigerator = 0x41; +// Refrigerator Namespace: 0x41, tag 0x00 (Refrigerator) +constexpr const uint8_t kTagRefrigerator = 0x00; +// Refrigerator Namespace: 0x41, tag 0x01 (Freezer) +constexpr const uint8_t kTagFreezer = 0x01; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type refrigeratorTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagRefrigerator } }; +const Clusters::Descriptor::Structs::SemanticTagStruct::Type freezerTagList[] = { { .namespaceID = kNamespaceRefrigerator, + .tag = kTagFreezer } }; +} // namespace + +void ApplicationInit() +{ + // set Parent Endpoint and Composition Type for an Endpoint + EndpointId kRefEndpointId = 1; + EndpointId kColdCabinetEndpointId = 2; + EndpointId kFreezeCabinetEndpointId = 3; + SetTreeCompositionForEndpoint(kRefEndpointId); + SetParentEndpointForEndpoint(kColdCabinetEndpointId, kRefEndpointId); + SetParentEndpointForEndpoint(kFreezeCabinetEndpointId, kRefEndpointId); + // set TagList + SetTagList(kColdCabinetEndpointId, Span(refrigeratorTagList)); + SetTagList(kFreezeCabinetEndpointId, Span(freezerTagList)); + + app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); +} + +void ApplicationShutdown() {} + +int main(int argc, char * argv[]) +{ + if (ChipLinuxAppInit(argc, argv) != 0) + { + return -1; + } + + ChipLinuxAppMainLoop(); + return 0; +} diff --git a/examples/refrigerator-app/linux/third_party/connectedhomeip b/examples/refrigerator-app/linux/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/refrigerator-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/BUILD.gn b/examples/refrigerator-app/refrigerator-common/BUILD.gn new file mode 100644 index 00000000000000..c747755e86c598 --- /dev/null +++ b/examples/refrigerator-app/refrigerator-common/BUILD.gn @@ -0,0 +1,28 @@ +# 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/chip.gni") +import("${chip_root}/src/app/chip_data_model.gni") + +config("config") { + include_dirs = [ "include" ] +} + +chip_data_model("refrigerator-common") { + zap_file = "refrigerator-app.zap" + + zap_pregenerated_dir = + "${chip_root}/zzz_generated/refrigerator-app/zap-generated" + is_server = true +} diff --git a/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h b/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h new file mode 100644 index 00000000000000..1ef9f1db0c56ab --- /dev/null +++ b/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2023 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 +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace TemperatureControl { + +/** + * This implementation statically defines the options. + */ + +class AppSupportedTemperatureLevelsDelegate : public SupportedTemperatureLevelsIteratorDelegate +{ + struct EndpointPair + { + EndpointId mEndpointId; + CharSpan * mTemperatureLevels; + uint8_t mSize; + + EndpointPair(EndpointId aEndpointId, CharSpan * aTemperatureLevels, uint8_t aSize) : + mEndpointId(aEndpointId), mTemperatureLevels(aTemperatureLevels), mSize(aSize) + {} + + ~EndpointPair() {} + }; + + static CharSpan temperatureLevelOptions[3]; + +public: + static const EndpointPair supportedOptionsByEndpoints[EMBER_AF_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT]; + + uint8_t Size() override; + + CHIP_ERROR Next(MutableCharSpan & item) override; + + ~AppSupportedTemperatureLevelsDelegate() {} +}; + +} // namespace TemperatureControl +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter new file mode 100644 index 00000000000000..06ea2bbd2c184c --- /dev/null +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -0,0 +1,1210 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute SemanticTagStruct tagList[] = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute boolean reachable = 17; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +server cluster UnitLocalization = 45 { + enum TempUnitEnum : ENUM8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : BITMAP32 { + kTemperatureUnit = 0x1; + } + + attribute TempUnitEnum temperatureUnit = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Wi-Fi Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster WiFiNetworkDiagnostics = 54 { + enum AssociationFailureCauseEnum : ENUM8 { + kUnknown = 0; + kAssociationFailed = 1; + kAuthenticationFailed = 2; + kSsidNotFound = 3; + } + + enum ConnectionStatusEnum : ENUM8 { + kConnected = 0; + kNotConnected = 1; + } + + enum SecurityTypeEnum : ENUM8 { + kUnspecified = 0; + kNone = 1; + kWEP = 2; + kWPA = 3; + kWPA2 = 4; + kWPA3 = 5; + } + + enum WiFiVersionEnum : ENUM8 { + kA = 0; + kB = 1; + kG = 2; + kN = 3; + kAc = 4; + kAx = 5; + kAh = 6; + } + + bitmap Feature : BITMAP32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + info event Disconnection = 0 { + INT16U reasonCode = 0; + } + + info event AssociationFailure = 1 { + AssociationFailureCauseEnum associationFailure = 0; + INT16U status = 1; + } + + info event ConnectionStatus = 2 { + ConnectionStatusEnum connectionStatus = 0; + } + + readonly attribute nullable octet_string<6> bssid = 0; + readonly attribute nullable SecurityTypeEnum securityType = 1; + readonly attribute nullable WiFiVersionEnum wiFiVersion = 2; + readonly attribute nullable int16u channelNumber = 3; + readonly attribute nullable int8s rssi = 4; + readonly attribute nullable int32u beaconLostCount = 5; + readonly attribute nullable int32u beaconRxCount = 6; + readonly attribute nullable int32u packetMulticastRxCount = 7; + readonly attribute nullable int32u packetMulticastTxCount = 8; + readonly attribute nullable int32u packetUnicastRxCount = 9; + readonly attribute nullable int32u packetUnicastTxCount = 10; + readonly attribute nullable int64u currentMaxRate = 11; + readonly attribute nullable int64u overrunCount = 12; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +server cluster TemperatureControl = 86 { + bitmap Feature : BITMAP32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute int8u selectedTemperatureLevel = 4; + readonly attribute char_string supportedTemperatureLevels[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional INT8U targetTemperatureLevel = 1; + } + + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 2; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry default = 4; + callback attribute targetsPerAccessControlEntry default = 3; + callback attribute accessControlEntriesPerFabric default = 3; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + ram attribute reachable default = 1; + callback attribute uniqueID; + callback attribute capabilityMinima; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales default = 7; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + persist attribute temperatureUnit default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster WiFiNetworkDiagnostics { + emits event Disconnection; + emits event AssociationFailure; + emits event ConnectionStatus; + callback attribute bssid; + callback attribute securityType; + callback attribute wiFiVersion; + callback attribute channelNumber default = 0x0000; + callback attribute rssi default = 0x00; + callback attribute beaconLostCount default = 0x00000000; + callback attribute beaconRxCount default = 0x00000000; + callback attribute packetMulticastRxCount default = 0x00000000; + callback attribute packetMulticastTxCount default = 0x00000000; + callback attribute packetUnicastRxCount default = 0x00000000; + callback attribute packetUnicastTxCount default = 0x00000000; + callback attribute currentMaxRate default = 0x0000000000000000; + callback attribute overrunCount default = 0x0000000000000000; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_refrigerator = 112, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 2; + } +} +endpoint 2 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute tagList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster TemperatureControl { + ram attribute selectedTemperatureLevel; + callback attribute supportedTemperatureLevels; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + } +} +endpoint 3 { + device type ma_temperature_controlled_cabinet = 113, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute tagList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster TemperatureControl { + ram attribute selectedTemperatureLevel; + callback attribute supportedTemperatureLevels; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap new file mode 100644 index 00000000000000..feb4bcca1dda01 --- /dev/null +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -0,0 +1,12752 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 8, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 2 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "7", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 7, + "name": "MA-refrigerator", + "deviceTypeRef": { + "id": 48, + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator" + }, + "deviceTypes": [ + { + "id": 48, + "code": 112, + "profileId": 259, + "label": "MA-refrigerator", + "name": "MA-refrigerator" + } + ], + "deviceTypeRefs": [ + 48 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 112 + ], + "deviceTypeName": "MA-refrigerator", + "deviceTypeCode": 112, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OffWithEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + }, + { + "name": "OnWithRecallGlobalScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + }, + { + "name": "OnWithTimedOff", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "50", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "255", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Mode Select", + "code": 80, + "mfgCode": null, + "define": "MODE_SELECT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Mode Select", + "code": 80, + "mfgCode": null, + "define": "MODE_SELECT_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Description", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StandardNamespace", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "enum16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedModes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator And Temperature Controlled Cabinet Mode", + "code": 82, + "mfgCode": null, + "define": "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SelectedTemperatureLevel", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedTemperatureLevels", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Refrigerator Alarm", + "code": 87, + "mfgCode": null, + "define": "REFRIGERATOR_ALARM_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Mode", + "code": 89, + "mfgCode": null, + "define": "DISHWASHER_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Mode", + "code": 89, + "mfgCode": null, + "define": "DISHWASHER_MODE_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Alarm", + "code": 93, + "mfgCode": null, + "define": "DISHWASHER_ALARM_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Alarm", + "code": 93, + "mfgCode": null, + "define": "DISHWASHER_ALARM_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Latch", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmMap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "OperationalStateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Fan Control", + "code": 514, + "mfgCode": null, + "define": "FAN_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Step", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fan Control", + "code": 514, + "mfgCode": null, + "define": "FAN_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "FanMode", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "FanModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FanModeSequence", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "FanModeSequenceEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PercentSetting", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "Percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PercentCurrent", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "Percent", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedMax", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "100", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedSetting", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SpeedCurrent", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RockSupport", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "RockBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x03", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RockSetting", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "RockBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WindSupport", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "WindBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x03", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WindSetting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "WindBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AirflowDirection", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "AirflowDirectionEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x3F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHue", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveHue", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedStepHue", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHueAndSaturation", + "code": 67, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ColorLoopSet", + "code": 68, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentHue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentSaturation", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentX", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentY", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DriftCompensation", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CompensationText", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTemperatureMireds", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NumberOfPrimaries", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Primary1X", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Y", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2X", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Y", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3X", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Y", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4X", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Y", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5X", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Y", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6X", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Y", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointX", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointY", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRX", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRY", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRIntensity", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGX", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGY", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGIntensity", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBX", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBY", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBIntensity", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedCurrentHue", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EnhancedColorMode", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopActive", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopDirection", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopTime", + "code": 16388, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStartEnhancedHue", + "code": 16389, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2300", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStoredEnhancedHue", + "code": 16390, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorCapabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMinMireds", + "code": 16395, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMaxMireds", + "code": 16396, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CoupleColorTempToLevelMinMireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpColorTemperatureMireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 5, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 51, + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet" + }, + "deviceTypes": [ + { + "id": 51, + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet" + } + ], + "deviceTypeRefs": [ + 51 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SelectedTemperatureLevel", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedTemperatureLevels", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 6, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 51, + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet" + }, + "deviceTypes": [ + { + "id": 51, + "code": 113, + "profileId": 259, + "label": "MA-temperature-controlled-cabinet", + "name": "MA-temperature-controlled-cabinet" + } + ], + "deviceTypeRefs": [ + 51 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 113 + ], + "deviceTypeName": "MA-temperature-controlled-cabinet", + "deviceTypeCode": 113, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SelectedTemperatureLevel", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedTemperatureLevels", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "MA-refrigerator", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 2, + "profileId": 259, + "endpointId": 2, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 3, + "profileId": 259, + "endpointId": 3, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp b/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp new file mode 100644 index 00000000000000..ae7a7dfa72c9ea --- /dev/null +++ b/examples/refrigerator-app/refrigerator-common/src/static-supported-temperature-levels.cpp @@ -0,0 +1,73 @@ +/* + * + * Copyright (c) 2023 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 + +using namespace std; +using namespace chip; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::TemperatureControl; +using chip::Protocols::InteractionModel::Status; + +// TODO: Configure your options for each endpoint +CharSpan AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions[] = { CharSpan::fromCharString("Hot"), + CharSpan::fromCharString("Warm"), + CharSpan::fromCharString("Freezing") }; + +const AppSupportedTemperatureLevelsDelegate::EndpointPair AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints + [EMBER_AF_TEMPERATURE_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT] = { + EndpointPair(2, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)), // Options for Endpoint 2 + EndpointPair(3, AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions, + ArraySize(AppSupportedTemperatureLevelsDelegate::temperatureLevelOptions)), // Options for Endpoint 3 + }; + +uint8_t AppSupportedTemperatureLevelsDelegate::Size() +{ + for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) + { + if (endpointPair.mEndpointId == mEndpoint) + { + return endpointPair.mSize; + } + } + return 0; +} + +CHIP_ERROR AppSupportedTemperatureLevelsDelegate::Next(MutableCharSpan & item) +{ + for (auto & endpointPair : AppSupportedTemperatureLevelsDelegate::supportedOptionsByEndpoints) + { + if (endpointPair.mEndpointId == mEndpoint) + { + if (endpointPair.mSize > mIndex) + { + CHIP_ERROR err = CopyCharSpanToMutableCharSpan(endpointPair.mTemperatureLevels[mIndex], item); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Error copying char span to mutable char span %s", ErrorStr(err)); + return err; + } + mIndex++; + return CHIP_NO_ERROR; + } + } + } + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 1f25e6edaa976d..a87d26cd165cf8 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -130,6 +130,7 @@ def BuildHostTarget(): TargetPart('address-resolve-tool', app=HostApp.ADDRESS_RESOLVE), TargetPart('contact-sensor', app=HostApp.CONTACT_SENSOR), TargetPart('dishwasher', app=HostApp.DISHWASHER), + TargetPart('refrigerator', app=HostApp.REFRIGERATOR), ] if (HostBoard.NATIVE.PlatformName() == 'darwin'): @@ -434,6 +435,7 @@ def BuildASRTarget(): TargetPart('thermostat', app=ASRApp.THERMOSTAT), TargetPart('ota-requestor', app=ASRApp.OTA_REQUESTOR), TargetPart('dishwasher', app=ASRApp.DISHWASHER), + TargetPart('refrigerator', app=ASRApp.REFRIGERATOR), ]) # modifiers diff --git a/scripts/build/builders/asr.py b/scripts/build/builders/asr.py index 98062b3bbc7c8b..d7351a1daec289 100644 --- a/scripts/build/builders/asr.py +++ b/scripts/build/builders/asr.py @@ -29,6 +29,7 @@ class ASRApp(Enum): THERMOSTAT = auto() OTA_REQUESTOR = auto() DISHWASHER = auto() + REFRIGERATOR = auto() def ExampleName(self): if self == ASRApp.ALL_CLUSTERS: @@ -51,6 +52,8 @@ def ExampleName(self): return 'ota-requestor-app' elif self == ASRApp.DISHWASHER: return 'dishwasher-app' + elif self == ASRApp.REFRIGERATOR: + return 'refrigerator-app' else: raise Exception('Unknown app type: %r' % self) @@ -75,6 +78,8 @@ def AppNamePrefix(self): return 'chip-asr-ota-requestor-example' elif self == ASRApp.DISHWASHER: return 'chip-asr-dishwasher-example' + elif self == ASRApp.REFRIGERATOR: + return 'chip-asr-refrigerator-example' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 84d8a47a9cbcd8..4666e2d8e0b97a 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -69,6 +69,7 @@ class HostApp(Enum): JAVA_MATTER_CONTROLLER = auto() CONTACT_SENSOR = auto() DISHWASHER = auto() + REFRIGERATOR = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -115,6 +116,8 @@ def ExamplePath(self): return 'contact-sensor-app/linux' elif self == HostApp.DISHWASHER: return 'dishwasher-app/linux' + elif self == HostApp.REFRIGERATOR: + return 'refrigerator-app/linux' else: raise Exception('Unknown app type: %r' % self) @@ -197,6 +200,9 @@ def OutputNames(self): elif self == HostApp.DISHWASHER: yield 'dishwasher-app' yield 'dishwasher-app.map' + elif self == HostApp.REFRIGERATOR: + yield 'refrigerator-app' + yield 'refrigerator-app.map' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index d333ff86dc3e43..8311994a7c28b3 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,5 +1,5 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} -asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio] +asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher,refrigerator}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio] android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller,virtual-device-app}[-no-debug] bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706-eth,bl706-wifi,bl704l-dvk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id] cc32xx-lock @@ -10,7 +10,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,refrigerator}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] From 9db615b3192a0930899807655eaf45a47978019f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 31 Aug 2023 17:20:18 -0400 Subject: [PATCH 06/96] Modify Matter.framework to allow per-controller storage. (#28533) * Modify Matter.framework to allow per-controller storage. This also allows starting multiple controllers with different node IDs on a single fabric. Public API changes: * It's now possible to initialize MTRDeviceControllerFactoryParams without storage. When a factory is then started with those params, it will expect storage to be provided for every controller that is created. * Controllers to be created in the new setup use MTRDeviceControllerStartupParameters, not MTRDeviceControllerStartupParams. * When starting a controller, API clients provide a UUID for that controller (which is then exposed on the MTRDeviceController) and a storage delegate. * For now, the only supported controller startup mode is for the client to provide the full certificate chain, operational key and vendor ID, via MTRDeviceControllerExternalCertificateStartupParameters. For controllers that will commission devices, that means also providing an MTROperationalCertificateIssuer. * The new "create a controller" API is called createController. * The new MTRDeviceControllerStorageDelegate API provides some context for the key/value pairs in terms of whether they need to be stored in encrypted storage or not, and whether they can be shared across multiple devices and under what conditions. Implementation notes: * MTRDemuxingStorage handles directing storage requests to the right per-controller storage object. * MTRDeviceControllerDataStore wraps the raw storage delegate and provides a semantic API on top of its key/value storage for the storage operations we actually want to perform. * MTRSessionResumptionStorageBridge implements session resumption storage, acting as an adapter between the Matter session resumption storage API and MTRDeviceControllerDataStore. In particular, it happens locating the right controller(s) to talk to and so on. This avoids dealing with the default Matter implementation's use of non-fabric-index-scoped keys for storing session resumption information. Fixes https://github.com/project-chip/connectedhomeip/issues/27394 * Require consumers to provide a dispatch queue for the storage delegate. * Address review comments. * Apply spelling/grammar suggestions from code review Co-authored-by: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> * Address review comments. * Address more review comments. * Address more review comments. * Address more review comments. * Add some validation when deserializing node IDs and CATs. * Stop trusting the secure coding stuff to actually enforce types correctly. For built-in types it seems to not do that. * Remove NSMutableArray and NSSet from controller storage classes, since we no longer encode those. --------- Co-authored-by: Nivi Sarkar <55898241+nivi-apple@users.noreply.github.com> --- .../Framework/CHIP/MTRDemuxingStorage.h | 70 + .../Framework/CHIP/MTRDemuxingStorage.mm | 416 ++++++ .../Framework/CHIP/MTRDeviceController.h | 5 + .../Framework/CHIP/MTRDeviceController.mm | 29 +- .../CHIP/MTRDeviceControllerDataStore.h | 66 + .../CHIP/MTRDeviceControllerDataStore.mm | 359 ++++++ .../CHIP/MTRDeviceControllerFactory.h | 40 +- .../CHIP/MTRDeviceControllerFactory.mm | 356 +++++- .../MTRDeviceControllerFactory_Internal.h | 9 + .../MTRDeviceControllerStartupParameters.h | 89 ++ .../CHIP/MTRDeviceControllerStartupParams.mm | 254 +++- ...TRDeviceControllerStartupParams_Internal.h | 67 +- .../CHIP/MTRDeviceControllerStorageDelegate.h | 110 ++ .../CHIP/MTRDeviceController_Internal.h | 15 +- .../CHIP/MTRSessionResumptionStorageBridge.h | 59 + .../CHIP/MTRSessionResumptionStorageBridge.mm | 149 +++ src/darwin/Framework/CHIP/Matter.h | 2 + .../Framework/CHIPTests/MTRControllerTests.m | 7 - .../CHIPTests/MTRPerControllerStorageTests.m | 1124 +++++++++++++++++ .../Matter.xcodeproj/project.pbxproj | 36 + 20 files changed, 3195 insertions(+), 67 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRDemuxingStorage.h create mode 100644 src/darwin/Framework/CHIP/MTRDemuxingStorage.mm create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h create mode 100644 src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.h create mode 100644 src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.mm create mode 100644 src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m diff --git a/src/darwin/Framework/CHIP/MTRDemuxingStorage.h b/src/darwin/Framework/CHIP/MTRDemuxingStorage.h new file mode 100644 index 00000000000000..bfff6369800bc7 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDemuxingStorage.h @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2023 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 +#import + +#include +#include + +NS_ASSUME_NONNULL_BEGIN + +/** + * A PersistentStorageDelegate implementation that does the following: + * + * 1) Ensures that any "global" storage keys are stored in RAM as needed so that + * the Matter stack has access to them. + * 2) Hands off fabric-index-specific keys to the controller that corresponds to + * that fabric index, if any. + */ +class MTRDemuxingStorage : public chip::PersistentStorageDelegate { +public: + MTRDemuxingStorage(MTRDeviceControllerFactory * factory); + ~MTRDemuxingStorage() {} + + // PersistentStorageDelegate API. + CHIP_ERROR SyncGetKeyValue(const char * key, void * buffer, uint16_t & size) override; + + CHIP_ERROR SyncSetKeyValue(const char * key, const void * value, uint16_t size) override; + + CHIP_ERROR SyncDeleteKeyValue(const char * key) override; + +private: + /** + * Methods for reading/writing/deleting things. The index-specific ones + * will have the "f/index/" bit already stripped of from the front of the key. + */ + NSData * _Nullable GetGlobalValue(NSString * key); + NSData * _Nullable GetIndexSpecificValue(chip::FabricIndex index, NSString * key); + + CHIP_ERROR SetGlobalValue(NSString * key, NSData * data); + CHIP_ERROR SetIndexSpecificValue(chip::FabricIndex index, NSString * key, NSData * data); + + CHIP_ERROR DeleteGlobalValue(NSString * key); + CHIP_ERROR DeleteIndexSpecificValue(chip::FabricIndex index, NSString * key); + + /** + * Methods for modifying our in-memory store for fully qualified keys. + */ + NSData * _Nullable GetInMemoryValue(NSString * key); + CHIP_ERROR SetInMemoryValue(NSString * key, NSData * data); + CHIP_ERROR DeleteInMemoryValue(NSString * key); + + MTRDeviceControllerFactory * mFactory; + NSMutableDictionary * mInMemoryStore; +}; + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDemuxingStorage.mm b/src/darwin/Framework/CHIP/MTRDemuxingStorage.mm new file mode 100644 index 00000000000000..5d4162ef321c55 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDemuxingStorage.mm @@ -0,0 +1,416 @@ +/** + * Copyright (c) 2023 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 "MTRDemuxingStorage.h" + +#import "MTRDeviceControllerFactory_Internal.h" +#import "MTRDeviceController_Internal.h" +#import "MTRLogging_Internal.h" + +#include +#include +#include + +using namespace chip; + +static bool IsGlobalKey(NSString * key) { return [key hasPrefix:@"g/"]; } + +/** + * Checks for a key that is scoped to a specific fabric index. + */ +static bool IsIndexSpecificKey(NSString * key) { return [key hasPrefix:@"f/"]; } + +/** + * Extracts the fabric index from an index-specific key. Fails if the key + * is not index-specific or if a numeric FabricIndex could not be extracted + * from it. + */ +static CHIP_ERROR ExtractIndexFromKey(NSString * key, FabricIndex * index) +{ + if (!IsIndexSpecificKey(key)) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + auto * components = [key componentsSeparatedByString:@"/"]; + if (components.count < 3) { + // Unexpected "f/something" without any actual data. + return CHIP_ERROR_INVALID_ARGUMENT; + } + + auto * indexString = components[1]; + auto * scanner = [NSScanner scannerWithString:indexString]; + + auto * charset = [NSCharacterSet characterSetWithCharactersInString:@"0123456789abcdefABCDEF"]; + charset = [charset invertedSet]; + + if ([scanner scanCharactersFromSet:charset intoString:nil] == YES) { + // Leading non-hex chars. + return CHIP_ERROR_INVALID_ARGUMENT; + } + + unsigned int value; + if ([scanner scanHexInt:&value] == NO) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + if (scanner.atEnd == NO) { + // Trailing garbage chars. + return CHIP_ERROR_INVALID_ARGUMENT; + } + + if (!CanCastTo(value)) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + *index = static_cast(value); + return CHIP_NO_ERROR; +} + +/** + * Extracts the "index-specific" part of an index-specific key (i.e. the + * part after "f/index/"). + */ +static CHIP_ERROR ExtractIndexSpecificKey(NSString * key, NSString * __autoreleasing * extractedKey) +{ + if (!IsIndexSpecificKey(key)) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + auto * components = [key componentsSeparatedByString:@"/"]; + if (components.count < 3) { + // Unexpected "f/something" without any actual data. + return CHIP_ERROR_INVALID_ARGUMENT; + } + + components = [components subarrayWithRange:NSMakeRange(2, components.count - 2)]; + *extractedKey = [components componentsJoinedByString:@"/"]; + return CHIP_NO_ERROR; +} + +/** + * Method to test whether a global key should be stored in memory only, as + * opposed to being passed on to the actual storage related to controllers. + */ +static bool IsMemoryOnlyGlobalKey(NSString * key) +{ + if ([key isEqualToString:@"g/fidx"]) { + // Fabric index list only needs to be stored in-memory, not persisted, + // because we do not tie controllers to specific fabric indices. + return true; + } + + if ([key isEqualToString:@"g/fs/c"] || [key isEqualToString:@"g/fs/n"]) { + // Just store the fail-safe markers in memory as well. We could + // plausibly not store them at all, since we never actually need to + // clean up anything by fabric index, but this is safer in case + // consumers try to read back right after writing. + return true; + } + + if ([key isEqualToString:@"g/lkgt"]) { + // Store Last Known Good Time in memory only. We never need this in + // general, because we can always provide the wall-clock time. + return true; + } + + // We do not expect to see the "g/sri" or "g/s/*" keys for session + // resumption, because we implement SessionResumptionStorage ourselves. + + // For now, put group global counters in memory. + // TODO: we should inject a group counter manager that makes these counters + // per-controller, not globally handled via storage. + // See https://github.com/project-chip/connectedhomeip/issues/28510 + if ([key isEqualToString:@"g/gdc"] || [key isEqualToString:@"g/gcc"]) { + return true; + } + + // We do not expect to see "g/userlbl/*" User Label keys. + + // We do not expect to see the "g/gfl" key for endpoint-to-group + // associations. + + // We do not expect to see the "g/a/*" keys for attribute values. + + // We do not expect to see the "g/bt" and "g/bt/*" keys for the binding + // table. + + // We do not expect to see the "g/o/*" OTA Requestor keys. + + // We do not expect to see the "g/im/ec" event number counter key. + + // We do not expect to see the "g/su/*" and "g/sum" keys for server-side + // subscription resumption storage. + + // We do not expect to see the "g/scc/*" scenes keys. + + // We do not expect to see the "g/ts/tts", "g/ts/dntp", "g/ts/tz", + // "g/ts/dsto" Time Synchronization keys. + + return false; +} + +/** + * Method to test whether an index-specific key should be stored in memory only, as + * opposed to being passed on to the actual storage related to controllers. + * The key string will have the "f/index/" bit already stripped off the + * front of the key. + */ +static bool IsMemoryOnlyIndexSpecificKey(NSString * key) +{ + // Store all the fabric table bits in memory only. This is done because the + // fabric table expects none of these things to be stored in the case of a + // "new fabric addition", which is what we always do when using + // per-controller storage. + // + // TODO: Figure out which, if any, of these things we should also store for + // later recall when starting a controller with storage we have used before. + // + // For future reference: + // + // n == NOC + // i == ICAC + // r == RCAC + // m == Fabric metadata (TLV containing the vendor ID) + // o == operational key, only written if internally generated. + if ([key isEqualToString:@"n"] || [key isEqualToString:@"i"] || [key isEqualToString:@"r"] || [key isEqualToString:@"m"] || + [key isEqualToString:@"o"]) { + return true; + } + + // We do not expect to see the "s/*" keys for session resumption, because we + // implement SessionResumptionStorage ourselves. + + // We do not expect to see the "ac/*" keys for ACL entries. + + // We do not expect to see the "g" or "g/*" keys for which endpoints are in which + // group. + + // For now, just store group keysets and group keys in memory. + // TODO: We want to start persisting these, per-controller, if we're going + // to support group keys. Or inject a GroupDataProvider of our own instead + // of using Credentials::GroupDataProviderImp and then + // not be tied to whatever storage format that uses. + // https://github.com/project-chip/connectedhomeip/issues/28511 + if ([key hasPrefix:@"gk/"] || [key hasPrefix:@"k/"]) { + return true; + } + + // We do not expect to see the "icd/*" keys for the ICD Management table. + + // We do not expect to see the "e/*" scenes keys. + + return false; +} + +/** + * Method to convert an index-specific key into a fully qualified key. + */ +static NSString * FullyQualifiedKey(FabricIndex index, NSString * key) +{ + return [NSString stringWithFormat:@"f/%x/%s", index, key.UTF8String]; +} + +MTRDemuxingStorage::MTRDemuxingStorage(MTRDeviceControllerFactory * factory) + : mFactory(factory) +{ + mInMemoryStore = [[NSMutableDictionary alloc] init]; +} + +CHIP_ERROR MTRDemuxingStorage::SyncGetKeyValue(const char * key, void * buffer, uint16_t & size) +{ + assertChipStackLockedByCurrentThread(); + if (buffer == nullptr && size != 0) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + NSString * keyString = [NSString stringWithUTF8String:key]; + +#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE + MTR_LOG_DEBUG("MTRDemuxingStorage Sync Get Value for Key: %@", keyString); +#endif + + NSData * value; + if (IsGlobalKey(keyString)) { + value = GetGlobalValue(keyString); + } else if (IsIndexSpecificKey(keyString)) { + FabricIndex index; + ReturnErrorOnFailure(ExtractIndexFromKey(keyString, &index)); + ReturnErrorOnFailure(ExtractIndexSpecificKey(keyString, &keyString)); + value = GetIndexSpecificValue(index, keyString); + } else { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + if (value == nil) { + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + } + + if (value.length > UINT16_MAX) { + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + uint16_t valueSize = static_cast(value.length); + if (valueSize > size) { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + size = valueSize; + + if (size != 0) { + // buffer is known to be non-null here. + memcpy(buffer, value.bytes, size); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR MTRDemuxingStorage::SyncSetKeyValue(const char * key, const void * value, uint16_t size) +{ + if (value == nullptr && size != 0) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + NSString * keyString = [NSString stringWithUTF8String:key]; + NSData * valueData = (value == nullptr) ? [NSData data] : [NSData dataWithBytes:value length:size]; + +#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE + MTR_LOG_DEBUG("MTRDemuxingStorage Set Key %@", keyString); +#endif + + if (IsGlobalKey(keyString)) { + return SetGlobalValue(keyString, valueData); + } + + if (IsIndexSpecificKey(keyString)) { + FabricIndex index; + ReturnErrorOnFailure(ExtractIndexFromKey(keyString, &index)); + ReturnErrorOnFailure(ExtractIndexSpecificKey(keyString, &keyString)); + return SetIndexSpecificValue(index, keyString, valueData); + } + + return CHIP_ERROR_INVALID_ARGUMENT; +} + +CHIP_ERROR MTRDemuxingStorage::SyncDeleteKeyValue(const char * key) +{ + NSString * keyString = [NSString stringWithUTF8String:key]; + +#if LOG_DEBUG_PERSISTENT_STORAGE_DELEGATE + MTR_LOG_DEBUG("MTRDemuxingStorage Delete Key: %@", keyString); +#endif + + if (IsGlobalKey(keyString)) { + return DeleteGlobalValue(keyString); + } + + if (IsIndexSpecificKey(keyString)) { + FabricIndex index; + ReturnErrorOnFailure(ExtractIndexFromKey(keyString, &index)); + ReturnErrorOnFailure(ExtractIndexSpecificKey(keyString, &keyString)); + return DeleteIndexSpecificValue(index, keyString); + } + + return CHIP_ERROR_INVALID_ARGUMENT; +} + +NSData * _Nullable MTRDemuxingStorage::GetGlobalValue(NSString * key) +{ + if (IsMemoryOnlyGlobalKey(key)) { + return GetInMemoryValue(key); + } + + MTR_LOG_ERROR("MTRDemuxingStorage reading unknown global key: %@", key); + + return nil; +} + +NSData * _Nullable MTRDemuxingStorage::GetIndexSpecificValue(FabricIndex index, NSString * key) +{ + if (IsMemoryOnlyIndexSpecificKey(key)) { + return GetInMemoryValue(FullyQualifiedKey(index, key)); + } + + return nil; +} + +CHIP_ERROR MTRDemuxingStorage::SetGlobalValue(NSString * key, NSData * data) +{ + if (IsMemoryOnlyGlobalKey(key)) { + // Fabric index list only needs to be stored in-memory, not persisted, + // because we do not tie controllers to specific fabric indices. + return SetInMemoryValue(key, data); + } + + MTR_LOG_ERROR("MTRDemuxingStorage setting unknown global key: %@", key); + + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; +} + +CHIP_ERROR MTRDemuxingStorage::SetIndexSpecificValue(FabricIndex index, NSString * key, NSData * data) +{ + if ([key isEqualToString:@"n"]) { + // Index-scoped "n" is NOC. + auto * controller = [mFactory runningControllerForFabricIndex:index]; + if (controller == nil) { + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + ReturnErrorOnFailure([controller.controllerDataStore storeLastLocallyUsedNOC:data]); + } + + if (IsMemoryOnlyIndexSpecificKey(key)) { + return SetInMemoryValue(FullyQualifiedKey(index, key), data); + } + + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; +} + +CHIP_ERROR MTRDemuxingStorage::DeleteGlobalValue(NSString * key) +{ + if (IsMemoryOnlyGlobalKey(key)) { + return DeleteInMemoryValue(key); + } + + MTR_LOG_ERROR("MTRDemuxingStorage deleting unknown global key: %@", key); + + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; +} + +CHIP_ERROR MTRDemuxingStorage::DeleteIndexSpecificValue(FabricIndex index, NSString * key) +{ + if (IsMemoryOnlyIndexSpecificKey(key)) { + return DeleteInMemoryValue(FullyQualifiedKey(index, key)); + } + + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; +} + +NSData * _Nullable MTRDemuxingStorage::GetInMemoryValue(NSString * key) { return mInMemoryStore[key]; } + +CHIP_ERROR MTRDemuxingStorage::SetInMemoryValue(NSString * key, NSData * data) +{ + mInMemoryStore[key] = data; + return CHIP_NO_ERROR; +} + +CHIP_ERROR MTRDemuxingStorage::DeleteInMemoryValue(NSString * key) +{ + BOOL present = (mInMemoryStore[key] != nil); + if (present) { + [mInMemoryStore removeObjectForKey:key]; + } + return present ? CHIP_NO_ERROR : CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; +} diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index fce1a88002aaf8..670e12bbd0caaf 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -47,6 +47,11 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS */ @property (readonly, nonatomic, getter=isRunning) BOOL running; +/** + * The ID assigned to this controller at creation time. + */ +@property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; + /** * Return the Node ID assigned to the controller. Will return nil if the * controller is not running (and hence does not know its node id). diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 4b2c32d9c2bf0d..403bc8a0906183 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -114,9 +114,30 @@ @interface MTRDeviceController () { @implementation MTRDeviceController -- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory queue:(dispatch_queue_t)queue +- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory + queue:(dispatch_queue_t)queue + storageDelegate:(id _Nullable)storageDelegate + storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier { if (self = [super init]) { + // Make sure our storage is all set up to work as early as possible, + // before we start doing anything else with the controller. + _uniqueIdentifier = uniqueIdentifier; + if (storageDelegate != nil) { + if (storageDelegateQueue == nil) { + MTR_LOG_ERROR("storageDelegate provided without storageDelegateQueue"); + return nil; + } + + _controllerDataStore = [[MTRDeviceControllerDataStore alloc] initWithController:self + storageDelegate:storageDelegate + storageDelegateQueue:storageDelegateQueue]; + if (_controllerDataStore == nil) { + return nil; + } + } + _chipWorkQueue = queue; _factory = factory; _deviceMapLock = OS_UNFAIR_LOCK_INIT; @@ -191,8 +212,11 @@ - (void)shutDownCppController // _cppCommissioner, so we're not in a state where we claim to be // running but are actually partially shut down. _cppCommissioner = nullptr; - _storedFabricIndex = chip::kUndefinedFabricIndex; commissionerToShutDown->Shutdown(); + // Don't clear out our fabric index association until controller + // shutdown completes, in case it wants to write to storage as it + // shuts down. + _storedFabricIndex = chip::kUndefinedFabricIndex; delete commissionerToShutDown; if (_operationalCredentialsDelegate != nil) { _operationalCredentialsDelegate->SetDeviceCommissioner(nullptr); @@ -365,6 +389,7 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams // bring-up. commissionerParams.removeFromFabricTableOnShutdown = false; commissionerParams.deviceAttestationVerifier = _factory.deviceAttestationVerifier; + commissionerParams.permitMultiControllerFabrics = startupParams.allowMultipleControllersPerFabric; auto & factory = chip::Controller::DeviceControllerFactory::GetInstance(); diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h new file mode 100644 index 00000000000000..8d10c7af3e810b --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h @@ -0,0 +1,66 @@ +/** + * Copyright (c) 2023 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 +#import +#import +#import + +#include + +NS_ASSUME_NONNULL_BEGIN + +/** + * Interface that represents a single CASE session resumption entry. + */ +MTR_HIDDEN +@interface MTRCASESessionResumptionInfo : NSObject +@property (nonatomic) NSNumber * nodeID; +@property (nonatomic) NSData * resumptionID; +@property (nonatomic) NSData * sharedSecret; +@property (nonatomic) NSSet * caseAuthenticatedTags; +@end + +/** + * Interface that wraps a type-safe API around + * MTRDeviceControllerStorageDelegate. + */ +MTR_HIDDEN +@interface MTRDeviceControllerDataStore : NSObject + +- (nullable instancetype)initWithController:(MTRDeviceController *)controller + storageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue; + +/** + * Resumption info APIs. + */ +- (nullable MTRCASESessionResumptionInfo *)findResumptionInfoByNodeID:(NSNumber *)nodeID; +- (nullable MTRCASESessionResumptionInfo *)findResumptionInfoByResumptionID:(NSData *)resumptionID; +- (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo; +- (void)clearAllResumptionInfo; + +/** + * Storage of the last NOC we used on this device. This is local-only storage, + * because it's used to invalidate (or not) the local-only session resumption + * storage. + */ +- (CHIP_ERROR)storeLastLocallyUsedNOC:(MTRCertificateTLVBytes)noc; +- (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm new file mode 100644 index 00000000000000..4732009ade3513 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm @@ -0,0 +1,359 @@ +/** + * Copyright (c) 2023 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 "MTRDeviceControllerDataStore.h" +#import "MTRLogging_Internal.h" + +#include +#include +#include + +// FIXME: Are these good key strings? https://github.com/project-chip/connectedhomeip/issues/28973 +static NSString * sResumptionNodeListKey = @"caseResumptionNodeList"; +static NSString * sLastLocallyUsedNOCKey = @"lastLocallyUsedControllerNOC"; + +static NSString * ResumptionByNodeIDKey(NSNumber * nodeID) +{ + return [NSString stringWithFormat:@"caseResumptionByNodeID/%llx", nodeID.unsignedLongLongValue]; +} + +static NSString * ResumptionByResumptionIDKey(NSData * resumptionID) +{ + return + [NSString stringWithFormat:@"caseResumptionByResumptionID/%s", [resumptionID base64EncodedStringWithOptions:0].UTF8String]; +} + +static bool IsUnsignedIntegerNumber(id _Nullable value) +{ + if (value == nil) { + return false; + } + + if (![value isKindOfClass:[NSNumber class]]) { + return false; + } + + NSNumber * number = value; + + // Not sure how to check for the number being an integer. + + if ([number compare:@(0)] == NSOrderedAscending) { + return false; + } + + return true; +} + +static bool IsValidNodeIDNumber(id _Nullable value) +{ + // Node IDs cannot be negative. + if (!IsUnsignedIntegerNumber(value)) { + return false; + } + + NSNumber * number = value; + + // Validate that this is a valid operational ID, not some garbage unsigned + // int value that can't be a node id. + uint64_t unsignedValue = number.unsignedLongLongValue; + if (!chip::IsOperationalNodeId(unsignedValue)) { + return false; + } + + return true; +} + +static bool IsValidCATNumber(id _Nullable value) +{ + // CATs cannot be negative. + if (!IsUnsignedIntegerNumber(value)) { + return false; + } + + NSNumber * number = value; + + // Validate that this is a valid CAT value and, not some garbage unsigned int + // value that can't be a CAT. + uint64_t unsignedValue = number.unsignedLongLongValue; + if (!chip::CanCastTo(unsignedValue)) { + return false; + } + + auto tag = static_cast(unsignedValue); + if (!chip::IsValidCASEAuthTag(tag)) { + return false; + } + + return true; +} + +@implementation MTRDeviceControllerDataStore { + id _storageDelegate; + dispatch_queue_t _storageDelegateQueue; + MTRDeviceController * _controller; + // Array of nodes with resumption info, oldest-stored first. + NSMutableArray * _nodesWithResumptionInfo; +} + +- (nullable instancetype)initWithController:(MTRDeviceController *)controller + storageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue +{ + if (!(self = [super init])) { + return nil; + } + + _controller = controller; + _storageDelegate = storageDelegate; + _storageDelegateQueue = storageDelegateQueue; + + __block id resumptionNodeList; + dispatch_sync(_storageDelegateQueue, ^{ + resumptionNodeList = [_storageDelegate controller:_controller + valueForKey:sResumptionNodeListKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); + if (resumptionNodeList != nil) { + if (![resumptionNodeList isKindOfClass:[NSArray class]]) { + MTR_LOG_ERROR("List of CASE resumption node IDs is not an array"); + return nil; + } + for (id value in resumptionNodeList) { + if (!IsValidNodeIDNumber(value)) { + MTR_LOG_ERROR("Resumption node ID contains invalid value: %@", value); + return nil; + } + } + _nodesWithResumptionInfo = [NSMutableArray arrayWithCapacity:[resumptionNodeList count]]; + [_nodesWithResumptionInfo addObjectsFromArray:resumptionNodeList]; + } else { + _nodesWithResumptionInfo = [[NSMutableArray alloc] init]; + } + return self; +} + +- (nullable MTRCASESessionResumptionInfo *)findResumptionInfoByNodeID:(NSNumber *)nodeID +{ + return [self _findResumptionInfoWithKey:ResumptionByNodeIDKey(nodeID)]; +} + +- (nullable MTRCASESessionResumptionInfo *)findResumptionInfoByResumptionID:(NSData *)resumptionID +{ + return [self _findResumptionInfoWithKey:ResumptionByResumptionIDKey(resumptionID)]; +} + +- (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo +{ + auto * oldInfo = [self findResumptionInfoByNodeID:resumptionInfo.nodeID]; + dispatch_sync(_storageDelegateQueue, ^{ + if (oldInfo != nil) { + // Remove old resumption id key. No need to do that for the + // node id, because we are about to overwrite it. + [_storageDelegate controller:_controller + removeValueForKey:ResumptionByResumptionIDKey(oldInfo.resumptionID) + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + [_nodesWithResumptionInfo removeObject:resumptionInfo.nodeID]; + } + + [_storageDelegate controller:_controller + storeValue:resumptionInfo + forKey:ResumptionByNodeIDKey(resumptionInfo.nodeID) + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + [_storageDelegate controller:_controller + storeValue:resumptionInfo + forKey:ResumptionByResumptionIDKey(resumptionInfo.resumptionID) + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + + // Update our resumption info node list. + [_nodesWithResumptionInfo addObject:resumptionInfo.nodeID]; + [_storageDelegate controller:_controller + storeValue:[NSArray arrayWithArray:_nodesWithResumptionInfo] + forKey:sResumptionNodeListKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); +} + +- (void)clearAllResumptionInfo +{ + // Can we do less dispatch? We would need to have a version of + // _findResumptionInfoWithKey that assumes we are already on the right queue. + for (NSNumber * nodeID in _nodesWithResumptionInfo) { + auto * oldInfo = [self findResumptionInfoByNodeID:nodeID]; + if (oldInfo != nil) { + dispatch_sync(_storageDelegateQueue, ^{ + [_storageDelegate controller:_controller + removeValueForKey:ResumptionByResumptionIDKey(oldInfo.resumptionID) + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + [_storageDelegate controller:_controller + removeValueForKey:ResumptionByNodeIDKey(oldInfo.nodeID) + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); + } + } + + [_nodesWithResumptionInfo removeAllObjects]; +} + +- (CHIP_ERROR)storeLastLocallyUsedNOC:(MTRCertificateTLVBytes)noc +{ + __block BOOL ok; + dispatch_sync(_storageDelegateQueue, ^{ + ok = [_storageDelegate controller:_controller + storeValue:noc + forKey:sLastLocallyUsedNOCKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); + return ok ? CHIP_NO_ERROR : CHIP_ERROR_PERSISTED_STORAGE_FAILED; +} + +- (MTRCertificateTLVBytes _Nullable)fetchLastLocallyUsedNOC +{ + __block id data; + dispatch_sync(_storageDelegateQueue, ^{ + data = [_storageDelegate controller:_controller + valueForKey:sLastLocallyUsedNOCKey + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); + + if (data == nil) { + return nil; + } + + if (![data isKindOfClass:[NSData class]]) { + return nil; + } + + return data; +} + +- (nullable MTRCASESessionResumptionInfo *)_findResumptionInfoWithKey:(nullable NSString *)key +{ + // key could be nil if [NSString stringWithFormat] returns nil for some reason. + if (key == nil) { + return nil; + } + + __block id resumptionInfo; + dispatch_sync(_storageDelegateQueue, ^{ + resumptionInfo = [_storageDelegate controller:_controller + valueForKey:key + securityLevel:MTRStorageSecurityLevelSecure + sharingType:MTRStorageSharingTypeNotShared]; + }); + + if (resumptionInfo == nil) { + return nil; + } + + if (![resumptionInfo isKindOfClass:[MTRCASESessionResumptionInfo class]]) { + return nil; + } + + return resumptionInfo; +} + +@end + +@implementation MTRCASESessionResumptionInfo + +#pragma mark - NSSecureCoding + +static NSString * const sNodeIDKey = @"nodeID"; +static NSString * const sResumptionIDKey = @"resumptionID"; +static NSString * const sSharedSecretKey = @"sharedSecret"; +static NSString * const sCATsKey = @"CATs"; + ++ (BOOL)supportsSecureCoding +{ + return YES; +} + +- (nullable instancetype)initWithCoder:(NSCoder *)decoder +{ + self = [super init]; + if (self == nil) { + return nil; + } + + _nodeID = [decoder decodeObjectOfClass:[NSNumber class] forKey:sNodeIDKey]; + // For some built-in classes decoder will decode to them even if we ask for a + // different class (!). So sanity-check what we got. + if (_nodeID != nil && ![_nodeID isKindOfClass:[NSNumber class]]) { + MTR_LOG_ERROR("MTRCASESessionResumptionInfo got %@ for node ID, not NSNumber.", _nodeID); + return nil; + } + if (!IsValidNodeIDNumber(_nodeID)) { + MTR_LOG_ERROR("MTRCASESessionResumptionInfo node ID has invalid value: %@", _nodeID); + return nil; + } + + _resumptionID = [decoder decodeObjectOfClass:[NSData class] forKey:sResumptionIDKey]; + if (_resumptionID != nil && ![_resumptionID isKindOfClass:[NSData class]]) { + MTR_LOG_ERROR("MTRCASESessionResumptionInfo got %@ for resumption ID, not NSData.", _resumptionID); + return nil; + } + + _sharedSecret = [decoder decodeObjectOfClass:[NSData class] forKey:sSharedSecretKey]; + if (_sharedSecret != nil && ![_sharedSecret isKindOfClass:[NSData class]]) { + MTR_LOG_ERROR("MTRCASESessionResumptionInfo got %@ for shared secret, not NSData.", _sharedSecret); + return nil; + } + + auto caseAuthenticatedTagArray = [decoder decodeArrayOfObjectsOfClass:[NSNumber class] forKey:sCATsKey]; + for (id value in caseAuthenticatedTagArray) { + if (!IsValidCATNumber(value)) { + MTR_LOG_ERROR("MTRCASESessionResumptionInfo CASE tag has invalid value: %@", value); + return nil; + } + + // Range-checking will be done when we try to convert the set to CATValues. + } + + _caseAuthenticatedTags = [NSSet setWithArray:caseAuthenticatedTagArray]; + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + [coder encodeObject:self.nodeID forKey:sNodeIDKey]; + [coder encodeObject:self.resumptionID forKey:sResumptionIDKey]; + [coder encodeObject:self.sharedSecret forKey:sSharedSecretKey]; + // Encode the CATs as an array, so that we can decodeArrayOfObjectsOfClass + // to get type-safe decoding for them. + [coder encodeObject:[self.caseAuthenticatedTags allObjects] forKey:sCATsKey]; +} + +@end + +NSSet * MTRDeviceControllerStorageClasses() +{ + static NSSet * const sStorageClasses = [NSSet setWithArray:@[ + [NSNumber class], + [NSData class], + [NSArray class], + [MTRCASESessionResumptionInfo class], + ]]; + return sStorageClasses; +} diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h index 0423aeae585c70..6471db8b005ccb 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h @@ -22,6 +22,7 @@ #import #import +#import NS_ASSUME_NONNULL_BEGIN @@ -37,9 +38,11 @@ NS_ASSUME_NONNULL_BEGIN API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDeviceControllerFactoryParams : NSObject /* - * Storage delegate must be provided for correct functioning of Matter - * controllers. It is used to store persistent information for the fabrics the - * controllers ends up interacting with. + * Storage used to store persistent information for the fabrics the + * controllers ends up interacting with. This is only used if "initWithStorage" + * is used to initialize the MTRDeviceControllerFactoryParams. If "init" is + * used, this property will contain a dummy storage that will not be used for + * anything. */ @property (nonatomic, strong, readonly) id storage; @@ -83,8 +86,19 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ @property (nonatomic, assign) BOOL shouldStartServer; -- (instancetype)init NS_UNAVAILABLE; +/* + * Initialize the device controller factory with storage. In this mode, the + * storage will be used to store various information needed by the Matter + * framework. + */ - (instancetype)initWithStorage:(id)storage; + +/* + * Initialize the device controller factory without storage. In this mode, + * device controllers will need to have per-controller storage provided to allow + * storing controller-specific information. + */ +- (instancetype)init MTR_NEWLY_AVAILABLE; @end API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @@ -145,6 +159,9 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * * The fabric is identified by the root public key and fabric id in * the startupParams. + * + * This method can only be used if the factory was initialized with storage. + * When using per-controller storage, use createController. */ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; @@ -156,10 +173,25 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) * * The fabric is identified by the root public key and fabric id in * the startupParams. + * + * This method can only be used if the factory was initialized with storage. + * When using per-controller storage, use createController. */ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; +/** + * Create an MTRDeviceController. Returns nil on failure. + * + * This method will fail if there is already a controller running for the given + * node identity. + * + * This method will fail if the controller factory was not initialized in + * storage-per-controller mode. + */ +- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; + @end MTR_DEPRECATED( diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 64e4af1ba29fc9..95282450952ef2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -20,6 +20,7 @@ #import "MTRAttestationTrustStoreBridge.h" #import "MTRCertificates.h" #import "MTRControllerAccessControl.h" +#import "MTRDemuxingStorage.h" #import "MTRDeviceController.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" @@ -32,6 +33,7 @@ #import "MTROperationalBrowser.h" #import "MTRP256KeypairBridge.h" #import "MTRPersistentStorageDelegateBridge.h" +#import "MTRSessionResumptionStorageBridge.h" #import "NSDataSpanConversion.h" #import @@ -55,6 +57,7 @@ using namespace chip::Controller; static NSString * const kErrorPersistentStorageInit = @"Init failure while creating a persistent storage delegate"; +static NSString * const kErrorSessionResumptionStorageInit = @"Init failure while creating a session resumption storage delegate"; static NSString * const kErrorAttestationTrustStoreInit = @"Init failure while creating the attestation trust store"; static NSString * const kErrorDACVerifierInit = @"Init failure while creating the device attestation verifier"; static NSString * const kErrorGroupProviderInit = @"Init failure while initializing group data provider"; @@ -90,21 +93,36 @@ @interface MTRDeviceControllerFactory () @property () chip::Credentials::DeviceAttestationVerifier * deviceAttestationVerifier; @property (readonly) BOOL advertiseOperational; @property (nonatomic, readonly) Credentials::IgnoreCertificateValidityPeriodPolicy * certificateValidityPolicy; -// Lock used to serialize access to the "controllers" array, since it needs to -// be touched from both whatever queue is starting controllers and from the -// Matter queue. The way this lock is used assumes that: +@property (readonly) MTRSessionResumptionStorageBridge * sessionResumptionStorage; +// Lock used to serialize access to the "controllers" array and the +// "_controllerBeingStarted" and "_controllerBeingShutDown" ivars, since those +// need to be touched from both whatever queue is starting controllers and from +// the Matter queue. The way this lock is used assumes that: +// +// 1) The only mutating accesses to the controllers array and the ivars happen +// when the current queue is not the Matter queue or in a block that was +// sync-dispatched to the Matter queue. This is a good assumption, because +// the implementations of the functions that mutate these do sync dispatch to +// the Matter queue, which would deadlock if they were called when that queue +// was the current queue. // -// 1) The only mutating accesses to the controllers array happen when the -// current queue is not the Matter queue. This is a good assumption, because -// the implementation of the functions that mutate the array do sync dispatch -// to the Matter queue, which would deadlock if they were called when that -// queue was the current queue. // 2) It's our API consumer's responsibility to serialize access to us from // outside. // -// This means that we only take the lock around mutations of the array and -// accesses to the array that are from code running on the Matter queue. - +// These assumptions mean that if we are in a block that was sync-dispatched to +// the Matter queue, that block cannot race with either the Matter queue nor the +// non-Matter queue. Similarly, if we are in a situation where the Matter queue +// has been shut down, any accesses to the variables cannot race anything else. +// +// This means that: +// +// A. In a sync-dispatched block, or if the Matter queue has been shut down, we +// do not need to lock and can do read or write access. +// B. Apart from item A, mutations of the array and ivars must happen outside the +// Matter queue and must lock. +// C. Apart from item A, accesses on the Matter queue must be reads only and +// must lock. +// D. Locking around reads not from the Matter queue is OK but not required. @property (nonatomic, readonly) os_unfair_lock controllersLock; - (BOOL)findMatchingFabric:(FabricTable &)fabricTable @@ -114,7 +132,34 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable - (MTRDeviceController * _Nullable)maybeInitializeOTAProvider:(MTRDeviceController * _Nonnull)controller; @end -@implementation MTRDeviceControllerFactory +@interface MTRDeviceControllerFactoryParams () + +// Flag to keep track of whether our .storage is real consumer-provided storage +// or just the fake thing we made up. +@property (nonatomic, assign) BOOL hasStorage; + +@end + +@implementation MTRDeviceControllerFactory { + // _usingPerControllerStorage is only written once, during controller + // factory start. After that it is only read, and can be read from + // arbitrary threads. + BOOL _usingPerControllerStorage; + + // See documentation for controllersLock above for the rules for accessing + // _controllerBeingStarted. + MTRDeviceController * _controllerBeingStarted; + + // See documentation for controllersLock above for the rules for access + // _controllerBeingShutDown. + MTRDeviceController * _controllerBeingShutDown; + + // Next available fabric index. Only valid when _controllerBeingStarted is + // non-nil, and then it corresponds to the controller being started. This + // is only accessed on the Matter queue or after the Matter queue has shut + // down. + FabricIndex _nextAvailableFabricIndex; +} + (void)initialize { @@ -273,12 +318,23 @@ - (void)cleanupStartupObjects _opCertStore = nullptr; } + if (_sessionResumptionStorage) { + delete _sessionResumptionStorage; + _sessionResumptionStorage = nullptr; + } + if (_persistentStorageDelegate) { delete _persistentStorageDelegate; _persistentStorageDelegate = nullptr; } } +- (CHIP_ERROR)_initFabricTable:(FabricTable &)fabricTable +{ + return fabricTable.Init( + { .storage = _persistentStorageDelegate, .operationalKeystore = _keystore, .opCertStore = _opCertStore }); +} + - (nullable NSArray *)knownFabrics { [self _assertCurrentQueueIsNotMatterQueue]; @@ -291,9 +347,7 @@ - (void)cleanupStartupObjects __block BOOL listFilled = NO; auto fillListBlock = ^{ FabricTable fabricTable; - CHIP_ERROR err = fabricTable.Init({ .storage = self->_persistentStorageDelegate, - .operationalKeystore = self->_keystore, - .opCertStore = self->_opCertStore }); + CHIP_ERROR err = [self _initFabricTable:fabricTable]; if (err != CHIP_NO_ERROR) { MTR_LOG_ERROR("Can't initialize fabric table when getting known fabrics: %s", err.AsString()); return; @@ -348,7 +402,22 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams [MTRControllerAccessControl init]; - _persistentStorageDelegate = new MTRPersistentStorageDelegateBridge(startupParams.storage); + if (startupParams.hasStorage) { + _persistentStorageDelegate = new (std::nothrow) MTRPersistentStorageDelegateBridge(startupParams.storage); + _sessionResumptionStorage = nullptr; + _usingPerControllerStorage = NO; + } else { + _persistentStorageDelegate = new (std::nothrow) MTRDemuxingStorage(self); + _sessionResumptionStorage = new (std::nothrow) MTRSessionResumptionStorageBridge(self); + _usingPerControllerStorage = YES; + + if (_sessionResumptionStorage == nil) { + MTR_LOG_ERROR("Error: %@", kErrorSessionResumptionStorageInit); + errorCode = CHIP_ERROR_NO_MEMORY; + return; + } + } + if (_persistentStorageDelegate == nil) { MTR_LOG_ERROR("Error: %@", kErrorPersistentStorageInit); errorCode = CHIP_ERROR_NO_MEMORY; @@ -486,6 +555,7 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams params.operationalKeystore = _keystore; params.opCertStore = _opCertStore; params.certificateValidityPolicy = _certificateValidityPolicy; + params.sessionResumptionStorage = _sessionResumptionStorage; errorCode = _controllerFactory->Init(params); if (errorCode != CHIP_NO_ERROR) { MTR_LOG_ERROR("Error: %@", kErrorControllerFactoryInit); @@ -559,7 +629,7 @@ - (void)stopControllerFactory * return nil if pre-startup fabric table checks fail, and set fabricError to * the right error value in that situation. */ -- (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceControllerStartupParams *)startupParams +- (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams fabricChecker:(MTRDeviceControllerStartupParamsInternal * (^)(FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError))fabricChecker @@ -572,9 +642,45 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceControllerSt return nil; } + id storageDelegate; + dispatch_queue_t storageDelegateQueue; + NSUUID * uniqueIdentifier; + if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParameters class]]) { + MTRDeviceControllerStartupParameters * params = startupParams; + storageDelegate = params.storageDelegate; + storageDelegateQueue = params.storageDelegateQueue; + uniqueIdentifier = params.uniqueIdentifier; + } else if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParams class]]) { + MTRDeviceControllerStartupParams * params = startupParams; + storageDelegate = nil; + storageDelegateQueue = nil; + uniqueIdentifier = params.uniqueIdentifier; + } else { + MTR_LOG_ERROR("Unknown kind of startup params: %@", startupParams); + return nil; + } + + if (_usingPerControllerStorage && storageDelegate == nil) { + MTR_LOG_ERROR("Must have a controller storage delegate when we do not have storage for the controller factory"); + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } + return nil; + } + + if (!_usingPerControllerStorage && storageDelegate != nil) { + MTR_LOG_ERROR("Must not have a controller storage delegate when we have storage for the controller factory"); + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } + return nil; + } + // Create the controller, so we start the event loop, since we plan to do // our fabric table operations there. - auto * controller = [self createController]; + auto * controller = [self _createController:storageDelegate + storageDelegateQueue:storageDelegateQueue + uniqueIdentifier:uniqueIdentifier]; if (controller == nil) { if (error != nil) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]; @@ -591,7 +697,39 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceControllerSt FabricTable * fabricTable = &fabricTableInstance; dispatch_sync(_chipWorkQueue, ^{ + fabricError = [self _initFabricTable:*fabricTable]; + if (fabricError != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Can't initialize fabric table: %s", fabricError.AsString()); + return; + } + params = fabricChecker(fabricTable, controller, fabricError); + + if (params == nil) { + return; + } + + // Check that we are not trying to start a controller with a uniqueIdentifier that + // matches a running controller. + auto * controllersCopy = [self getRunningControllers]; + for (MTRDeviceController * existing in controllersCopy) { + if (existing != controller && [existing.uniqueIdentifier compare:params.uniqueIdentifier] == NSOrderedSame) { + MTR_LOG_ERROR("Already have running controller with uniqueIdentifier %@", existing.uniqueIdentifier); + fabricError = CHIP_ERROR_INVALID_ARGUMENT; + params = nil; + return; + } + } + + // Save off the next available fabric index, in case we are starting a + // controller with a new fabric index. This just needs to happen before + // we set _controllerBeingStarted below. + fabricError = fabricTable->PeekFabricIndexForNextAddition(self->_nextAvailableFabricIndex); + if (fabricError != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Out of space in the fabric table"); + params = nil; + return; + } }); if (params == nil) { @@ -602,7 +740,16 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceControllerSt return nil; } + os_unfair_lock_lock(&_controllersLock); + _controllerBeingStarted = controller; + os_unfair_lock_unlock(&_controllersLock); + BOOL ok = [controller startup:params]; + + os_unfair_lock_lock(&_controllersLock); + _controllerBeingStarted = nil; + os_unfair_lock_unlock(&_controllersLock); + if (ok == NO) { // TODO: get error from controller's startup. if (error != nil) { @@ -625,6 +772,16 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo { [self _assertCurrentQueueIsNotMatterQueue]; + if (_usingPerControllerStorage) { + // We can never have an "existing fabric" for a new controller to be + // created on, in the sense of createControllerOnExistingFabric. + MTR_LOG_ERROR("Can't createControllerOnExistingFabric when using per-controller data store"); + if (error != nil) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + return nil; + } + return [self _startDeviceController:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { @@ -728,11 +885,36 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl error:error]; } -- (MTRDeviceController * _Nullable)createController +- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters + error:(NSError * __autoreleasing *)error { [self _assertCurrentQueueIsNotMatterQueue]; - MTRDeviceController * controller = [[MTRDeviceController alloc] initWithFactory:self queue:_chipWorkQueue]; + return [self _startDeviceController:startupParameters + fabricChecker:^MTRDeviceControllerStartupParamsInternal *( + FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { + return + [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller + fabricTable:fabricTable + keystore:self->_keystore + advertiseOperational:self.advertiseOperational + params:startupParameters + error:fabricError]; + } + error:error]; +} + +- (MTRDeviceController * _Nullable)_createController:(id _Nullable)storageDelegate + storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier +{ + [self _assertCurrentQueueIsNotMatterQueue]; + + MTRDeviceController * controller = [[MTRDeviceController alloc] initWithFactory:self + queue:_chipWorkQueue + storageDelegate:storageDelegate + storageDelegateQueue:storageDelegateQueue + uniqueIdentifier:uniqueIdentifier]; if (controller == nil) { MTR_LOG_ERROR("Failed to init controller"); return nil; @@ -761,7 +943,7 @@ - (MTRDeviceController * _Nullable)createController // Returns NO on failure, YES on success. If YES is returned, the // outparam will be written to, but possibly with a null value. // -// fabricTable should be an un-initialized fabric table. It needs to +// fabricTable should be an initialized fabric table. It needs to // outlive the consumer's use of the FabricInfo we return, which is // why it's provided by the caller. - (BOOL)findMatchingFabric:(FabricTable &)fabricTable @@ -770,16 +952,9 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable { assertChipStackLockedByCurrentThread(); - CHIP_ERROR err = fabricTable.Init( - { .storage = _persistentStorageDelegate, .operationalKeystore = _keystore, .opCertStore = _opCertStore }); - if (err != CHIP_NO_ERROR) { - MTR_LOG_ERROR("Can't initialize fabric table: %s", ErrorStr(err)); - return NO; - } - Crypto::P256PublicKey pubKey; if (params.rootCertificate != nil) { - err = ExtractPubkeyFromX509Cert(AsByteSpan(params.rootCertificate), pubKey); + CHIP_ERROR err = ExtractPubkeyFromX509Cert(AsByteSpan(params.rootCertificate), pubKey); if (err != CHIP_NO_ERROR) { MTR_LOG_ERROR("Can't extract public key from root certificate: %s", ErrorStr(err)); return NO; @@ -787,7 +962,7 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable } else { // No root certificate means the nocSigner is using the root keys, because // consumers must provide a root certificate whenever an ICA is used. - err = MTRP256KeypairBridge::MatterPubKeyFromSecKeyRef(params.nocSigner.publicKey, &pubKey); + CHIP_ERROR err = MTRP256KeypairBridge::MatterPubKeyFromSecKeyRef(params.nocSigner.publicKey, &pubKey); if (err != CHIP_NO_ERROR) { MTR_LOG_ERROR("Can't extract public key from MTRKeypair: %s", ErrorStr(err)); return NO; @@ -850,9 +1025,33 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller } os_unfair_lock_lock(&_controllersLock); + // Make sure to set _controllerBeingShutDown and do the remove in the same + // locked section, so there is never a time when the controller is gone from + // both places as viewed from the Matter thread, as long as it's locking + // around its reads. + _controllerBeingShutDown = controller; [_controllers removeObject:controller]; os_unfair_lock_unlock(&_controllersLock); + // Snapshot the controller's fabric index, if any, before it clears it + // out in shutDownCppController. + __block FabricIndex controllerFabricIndex = controller.fabricIndex; + + // This block runs either during sync dispatch to the Matter queue or after + // Matter queue shutdown, so it can touch any of our members without + // worrying about locking, since nothing else will race it. + auto sharedCleanupBlock = ^{ + assertChipStackLockedByCurrentThread(); + + [controller shutDownCppController]; + + self->_controllerBeingShutDown = nil; + if (self->_controllerBeingStarted == controller) { + controllerFabricIndex = self->_nextAvailableFabricIndex; + self->_controllerBeingStarted = nil; + } + }; + if ([_controllers count] == 0) { dispatch_sync(_chipWorkQueue, ^{ delete self->_operationalBrowser; @@ -867,7 +1066,23 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller _otaProviderDelegateBridge->Shutdown(); } - [controller shutDownCppController]; + sharedCleanupBlock(); + + // Now that our per-controller storage for the controller being shut + // down is guaranteed to be disconnected, go ahead and clean up the + // fabric table entry for the controller if we're in per-controller + // storage mode. + if (self->_usingPerControllerStorage) { + // We have to use a new fabric table to do this cleanup, because + // our system state is gone now. + FabricTable fabricTable; + CHIP_ERROR err = [self _initFabricTable:fabricTable]; + if (err != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Failed to clean up fabric entries. Expect things to act oddly: %" CHIP_ERROR_FORMAT, err.Format()); + } else { + fabricTable.Delete(controllerFabricIndex); + } + } } else { // Do the controller shutdown on the Matter work queue. dispatch_sync(_chipWorkQueue, ^{ @@ -875,7 +1090,19 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller _otaProviderDelegateBridge->ControllerShuttingDown(controller); } - [controller shutDownCppController]; + sharedCleanupBlock(); + + // Now that our per-controller storage for the controller being shut + // down is guaranteed to be disconnected, go ahead and clean up the + // fabric table entry for the controller if we're in per-controller + // storage mode. + if (self->_usingPerControllerStorage) { + // Make sure to delete controllerFabricIndex from the system state's + // fabric table. We know there's a system state here, because we + // still have a running controller. + auto * systemState = _controllerFactory->GetSystemState(); + systemState->Fabrics()->Delete(controllerFabricIndex); + } }); } @@ -890,21 +1117,42 @@ - (void)controllerShuttingDown:(MTRDeviceController *)controller return controllersCopy; } -- (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricIndex)fabricIndex +- (nullable MTRDeviceController *)runningControllerForFabricIndex:(FabricIndex)fabricIndex + includeControllerStartingUp:(BOOL)includeControllerStartingUp + includeControllerShuttingDown:(BOOL)includeControllerShuttingDown { assertChipStackLockedByCurrentThread(); auto * controllersCopy = [self getRunningControllers]; + os_unfair_lock_lock(&_controllersLock); + MTRDeviceController * controllerBeingStarted = _controllerBeingStarted; + MTRDeviceController * controllerBeingShutDown = _controllerBeingShutDown; + os_unfair_lock_unlock(&_controllersLock); + for (MTRDeviceController * existing in controllersCopy) { - if ([existing fabricIndex] == fabricIndex) { + if (existing.fabricIndex == fabricIndex) { return existing; } } + if (includeControllerStartingUp == YES && controllerBeingStarted != nil && fabricIndex == _nextAvailableFabricIndex) { + return controllerBeingStarted; + } + + if (includeControllerShuttingDown == YES && controllerBeingShutDown != nil + && controllerBeingShutDown.fabricIndex == fabricIndex) { + return controllerBeingShutDown; + } + return nil; } +- (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricIndex)fabricIndex +{ + return [self runningControllerForFabricIndex:fabricIndex includeControllerStartingUp:YES includeControllerShuttingDown:YES]; +} + - (void)operationalInstanceAdded:(chip::PeerId &)operationalID { assertChipStackLockedByCurrentThread(); @@ -936,6 +1184,25 @@ - (PersistentStorageDelegate *)storageDelegate @end +MTR_HIDDEN +@interface MTRDummyStorage : NSObject +@end + +@implementation MTRDummyStorage +- (nullable NSData *)storageDataForKey:(NSString *)key +{ + return nil; +} +- (BOOL)setStorageData:(NSData *)value forKey:(NSString *)key +{ + return NO; +} +- (BOOL)removeStorageDataForKey:(NSString *)key +{ + return NO; +} +@end + @implementation MTRDeviceControllerFactoryParams - (instancetype)initWithStorage:(id)storage @@ -945,6 +1212,27 @@ - (instancetype)initWithStorage:(id)storage } _storage = storage; + _hasStorage = YES; + _otaProviderDelegate = nil; + _productAttestationAuthorityCertificates = nil; + _certificationDeclarationCertificates = nil; + _port = nil; + _shouldStartServer = NO; + + return self; +} + +- (instancetype)init +{ + if (!(self = [super init])) { + return nil; + } + + // We promise to have a non-null storage for purposes of our attribute, but + // now we're allowing initialization without storage. Make up a dummy + // storage just so we don't have nil there. + _storage = [[MTRDummyStorage alloc] init]; + _hasStorage = NO; _otaProviderDelegate = nil; _productAttestationAuthorityCertificates = nil; _certificationDeclarationCertificates = nil; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index dc0b968b427782..4ffcb3af545506 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -53,6 +53,15 @@ NS_ASSUME_NONNULL_BEGIN */ - (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricIndex)fabricIndex; +/** + * Find a running controller, if any, for the given fabric index. Allows + * controlling whether to include a controller that is in the middle of startup + * or shutdown. + */ +- (nullable MTRDeviceController *)runningControllerForFabricIndex:(chip::FabricIndex)fabricIndex + includeControllerStartingUp:(BOOL)includeControllerStartingUp + includeControllerShuttingDown:(BOOL)includeControllerShuttingDown; + /** * Notify the controller factory that a new operational instance with the given * compressed fabric id and node id has been observed. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h new file mode 100644 index 00000000000000..7087bd87fbaf8e --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2023 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 + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +MTR_NEWLY_AVAILABLE +@interface MTRDeviceControllerStartupParameters : NSObject + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/** + * Set an MTROperationalCertificateIssuer to call (on the provided queue) when + * operational certificates need to be provided during commissioning. + */ +- (void)setOperationalCertificateIssuer:(id)operationalCertificateIssuer + queue:(dispatch_queue_t)queue; + +@end + +MTR_NEWLY_AVAILABLE +@interface MTRDeviceControllerExternalCertificateStartupParameters : MTRDeviceControllerStartupParameters + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +/** + * Prepare to initialize a controller that is not able to sign operational + * certificates itself, and therefore needs to be provided with a complete + * operational certificate chain. + * + * A controller created from MTRDeviceControllerStartupParams initialized with + * this method will not be able to commission devices unless + * operationalCertificateIssuer and operationalCertificateIssuerQueue are set. + * + * The fabric id and node id to use for the controller will be derived from the provided + * operationalCertificate. + * + * @param storageDelegate The storage to use for the controller. This will be + * called into on storageDelegateQueue. + * + * @param storageDelegateQueue The queue for calls into storageDelegate. See + * MTRDeviceControllerStorageDelegate documentation + * for the rules about what work is allowed to be + * done on this queue. + * + * @param uniqueIdentifier The unique id to assign to the controller. + * + * @param vendorID The vendor ID (allocated by the Connectivity Standards Alliance) for + * this controller. Must not be the "standard" vendor id (0). + * + * @param ipk The Identity Protection Key. Must be 16 bytes in length. + * + * @param intermediateCertificate Must be nil if operationalCertificate is + * directly signed by rootCertificate. Otherwise + * must be the certificate that signed + * operationalCertificate. + */ +- (instancetype)initWithStorageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + ipk:(NSData *)ipk + vendorID:(NSNumber *)vendorID + operationalKeypair:(id)operationalKeypair + operationalCertificate:(MTRCertificateDERBytes)operationalCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + rootCertificate:(MTRCertificateDERBytes)rootCertificate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index ca92c63bf2171b..9fb71429a07720 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -18,10 +18,13 @@ #import "MTRCertificates.h" #import "MTRConversion.h" #import "MTRDeviceControllerStartupParams_Internal.h" +#import "MTRDeviceController_Internal.h" #import "MTRLogging_Internal.h" #import "MTRP256KeypairBridge.h" #import "NSDataSpanConversion.h" +#import + #include #include #include @@ -29,6 +32,41 @@ using namespace chip; +static CHIP_ERROR ExtractNodeIDFabricIDFromNOC( + MTRCertificateDERBytes noc, NSNumber * __autoreleasing * nodeID, NSNumber * __autoreleasing * fabricID) +{ + // ExtractNodeIdFabricIdFromOpCert needs a TLV-encoded opcert, not a DER-encoded one. + auto * tlvNOC = [MTRCertificates convertX509Certificate:noc]; + if (tlvNOC == nil) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + ByteSpan nocSpan = AsByteSpan(tlvNOC); + + FabricId certFabricID = kUndefinedFabricId; + NodeId certNodeID = kUndefinedNodeId; + CHIP_ERROR err = Credentials::ExtractNodeIdFabricIdFromOpCert(nocSpan, &certNodeID, &certFabricID); + if (err != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Unable to extract node ID and fabric ID from operational certificate: %s", err.AsString()); + return err; + } + *nodeID = @(certNodeID); + *fabricID = @(certFabricID); + return CHIP_NO_ERROR; +} + +static CHIP_ERROR ExtractFabricIDFromNOC(MTRCertificateDERBytes noc, NSNumber * __autoreleasing * fabricID) +{ + NSNumber * ignored; + return ExtractNodeIDFabricIDFromNOC(noc, &ignored, fabricID); +} + +static CHIP_ERROR ExtractNodeIDFromNOC(MTRCertificateDERBytes noc, NSNumber * __autoreleasing * nodeID) +{ + NSNumber * ignored; + return ExtractNodeIDFabricIDFromNOC(noc, nodeID, &ignored); +} + @implementation MTRDeviceControllerStartupParams - (instancetype)initWithIPK:(NSData *)ipk fabricID:(NSNumber *)fabricID nocSigner:(id)nocSigner @@ -45,6 +83,7 @@ - (instancetype)initWithIPK:(NSData *)ipk fabricID:(NSNumber *)fabricID nocSigne _nocSigner = nocSigner; _fabricID = [fabricID copy]; _ipk = [ipk copy]; + _uniqueIdentifier = [NSUUID UUID]; return self; } @@ -59,24 +98,13 @@ - (instancetype)initWithIPK:(NSData *)ipk return nil; } - { // Scope for temporaries - // ExtractNodeIdFabricIdFromOpCert needs a TLV-encoded opcert, not a DER-encoded one. - uint8_t tlvOpCertBuf[Credentials::kMaxCHIPCertLength]; - MutableByteSpan tlvOpCert(tlvOpCertBuf); - CHIP_ERROR err = Credentials::ConvertX509CertToChipCert(AsByteSpan(operationalCertificate), tlvOpCert); + { // Scope for temporary + NSNumber * fabricID; + CHIP_ERROR err = ExtractFabricIDFromNOC(operationalCertificate, &fabricID); if (err != CHIP_NO_ERROR) { - MTR_LOG_ERROR("Unable to convert operational certificate to TLV: %s", ErrorStr(err)); return nil; } - - FabricId fabricId = kUndefinedFabricId; - NodeId unused = kUndefinedNodeId; - err = Credentials::ExtractNodeIdFabricIdFromOpCert(tlvOpCert, &unused, &fabricId); - if (err != CHIP_NO_ERROR) { - MTR_LOG_ERROR("Unable to extract fabric id from operational certificate: %s", ErrorStr(err)); - return nil; - } - _fabricID = @(fabricId); + _fabricID = fabricID; } _operationalKeypair = operationalKeypair; @@ -84,6 +112,7 @@ - (instancetype)initWithIPK:(NSData *)ipk _intermediateCertificate = [intermediateCertificate copy]; _rootCertificate = [rootCertificate copy]; _ipk = [ipk copy]; + _uniqueIdentifier = [NSUUID UUID]; return self; } @@ -106,6 +135,50 @@ - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params _operationalKeypair = params.operationalKeypair; _operationalCertificateIssuer = params.operationalCertificateIssuer; _operationalCertificateIssuerQueue = params.operationalCertificateIssuerQueue; + _uniqueIdentifier = params.uniqueIdentifier; + + return self; +} + +- (instancetype)initWithParameters:(MTRDeviceControllerStartupParameters *)params error:(CHIP_ERROR &)error +{ + if (!(self = [super init])) { + error = CHIP_ERROR_INCORRECT_STATE; + return nil; + } + + if (![params isKindOfClass:[MTRDeviceControllerExternalCertificateStartupParameters class]]) { + MTR_LOG_ERROR("Unexpected subclass of MTRDeviceControllerStartupParameters"); + error = CHIP_ERROR_INVALID_ARGUMENT; + return nil; + } + + _nocSigner = nil; + + NSNumber * fabricID; + error = ExtractFabricIDFromNOC(params.operationalCertificate, &fabricID); + if (error != CHIP_NO_ERROR) { + return nil; + } + _fabricID = fabricID; + + _ipk = params.ipk; + _vendorID = params.vendorID; + // Note: Since we have an operationalCertificate, we do not need a nodeID as + // part of our params; it will not be used. Don't even initialize it, to + // avoid confusion about that. + // + // We don't really use the fabricID for anything either, but we promise to + // have a non-nil one, which is why we set it above. + _nodeID = nil; + _caseAuthenticatedTags = nil; + _rootCertificate = params.rootCertificate; + _intermediateCertificate = params.intermediateCertificate; + _operationalCertificate = params.operationalCertificate; + _operationalKeypair = params.operationalKeypair; + _operationalCertificateIssuer = params.operationalCertificateIssuer; + _operationalCertificateIssuerQueue = params.operationalCertificateIssuerQueue; + _uniqueIdentifier = params.uniqueIdentifier; return self; } @@ -120,7 +193,7 @@ - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params MutableByteSpan derCert(buf); CHIP_ERROR err = Credentials::ConvertChipCertToX509Cert(cert, derCert); if (err != CHIP_NO_ERROR) { - MTR_LOG_ERROR("Failed do convert Matter certificate to X.509 DER: %s", ErrorStr(err)); + MTR_LOG_ERROR("Failed to convert Matter certificate to X.509 DER: %s", ErrorStr(err)); return nil; } @@ -174,6 +247,68 @@ - (instancetype)initWithOperationalKeypair:(id)operationalKeypair @end +@implementation MTRDeviceControllerStartupParameters +- (instancetype)initWithStorageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + ipk:(NSData *)ipk + vendorID:(NSNumber *)vendorID + operationalKeypair:(id)operationalKeypair + operationalCertificate:(MTRCertificateDERBytes)operationalCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + rootCertificate:(MTRCertificateDERBytes)rootCertificate +{ + if (!(self = [super init])) { + return nil; + } + + _ipk = ipk; + _vendorID = vendorID; + _rootCertificate = rootCertificate; + _intermediateCertificate = intermediateCertificate; + _operationalCertificate = operationalCertificate; + _operationalKeypair = operationalKeypair; + + _operationalCertificateIssuer = nil; + _operationalCertificateIssuerQueue = nil; + _storageDelegate = storageDelegate; + _storageDelegateQueue = storageDelegateQueue; + _uniqueIdentifier = uniqueIdentifier; + + return self; +} + +- (void)setOperationalCertificateIssuer:(id)operationalCertificateIssuer + queue:(dispatch_queue_t)queue +{ + _operationalCertificateIssuer = operationalCertificateIssuer; + _operationalCertificateIssuerQueue = queue; +} +@end + +@implementation MTRDeviceControllerExternalCertificateStartupParameters +- (instancetype)initWithStorageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + ipk:(NSData *)ipk + vendorID:(NSNumber *)vendorID + operationalKeypair:(id)operationalKeypair + operationalCertificate:(MTRCertificateDERBytes)operationalCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + rootCertificate:(MTRCertificateDERBytes)rootCertificate +{ + return [super initWithStorageDelegate:storageDelegate + storageDelegateQueue:storageDelegateQueue + uniqueIdentifier:uniqueIdentifier + ipk:ipk + vendorID:vendorID + operationalKeypair:operationalKeypair + operationalCertificate:operationalCertificate + intermediateCertificate:intermediateCertificate + rootCertificate:rootCertificate]; +} +@end + @implementation MTRDeviceControllerStartupParamsInternal - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params @@ -182,6 +317,9 @@ - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params return nil; } + _storageDelegate = nil; + _storageDelegateQueue = nil; + if (self.nocSigner == nil && self.rootCertificate == nil) { MTR_LOG_ERROR("nocSigner and rootCertificate are both nil; no public key available to identify the fabric"); return nil; @@ -249,6 +387,7 @@ - (instancetype)initForNewFabric:(chip::FabricTable *)fabricTable _fabricTable = fabricTable; _keystore = keystore; _advertiseOperational = advertiseOperational; + _allowMultipleControllersPerFabric = NO; return self; } @@ -379,6 +518,89 @@ - (instancetype)initForExistingFabric:(FabricTable *)fabricTable _fabricIndex.Emplace(fabricIndex); _keystore = keystore; _advertiseOperational = advertiseOperational; + _allowMultipleControllersPerFabric = NO; + + return self; +} + +- (instancetype)initForNewController:(MTRDeviceController *)controller + fabricTable:(chip::FabricTable *)fabricTable + keystore:(chip::Crypto::OperationalKeystore *)keystore + advertiseOperational:(BOOL)advertiseOperational + params:(MTRDeviceControllerStartupParameters *)params + error:(CHIP_ERROR &)error +{ + if (!(self = [super initWithParameters:params error:error])) { + return nil; + } + + Crypto::P256PublicKey pubKey; + error = ExtractPubkeyFromX509Cert(AsByteSpan(self.rootCertificate), pubKey); + if (error != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Can't extract public key from root certificate: %s", error.AsString()); + return nil; + } + + NSNumber * nodeID; + error = ExtractNodeIDFromNOC(self.operationalCertificate, &nodeID); + if (error != CHIP_NO_ERROR) { + // Already logged. + return nil; + } + + if (fabricTable->FindIdentity(pubKey, self.fabricID.unsignedLongLongValue, nodeID.unsignedLongLongValue)) { + MTR_LOG_ERROR("Trying to start a controller identity that is already running"); + error = CHIP_ERROR_INVALID_ARGUMENT; + return nil; + } + + auto * oldNOCTLV = [controller.controllerDataStore fetchLastLocallyUsedNOC]; + if (oldNOCTLV != nil) { + ByteSpan oldNOCSpan = AsByteSpan(oldNOCTLV); + + FabricId ignored = kUndefinedFabricId; + NodeId oldNodeID = kUndefinedNodeId; + CHIP_ERROR err = Credentials::ExtractNodeIdFabricIdFromOpCert(oldNOCSpan, &oldNodeID, &ignored); + if (err != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Unable to extract node ID and fabric ID from old operational certificate: %s", err.AsString()); + return nil; + } + + CATValues oldCATs; + err = Credentials::ExtractCATsFromOpCert(oldNOCSpan, oldCATs); + if (err != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Failed to extract CATs from old operational certificate: %s", err.AsString()); + return nil; + } + + auto * tlvNOC = [MTRCertificates convertX509Certificate:self.operationalCertificate]; + if (tlvNOC == nil) { + return nil; + } + + ByteSpan nocSpan = AsByteSpan(tlvNOC); + CATValues newCATs; + err = Credentials::ExtractCATsFromOpCert(nocSpan, newCATs); + if (err != CHIP_NO_ERROR) { + MTR_LOG_ERROR("Failed to extract CATs from new operational certificate: %s", err.AsString()); + return nil; + } + + if (nodeID.unsignedLongLongValue != oldNodeID || oldCATs != newCATs) { + // Our NOC has changed in a way that would affect ACL checks. Clear + // out our session resumption storage, because resuming those CASE + // sessions will end up doing ACL checks against our old NOC. + MTR_LOG_DEFAULT("Node ID or CATs changed. Clearing CASE resumption storage."); + [controller.controllerDataStore clearAllResumptionInfo]; + } + } + + _fabricTable = fabricTable; + _keystore = keystore; + _advertiseOperational = advertiseOperational; + _allowMultipleControllersPerFabric = YES; + _storageDelegate = params.storageDelegate; + _storageDelegateQueue = params.storageDelegateQueue; return self; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 24acc7a2dbb3a8..53cec273ebdc52 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -19,6 +19,8 @@ #import "MTRDeviceControllerStartupParams.h" #import #import +#import +#import #include #include @@ -39,18 +41,52 @@ NS_ASSUME_NONNULL_BEGIN // MTRDeviceControllerStartupParamsInternal. @property (nonatomic, copy, nullable) MTRCertificateDERBytes operationalCertificate; +// uniqueIdentifier, so that we always have one. +@property (nonatomic, strong, readonly) NSUUID * uniqueIdentifier; + // Init method that just copies the values of all our ivars. - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params; @end +@interface MTRDeviceControllerStartupParameters () + +- (instancetype)initWithStorageDelegate:(id)storageDelegate + storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + ipk:(NSData *)ipk + vendorID:(NSNumber *)vendorID + operationalKeypair:(id)operationalKeypair + operationalCertificate:(MTRCertificateDERBytes)operationalCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + rootCertificate:(MTRCertificateDERBytes)rootCertificate; + +// When we have other subclasses of MTRDeviceControllerStartupParameters, we may +// need to make more things nullable here and/or add more fields. But for now +// we know exactly what information we have. +@property (nonatomic, copy, readonly) NSData * ipk; +@property (nonatomic, copy, readonly) NSNumber * vendorID; +@property (nonatomic, copy, readonly) MTRCertificateDERBytes rootCertificate; +@property (nonatomic, copy, readonly, nullable) MTRCertificateDERBytes intermediateCertificate; +@property (nonatomic, copy, readonly) MTRCertificateDERBytes operationalCertificate; +@property (nonatomic, strong, readonly) id operationalKeypair; + +@property (nonatomic, strong, nullable, readonly) id operationalCertificateIssuer; +@property (nonatomic, strong, nullable, readonly) dispatch_queue_t operationalCertificateIssuerQueue; + +@property (nonatomic, strong, readonly) id storageDelegate; +@property (nonatomic, strong, readonly) dispatch_queue_t storageDelegateQueue; +@property (nonatomic, strong, readonly) NSUUID * uniqueIdentifier; + +@end + MTR_HIDDEN @interface MTRDeviceControllerStartupParamsInternal : MTRDeviceControllerStartupParams // Fabric table we can use to do things like allocate operational keys. @property (nonatomic, assign, readonly) chip::FabricTable * fabricTable; -// Fabric index we're starting on. Only has a value when starting on an -// existing fabric. +// Fabric index we're starting on. Only has a value when starting against an +// existing fabric table entry. @property (nonatomic, assign, readonly) chip::Optional fabricIndex; // Key store we're using with our fabric table, for sanity checks. @@ -58,6 +94,21 @@ MTR_HIDDEN @property (nonatomic, assign, readonly) BOOL advertiseOperational; +@property (nonatomic, assign, readonly) BOOL allowMultipleControllersPerFabric; + +/** + * A storage delegate that can be provided when initializing the startup params. + * This must be provided if and only if the controller factory was initialized + * without storage. + */ +@property (nonatomic, strong, nullable, readonly) id storageDelegate; + +/** + * The queue to use for storageDelegate. This will be nil if and only if + * storageDelegate is nil. + */ +@property (nonatomic, strong, nullable, readonly) dispatch_queue_t storageDelegateQueue; + /** * Helper method that checks that our keypairs match our certificates. * Specifically: @@ -90,7 +141,17 @@ MTR_HIDDEN params:(MTRDeviceControllerStartupParams *)params; /** - * Should use initForExistingFabric or initForNewFabric to initialize + * Initialize for controller bringup with per-controller storage. + */ +- (instancetype)initForNewController:(MTRDeviceController *)controller + fabricTable:(chip::FabricTable *)fabricTable + keystore:(chip::Crypto::OperationalKeystore *)keystore + advertiseOperational:(BOOL)advertiseOperational + params:(MTRDeviceControllerStartupParameters *)params + error:(CHIP_ERROR &)error; + +/** + * Should use initForExistingFabric or initForNewFabric or initForController to initialize * internally. */ - (instancetype)initWithIPK:(NSData *)ipk fabricID:(NSNumber *)fabricID nocSigner:(id)nocSigner NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h new file mode 100644 index 00000000000000..1fee9c65ae460c --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2023 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 +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, MTRStorageSecurityLevel) { + // Data must be stored in secure (encrypted) storage. + MTRStorageSecurityLevelSecure, + // Data may be stored in the clear. + MTRStorageSecurityLevelNotSecure, +} MTR_NEWLY_AVAILABLE; + +typedef NS_ENUM(NSUInteger, MTRStorageSharingType) { + // Data must not be shared at all (just store locally). + MTRStorageSharingTypeNotShared, + + // Data must be shared, but only between controllers that have the same node + // identity (same fabric, same node ID, same CATs). + MTRStorageSharingTypeSameIdentity, + + // Data must be shared, but only between controllers that have the same + // access to devices (e.g. controllers that all have the same CATs if ACLs + // are being done via CATs). + MTRStorageSharingTypeSameACLs, + + // Data must be shared across all controllers on a given fabric. + MTRStorageSharingTypeSameFabric, +} MTR_NEWLY_AVAILABLE; + +/** + * Protocol for storing and retrieving controller-specific data. + * + * Implementations of this protocol MUST keep two things in mind: + * + * 1) The controller provided to the delegate methods may not be fully + * initialized when the callbacks are called. The only safe thing to do with + * it is to get its controllerID. + * + * 2) The delegate method calls will happen on the queue that was provided along + * with the delegate. All Matter work will be blocked until the method + * completes, and these calls may themselves block other Matter API calls + * from completing. Attempting to call any Matter API on the queue used for + * this delegate, apart from de-serializing and serializing the items being + * stored and calling MTRDeviceControllerStorageClasses(), is likely to lead + * to deadlocks. + */ +MTR_NEWLY_AVAILABLE +@protocol MTRDeviceControllerStorageDelegate +@required +/** + * Return the stored value for the given key, if any, for the provided + * controller. Returns nil if there is no stored value. + * + * securityLevel and dataType will always be the same for any given key value + * and are just present here to help locate the data if storage location is + * separated out by security level and data type. + * + * The set of classes that might be decoded by this function is available by + * calling MTRDeviceControllerStorageClasses(). + */ +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; + +/** + * Store a value for the given key. Returns whether the store succeeded. + * + * securityLevel and dataType will always be the same for any given key value + * and are present here as a hint to how the value should be stored. + */ +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; + +/** + * Remove the stored value for the given key. Returns whether the remove succeeded. + * + * securityLevel and dataType will always be the same for any given key value + * and are just present here to help locate the data if storage location is + * separated out by security level and data type. + */ +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +@end + +// TODO: FIXME: Is this a sane place to put this API? +MTR_EXTERN MTR_NEWLY_AVAILABLE NSSet * MTRDeviceControllerStorageClasses(void); + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 28beb9b8244a13..89db3a9f951d3e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -29,6 +29,10 @@ #import "MTRBaseDevice.h" #import "MTRDeviceController.h" +#import "MTRDeviceControllerDataStore.h" +#import "MTRDeviceControllerStorageDelegate.h" + +#import @class MTRDeviceControllerStartupParamsInternal; @class MTRDeviceControllerFactory; @@ -73,12 +77,21 @@ NS_ASSUME_NONNULL_BEGIN */ @property (readonly, nullable) NSNumber * compressedFabricID; +/** + * The per-controller data store this controller was initialized with, if any. + */ +@property (nonatomic, nullable) MTRDeviceControllerDataStore * controllerDataStore; + /** * Init a newly created controller. * * Only MTRDeviceControllerFactory should be calling this. */ -- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory queue:(dispatch_queue_t)queue; +- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory + queue:(dispatch_queue_t)queue + storageDelegate:(id _Nullable)storageDelegate + storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier; /** * Check whether this controller is running on the given fabric, as represented diff --git a/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.h b/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.h new file mode 100644 index 00000000000000..389fcc2a9eba10 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.h @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2023 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 +#import + +#import "MTRDeviceControllerDataStore.h" + +#include + +NS_ASSUME_NONNULL_BEGIN + +/** + * Implements SessionResumptionStorage and dispatches the relevant lookup + * requests to running controllers as needed. + */ +class MTRSessionResumptionStorageBridge : public chip::SessionResumptionStorage +{ +public: + MTRSessionResumptionStorageBridge(MTRDeviceControllerFactory * factory); + + ~MTRSessionResumptionStorageBridge() {} + + // SessionResumptionStorage API. + CHIP_ERROR FindByScopedNodeId(const chip::ScopedNodeId & node, ResumptionIdStorage & resumptionId, + chip::Crypto::P256ECDHDerivedSecret & sharedSecret, chip::CATValues & peerCATs) override; + + CHIP_ERROR FindByResumptionId(ConstResumptionIdView resumptionId, chip::ScopedNodeId & node, + chip::Crypto::P256ECDHDerivedSecret & sharedSecret, chip::CATValues & peerCATs) override; + CHIP_ERROR Save(const chip::ScopedNodeId & node, ConstResumptionIdView resumptionId, + const chip::Crypto::P256ECDHDerivedSecret & sharedSecret, const chip::CATValues & peerCATs) override; + CHIP_ERROR DeleteAll(chip::FabricIndex fabricIndex) override; + +private: + /** + * Helper method to convert a MTRCASESessionResumptionInfo into the pieces + * we need to return from our Find* methods. + */ + static CHIP_ERROR DeconstructResumptionInfo(MTRCASESessionResumptionInfo * resumptionInfo, chip::NodeId & nodeID, + ResumptionIdStorage & resumptionId, + chip::Crypto::P256ECDHDerivedSecret & sharedSecret, chip::CATValues & peerCATs); + + MTRDeviceControllerFactory * mFactory; +}; + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.mm b/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.mm new file mode 100644 index 00000000000000..56fe7bc7beb6f8 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRSessionResumptionStorageBridge.mm @@ -0,0 +1,149 @@ +/** + * Copyright (c) 2023 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 "MTRSessionResumptionStorageBridge.h" + +#import "MTRConversion.h" +#import "MTRDeviceControllerFactory_Internal.h" +#import "MTRDeviceController_Internal.h" +#import "MTRLogging_Internal.h" +#import "NSDataSpanConversion.h" + +#include + +using namespace chip; + +MTRSessionResumptionStorageBridge::MTRSessionResumptionStorageBridge(MTRDeviceControllerFactory * factory) + : mFactory(factory) +{ +} + +CHIP_ERROR MTRSessionResumptionStorageBridge::FindByScopedNodeId(const chip::ScopedNodeId & node, + ResumptionIdStorage & resumptionId, chip::Crypto::P256ECDHDerivedSecret & sharedSecret, chip::CATValues & peerCATs) +{ + assertChipStackLockedByCurrentThread(); + + auto * controller = [mFactory runningControllerForFabricIndex:node.GetFabricIndex()]; + if (controller == nil) { + return CHIP_ERROR_KEY_NOT_FOUND; + } + + auto * resumptionInfo = [controller.controllerDataStore findResumptionInfoByNodeID:@(node.GetNodeId())]; + if (resumptionInfo == nil) { + return CHIP_ERROR_KEY_NOT_FOUND; + } + + NodeId ignored; + return DeconstructResumptionInfo(resumptionInfo, ignored, resumptionId, sharedSecret, peerCATs); +} + +CHIP_ERROR MTRSessionResumptionStorageBridge::FindByResumptionId(ConstResumptionIdView resumptionId, chip::ScopedNodeId & node, + chip::Crypto::P256ECDHDerivedSecret & sharedSecret, chip::CATValues & peerCATs) +{ + assertChipStackLockedByCurrentThread(); + + auto * resumptionIDData = AsData(resumptionId); + + auto * controllerList = [mFactory getRunningControllers]; + for (MTRDeviceController * controller in controllerList) { + FabricIndex fabricIndex = controller.fabricIndex; + if (!IsValidFabricIndex(fabricIndex)) { + // This controller is not sufficiently "running"; it does not have a + // fabric index yet. Just skip it. + continue; + } + + auto * resumptionInfo = [controller.controllerDataStore findResumptionInfoByResumptionID:resumptionIDData]; + if (resumptionInfo != nil) { + NodeId nodeID; + ResumptionIdStorage ignored; + ReturnErrorOnFailure(DeconstructResumptionInfo(resumptionInfo, nodeID, ignored, sharedSecret, peerCATs)); + node = ScopedNodeId(nodeID, fabricIndex); + return CHIP_NO_ERROR; + } + } + + // None of the controllers matched. + return CHIP_ERROR_KEY_NOT_FOUND; +} + +CHIP_ERROR MTRSessionResumptionStorageBridge::Save(const chip::ScopedNodeId & node, ConstResumptionIdView resumptionId, + const chip::Crypto::P256ECDHDerivedSecret & sharedSecret, const chip::CATValues & peerCATs) +{ + assertChipStackLockedByCurrentThread(); + + auto * controller = [mFactory runningControllerForFabricIndex:node.GetFabricIndex()]; + if (controller == nil) { + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + auto * resumptionInfo = [[MTRCASESessionResumptionInfo alloc] init]; + resumptionInfo.nodeID = @(node.GetNodeId()); + resumptionInfo.resumptionID = AsData(resumptionId); + resumptionInfo.sharedSecret = AsData(ByteSpan(sharedSecret.ConstBytes(), sharedSecret.Length())); + resumptionInfo.caseAuthenticatedTags = CATValuesToSet(peerCATs); + + [controller.controllerDataStore storeResumptionInfo:resumptionInfo]; + return CHIP_NO_ERROR; +} + +CHIP_ERROR MTRSessionResumptionStorageBridge::DeleteAll(chip::FabricIndex fabricIndex) +{ + assertChipStackLockedByCurrentThread(); + + // NOTE: During controller startup, the Matter SDK thinks that the cert for + // a fabric index is changing and hence that it must remove session + // resumption data for that fabric index. For us that does not matter, + // since we don't key that data on fabric index anyway. But we do want to + // avoid doing this delete-on-startup so we can actually store session + // resumption data persistently. + + // And that is the only use of DeleteAll for controllers in practice, in the + // situations where we are using MTRSessionResumptionStorageBridge at all. + // So just no-op this function, but verify that our assumptions hold. + auto * controller = [mFactory runningControllerForFabricIndex:fabricIndex + includeControllerStartingUp:NO + includeControllerShuttingDown:YES]; + VerifyOrDieWithMsg(controller == nil, Controller, "Deleting resumption storage for controller outside startup"); + return CHIP_NO_ERROR; +} + +CHIP_ERROR MTRSessionResumptionStorageBridge::DeconstructResumptionInfo(MTRCASESessionResumptionInfo * resumptionInfo, + chip::NodeId & nodeID, ResumptionIdStorage & resumptionId, chip::Crypto::P256ECDHDerivedSecret & sharedSecret, + chip::CATValues & peerCATs) +{ + if (resumptionInfo.resumptionID.length != resumptionId.size()) { + MTR_LOG_ERROR("Unable to return resumption ID: Stored size %llu does not match required size %llu", + static_cast(resumptionInfo.resumptionID.length), + static_cast(resumptionId.size())); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + if (resumptionInfo.sharedSecret.length > sharedSecret.Capacity()) { + MTR_LOG_ERROR("Unable to return resumption shared secret: Stored size %llu is larger than allowed size %llu", + static_cast(resumptionInfo.sharedSecret.length), + static_cast(sharedSecret.Capacity())); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } + + nodeID = resumptionInfo.nodeID.unsignedLongLongValue; + memcpy(resumptionId.data(), resumptionInfo.resumptionID.bytes, resumptionInfo.resumptionID.length); + sharedSecret.SetLength(resumptionInfo.sharedSecret.length); + memcpy(sharedSecret.Bytes(), resumptionInfo.sharedSecret.bytes, resumptionInfo.sharedSecret.length); + ReturnErrorOnFailure(SetToCATValues(resumptionInfo.caseAuthenticatedTags, peerCATs)); + + return CHIP_NO_ERROR; +} diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 9a5ce73864f2c2..26c74cd80487d2 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -40,7 +40,9 @@ #import #import #import +#import #import +#import #import #import #import diff --git a/src/darwin/Framework/CHIPTests/MTRControllerTests.m b/src/darwin/Framework/CHIPTests/MTRControllerTests.m index e7a18bcb13804f..63a5baf32b64d5 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerTests.m @@ -1524,8 +1524,6 @@ - (void)testControllerCATs [controller shutdown]; XCTAssertFalse([controller isRunning]); - fprintf(stderr, "DOING TOO LONG TEST\n"); - // // Trying to bring up the same fabric with too-long CATs should fail, if we // are taking the provided CATs into account. @@ -1536,8 +1534,6 @@ - (void)testControllerCATs controller = [factory createControllerOnExistingFabric:params error:nil]; XCTAssertNil(controller); - fprintf(stderr, "DOING INVALID TEST\n"); - // // Trying to bring up the same fabric with invalid CATs should fail, if we // are taking the provided CATs into account. @@ -1545,12 +1541,9 @@ - (void)testControllerCATs params.nodeID = @(17); params.operationalKeypair = operationalKeys; params.caseAuthenticatedTags = invalidCATs; - fprintf(stderr, "BRINGING UP CONTROLLER\n"); controller = [factory createControllerOnExistingFabric:params error:nil]; - fprintf(stderr, "CONTROLLER SHOULD BE NIL\n"); XCTAssertNil(controller); - fprintf(stderr, "STOPPING FACTORY\n"); [factory stopControllerFactory]; XCTAssertFalse([factory isRunning]); } diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m new file mode 100644 index 00000000000000..fdf03eab12ba36 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -0,0 +1,1124 @@ +/* + * Copyright (c) 2023 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 + +// system dependencies +#import + +#import "MTRErrorTestUtils.h" +#import "MTRFabricInfoChecker.h" +#import "MTRTestKeys.h" +#import "MTRTestResetCommissioneeHelper.h" +#import "MTRTestStorage.h" + +static const uint16_t kPairingTimeoutInSeconds = 10; +static const uint16_t kTimeoutInSeconds = 3; +static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; +static const uint16_t kLocalPort = 5541; +static const uint16_t kTestVendorId = 0xFFF1u; + +@interface MTRPerControllerStorageTestsControllerDelegate : NSObject +@property (nonatomic, strong) XCTestExpectation * expectation; +@property (nonatomic, strong) NSNumber * deviceID; +@end + +@implementation MTRPerControllerStorageTestsControllerDelegate +- (id)initWithExpectation:(XCTestExpectation *)expectation newNodeID:(NSNumber *)newNodeID +{ + self = [super init]; + if (self) { + _expectation = expectation; + _deviceID = newNodeID; + } + return self; +} + +- (void)controller:(MTRDeviceController *)controller commissioningSessionEstablishmentDone:(NSError *)error +{ + XCTAssertEqual(error.code, 0); + + __auto_type * params = [[MTRCommissioningParameters alloc] init]; + + NSError * commissionError = nil; + [controller commissionNodeWithID:self.deviceID commissioningParams:params error:&commissionError]; + XCTAssertNil(commissionError); + + // Keep waiting for controller:commissioningComplete: +} + +- (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSError *)error +{ + XCTAssertEqual(error.code, 0); + [_expectation fulfill]; + _expectation = nil; +} + +@end + +@interface MTRPerControllerStorageTestsStorageDelegate : NSObject +@property (nonatomic, readonly) NSMutableDictionary * storage; +@property (nonatomic, readonly) NSUUID * controllerID; +@end + +@implementation MTRPerControllerStorageTestsStorageDelegate + +- (instancetype)initWithControllerID:(NSUUID *)controllerID +{ + if (!(self = [super init])) { + return nil; + } + + _storage = [[NSMutableDictionary alloc] init]; + _controllerID = controllerID; + return self; +} + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + + __auto_type * data = self.storage[key]; + if (data == nil) { + return data; + } + + NSError * error; + id value = [NSKeyedUnarchiver unarchivedObjectOfClasses:MTRDeviceControllerStorageClasses() fromData:data error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(data); + + return value; +} + +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + + NSError * error; + NSData * data = [NSKeyedArchiver archivedDataWithRootObject:value requiringSecureCoding:YES error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(data); + + self.storage[key] = data; + return YES; +} + +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + self.storage[key] = nil; + return YES; +} + +@end + +@interface MTRPerControllerStorageTestsCertificateIssuer : NSObject +- (instancetype)initWithRootCertificate:(MTRCertificateDERBytes)rootCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + signingKey:(id)signingKey + fabricID:(NSNumber *)fabricID; + +@property (nonatomic, readonly) MTRCertificateDERBytes rootCertificate; +@property (nonatomic, readonly, nullable) MTRCertificateDERBytes intermediateCertificate; +@property (nonatomic, readonly) id signingKey; +@property (nonatomic, readonly) NSNumber * fabricID; + +// The node ID to use for the next operational certificate we issue. This will +// be set to null after every certificate issuance. +@property (nonatomic, nullable) NSNumber * nextNodeID; + +@property (nonatomic, readonly) BOOL shouldSkipAttestationCertificateValidation; + +@end + +@implementation MTRPerControllerStorageTestsCertificateIssuer + +- (instancetype)initWithRootCertificate:(MTRCertificateDERBytes)rootCertificate + intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate + signingKey:(id)signingKey + fabricID:(NSNumber *)fabricID +{ + if (!(self = [super init])) { + return nil; + } + + _rootCertificate = rootCertificate; + _intermediateCertificate = intermediateCertificate; + _signingKey = signingKey; + _fabricID = fabricID; + _nextNodeID = nil; + _shouldSkipAttestationCertificateValidation = NO; + + return self; +} + +- (void)issueOperationalCertificateForRequest:(MTROperationalCSRInfo *)csrInfo + attestationInfo:(MTRDeviceAttestationInfo *)attestationInfo + controller:(MTRDeviceController *)controller + completion:(void (^)(MTROperationalCertificateChain * _Nullable info, + NSError * _Nullable error))completion +{ + if (self.nextNodeID == nil) { + completion(nil, [NSError errorWithDomain:@"TestError" code:0 userInfo:@{ @"reason" : @"nextNodeID is nil" }]); + return; + } + + MTRCertificateDERBytes signingCertificate; + if (self.intermediateCertificate != nil) { + signingCertificate = self.intermediateCertificate; + } else { + signingCertificate = self.rootCertificate; + } + + __auto_type * csr = csrInfo.csr; + XCTAssertNotNil(csr); + + NSError * error; + __auto_type * rawPublicKey = [MTRCertificates publicKeyFromCSR:csr error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(rawPublicKey); + + if (error != nil) { + completion(nil, error); + return; + } + + NSDictionary * attributes = @{ + (__bridge NSString *) kSecAttrKeyType : (__bridge NSString *) kSecAttrKeyTypeECSECPrimeRandom, + (__bridge NSString *) kSecAttrKeyClass : (__bridge NSString *) kSecAttrKeyClassPublic + }; + CFErrorRef keyCreationError = NULL; + SecKeyRef publicKey + = SecKeyCreateWithData((__bridge CFDataRef) rawPublicKey, (__bridge CFDictionaryRef) attributes, &keyCreationError); + XCTAssertNil((__bridge id) keyCreationError); + XCTAssertNotNil((__bridge id) publicKey); + + __auto_type * operationalCert = [MTRCertificates createOperationalCertificate:self.signingKey + signingCertificate:signingCertificate + operationalPublicKey:publicKey + fabricID:self.fabricID + nodeID:self.nextNodeID + caseAuthenticatedTags:nil + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(operationalCert); + + if (error != nil) { + completion(nil, error); + return; + } + + __auto_type * certChain = [[MTROperationalCertificateChain alloc] initWithOperationalCertificate:operationalCert + intermediateCertificate:self.intermediateCertificate + rootCertificate:self.rootCertificate + adminSubject:nil]; + completion(certChain, nil); +} + +@end + +@interface MTRPerControllerStorageTests : XCTestCase +@end + +@implementation MTRPerControllerStorageTests { + dispatch_queue_t _storageQueue; +} + ++ (void)tearDown +{ +} + +- (void)setUp +{ + // Per-test setup, runs before each test. + [super setUp]; + [self setContinueAfterFailure:NO]; + + _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + + [self startFactory]; +} + +- (void)tearDown +{ + // Per-test teardown, runs after each test. + [self stopFactory]; + _storageQueue = nil; + [super tearDown]; +} + +- (void)startFactory +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; + factoryParams.port = @(kLocalPort); + + NSError * error; + BOOL ok = [factory startControllerFactory:factoryParams error:&error]; + XCTAssertNil(error); + XCTAssertTrue(ok); +} + +- (void)stopFactory +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + [factory stopControllerFactory]; + XCTAssertFalse(factory.isRunning); +} + +// Test helpers + +- (void)commissionWithController:(MTRDeviceController *)controller newNodeID:(NSNumber *)newNodeID +{ + XCTestExpectation * expectation = [self expectationWithDescription:@"Pairing Complete"]; + + __auto_type * deviceControllerDelegate = [[MTRPerControllerStorageTestsControllerDelegate alloc] initWithExpectation:expectation + newNodeID:newNodeID]; + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.device_controller_delegate", DISPATCH_QUEUE_SERIAL); + + [controller setDeviceControllerDelegate:deviceControllerDelegate queue:callbackQueue]; + + NSError * error; + __auto_type * payload = [MTRSetupPayload setupPayloadWithOnboardingPayload:kOnboardingPayload error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(payload); + + [controller setupCommissioningSessionWithPayload:payload newNodeID:newNodeID error:&error]; + XCTAssertNil(error); + + [self waitForExpectations:@[ expectation ] timeout:kPairingTimeoutInSeconds]; +} + +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + caseAuthenticatedTags:(nullable NSSet *)caseAuthenticatedTags + error:(NSError * __autoreleasing *)error + certificateIssuer: + (MTRPerControllerStorageTestsCertificateIssuer * __autoreleasing *)certificateIssuer +{ + XCTAssertTrue(error != NULL); + + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + // Specify a fixed issuerID, so we get the same cert if we use the same keys. + __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; + XCTAssertNil(*error); + XCTAssertNotNil(root); + + __auto_type * operational = [MTRCertificates createOperationalCertificate:rootKeys + signingCertificate:root + operationalPublicKey:operationalKeys.publicKey + fabricID:fabricID + nodeID:nodeID + caseAuthenticatedTags:caseAuthenticatedTags + error:error]; + XCTAssertNil(*error); + XCTAssertNotNil(operational); + + __auto_type * params = + [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; + XCTAssertNotNil(params); + + __auto_type * ourCertificateIssuer = [[MTRPerControllerStorageTestsCertificateIssuer alloc] initWithRootCertificate:root + intermediateCertificate:nil + signingKey:rootKeys + fabricID:fabricID]; + XCTAssertNotNil(ourCertificateIssuer); + + if (certificateIssuer) { + *certificateIssuer = ourCertificateIssuer; + } + + [params setOperationalCertificateIssuer:ourCertificateIssuer queue:dispatch_get_main_queue()]; + + return [factory createController:params error:error]; +} + +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + error:(NSError * __autoreleasing *)error + certificateIssuer: + (MTRPerControllerStorageTestsCertificateIssuer * __autoreleasing *)certificateIssuer +{ + return [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storage + caseAuthenticatedTags:nil + error:error + certificateIssuer:certificateIssuer]; +} + +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + caseAuthenticatedTags:(nullable NSSet *)caseAuthenticatedTags + error:(NSError * __autoreleasing *)error +{ + return [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storage + caseAuthenticatedTags:caseAuthenticatedTags + error:error + certificateIssuer:nil]; +} + +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + error:(NSError * __autoreleasing *)error +{ + return [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storage + error:error + certificateIssuer:nil]; +} + +- (void)test001_BasicControllerStartup +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * nodeID = @(123); + NSNumber * fabricID = @(456); + + NSError * error; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + // This was the first controller we brought up, so it should have come up + // with fabric index 1. + __auto_type * fabricInfoList = factory.knownFabrics; + CheckFabricInfo(fabricInfoList, [NSMutableSet setWithArray:@[ + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID, + @"nodeID" : nodeID, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(1), + }, + ]]); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test002_TryStartingTwoControllersWithSameNodeID +{ + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * nodeID = @(123); + NSNumber * fabricID = @(456); + + NSError * error; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + // Try to bring up another controller with the same identity. This should + // fail, since our controller is still running + MTRDeviceController * otherController = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error]; + XCTAssertNil(otherController); + XCTAssertNotNil(error); + + // Our controller should still be running. + XCTAssertTrue([controller isRunning]); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test003_TestTwoControllersSameUUID +{ + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + XCTAssertEqual(operationalKeys.signatureCount, 0); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * fabricID = @(456); + + NSNumber * nodeID1 = @(123); + + NSError * error; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID1 + storage:storageDelegate + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID1); + + // Try to bring up another controller with the same uniqueIdentifier (but a different + // node identity). This should fail, since our controller is still running. + NSNumber * nodeID2 = @(789); + MTRDeviceController * otherController = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID2 + storage:storageDelegate + error:&error]; + XCTAssertNil(otherController); + XCTAssertNotNil(error); + + // Our controller should still be running. + XCTAssertTrue([controller isRunning]); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test004_TestBasicSessionResumption +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type queue = dispatch_get_main_queue(); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + XCTAssertEqual(operationalKeys.signatureCount, 0); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * nodeID = @(123); + NSNumber * fabricID = @(456); + + NSError * error; + MTRPerControllerStorageTestsCertificateIssuer * certificateIssuer; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error + certificateIssuer:&certificateIssuer]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + // Now commission the device, to test that that works. + NSNumber * deviceID = @(17); + certificateIssuer.nextNodeID = deviceID; + [self commissionWithController:controller newNodeID:deviceID]; + + // We should have established CASE using our operational key. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); + + // Start the controller again using the same identity. This should work, + // because we cleared out the fabric info when the controller shut down. + controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + // Now we should have come up with fabric index 2. + __auto_type * fabricInfoList = factory.knownFabrics; + CheckFabricInfo(fabricInfoList, [NSMutableSet setWithArray:@[ + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID, + @"nodeID" : nodeID, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(2), + }, + ]]); + + // Try sending an attribute read and make sure it works. + __auto_type * device = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + __auto_type * onOffCluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:queue]; + __auto_type * readExpectation = [self expectationWithDescription:@"Read OnOff attribute"]; + [onOffCluster readAttributeOnOffWithCompletion:^(NSNumber * value, NSError * _Nullable error) { + XCTAssertNil(error); + // We expect the device to be off. + XCTAssertEqualObjects(value, @(0)); + [readExpectation fulfill]; + }]; + + [self waitForExpectations:@[ readExpectation ] timeout:kTimeoutInSeconds]; + + // We should have done CASE resumption, so not done any new signing using + // our keys. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + // Reset our commissionee. + ResetCommissionee(device, queue, self, kTimeoutInSeconds); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test005_TestSessionResumptionDataClearingNodeIDChanged +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type queue = dispatch_get_main_queue(); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + XCTAssertEqual(operationalKeys.signatureCount, 0); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * nodeID1 = @(123); + NSNumber * nodeID2 = @(246); + NSNumber * fabricID = @(456); + + NSError * error; + MTRPerControllerStorageTestsCertificateIssuer * certificateIssuer; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID1 + storage:storageDelegate + error:&error + certificateIssuer:&certificateIssuer]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID1); + + NSNumber * deviceID = @(17); + certificateIssuer.nextNodeID = deviceID; + [self commissionWithController:controller newNodeID:deviceID]; + + // We should have established CASE using our operational key. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + __auto_type * device1 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + + // Now change ACLs so that nodeID2 has access and nodeID1 does not. + __auto_type * admin = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init]; + admin.privilege = @(MTRAccessControlEntryPrivilegeAdminister); + admin.authMode = @(MTRAccessControlEntryAuthModeCASE); + admin.subjects = @[ nodeID2 ]; + + __auto_type * aclCluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device1 endpointID:@(0) queue:queue]; + + XCTestExpectation * aclWriteExpectation = [self expectationWithDescription:@"ACLs changed so new node ID can administer"]; + [aclCluster writeAttributeACLWithValue:@[ admin ] + completion:^(NSError * _Nullable err) { + XCTAssertNil(err); + [aclWriteExpectation fulfill]; + }]; + + [self waitForExpectations:@[ aclWriteExpectation ] timeout:kTimeoutInSeconds]; + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); + + // There should have been no more CASE establishment going on. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + // Bring up a controller with the same storage and keys and so on but nodeID2. + controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID2 + storage:storageDelegate + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID2); + + // Try sending an attribute read and make sure it works. + __auto_type * device2 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + __auto_type * onOffCluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device2 endpointID:@(1) queue:queue]; + __auto_type * readExpectation = [self expectationWithDescription:@"Read OnOff attribute"]; + [onOffCluster readAttributeOnOffWithCompletion:^(NSNumber * value, NSError * _Nullable error) { + XCTAssertNil(error); + // We expect the device to be off. + XCTAssertEqualObjects(value, @(0)); + [readExpectation fulfill]; + }]; + + [self waitForExpectations:@[ readExpectation ] timeout:kTimeoutInSeconds]; + + // We should note have done CASE resumption, since our identity changed. + XCTAssertEqual(operationalKeys.signatureCount, 2); + + // Reset our commissionee. + ResetCommissionee(device2, queue, self, kTimeoutInSeconds); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test006_TestSessionResumptionDataClearingCATsChanged +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type queue = dispatch_get_main_queue(); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + XCTAssertEqual(operationalKeys.signatureCount, 0); + + __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + NSNumber * nodeID = @(123); + NSNumber * fabricID = @(456); + + NSError * error; + MTRPerControllerStorageTestsCertificateIssuer * certificateIssuer; + MTRDeviceController * controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + error:&error + certificateIssuer:&certificateIssuer]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + NSNumber * deviceID = @(17); + certificateIssuer.nextNodeID = deviceID; + [self commissionWithController:controller newNodeID:deviceID]; + + // We should have established CASE using our operational key. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + __auto_type * device1 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + + // Now change ACLs so that CAT 0x12340001 has access and nodeID does not. + uint32_t cat = 0x12340001; + NSNumber * catSubject = @(0xFFFFFFFD00000000 | cat); + __auto_type * admin = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init]; + admin.privilege = @(MTRAccessControlEntryPrivilegeAdminister); + admin.authMode = @(MTRAccessControlEntryAuthModeCASE); + admin.subjects = @[ catSubject ]; + + __auto_type * aclCluster = [[MTRBaseClusterAccessControl alloc] initWithDevice:device1 endpointID:@(0) queue:queue]; + + XCTestExpectation * aclWriteExpectation = [self expectationWithDescription:@"ACLs changed so new node ID can administer"]; + [aclCluster writeAttributeACLWithValue:@[ admin ] + completion:^(NSError * _Nullable err) { + XCTAssertNil(err); + [aclWriteExpectation fulfill]; + }]; + + [self waitForExpectations:@[ aclWriteExpectation ] timeout:kTimeoutInSeconds]; + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); + + // There should have been no more CASE establishment going on. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + // Bring up a controller with the same storage and keys and so on but using + // our new CAT + controller = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID + storage:storageDelegate + caseAuthenticatedTags:[NSSet setWithArray:@[ @(cat) ]] + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller); + XCTAssertTrue([controller isRunning]); + + XCTAssertEqualObjects(controller.controllerNodeID, nodeID); + + // Try sending an attribute read and make sure it works. + __auto_type * device2 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller]; + __auto_type * onOffCluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device2 endpointID:@(1) queue:queue]; + __auto_type * readExpectation = [self expectationWithDescription:@"Read OnOff attribute"]; + [onOffCluster readAttributeOnOffWithCompletion:^(NSNumber * value, NSError * _Nullable error) { + XCTAssertNil(error); + // We expect the device to be off. + XCTAssertEqualObjects(value, @(0)); + [readExpectation fulfill]; + }]; + + [self waitForExpectations:@[ readExpectation ] timeout:kTimeoutInSeconds]; + + // We should note have done CASE resumption, since our CATs changed. + XCTAssertEqual(operationalKeys.signatureCount, 2); + + // Reset our commissionee. + ResetCommissionee(device2, queue, self, kTimeoutInSeconds); + + [controller shutdown]; + XCTAssertFalse([controller isRunning]); +} + +- (void)test007_TestMultipleControllers +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + XCTAssertEqual(operationalKeys.signatureCount, 0); + + NSNumber * nodeID1 = @(123); + NSNumber * nodeID2 = @(456); + NSNumber * fabricID1 = @(1); + NSNumber * fabricID2 = @(2); + + __auto_type * storageDelegate1 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + + // Start several controllers that have distinct identities but share some + // node/fabric IDs. + NSError * error; + MTRPerControllerStorageTestsCertificateIssuer * certificateIssuer; + MTRDeviceController * controller1 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID1 + nodeID:nodeID1 + storage:storageDelegate1 + error:&error + certificateIssuer:&certificateIssuer]; + XCTAssertNil(error); + XCTAssertNotNil(controller1); + XCTAssertTrue([controller1 isRunning]); + + __auto_type * storageDelegate2 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + MTRDeviceController * controller2 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID1 + nodeID:nodeID2 + storage:storageDelegate2 + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller2); + XCTAssertTrue([controller2 isRunning]); + + __auto_type * storageDelegate3 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + MTRDeviceController * controller3 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID2 + nodeID:nodeID1 + storage:storageDelegate3 + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller3); + XCTAssertTrue([controller3 isRunning]); + + // Now check our fabric table + __auto_type * fabricInfoList = factory.knownFabrics; + CheckFabricInfo(fabricInfoList, [NSMutableSet setWithArray:@[ + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID1, + @"nodeID" : nodeID1, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(1), + }, + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID1, + @"nodeID" : nodeID2, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(2), + }, + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID2, + @"nodeID" : nodeID1, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(3), + }, + ]]); + + // Restart controller2 + [controller2 shutdown]; + XCTAssertFalse([controller2 isRunning]); + controller2 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID1 + nodeID:nodeID2 + storage:storageDelegate2 + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller2); + XCTAssertTrue([controller2 isRunning]); + + // Now check our fabric table again. + fabricInfoList = factory.knownFabrics; + CheckFabricInfo(fabricInfoList, [NSMutableSet setWithArray:@[ + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID1, + @"nodeID" : nodeID1, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(1), + }, + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID1, + @"nodeID" : nodeID2, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(4), + }, + @{ + @"rootPublicKey" : rootKeys.publicKeyData, + @"vendorID" : @(kTestVendorId), + @"fabricID" : fabricID2, + @"nodeID" : nodeID1, + @"label" : @"", + @"hasIntermediateCertificate" : @(NO), + @"fabricIndex" : @(3), + }, + ]]); + + // Now commission the device from controller1 + NSNumber * deviceID = @(17); + certificateIssuer.nextNodeID = deviceID; + [self commissionWithController:controller1 newNodeID:deviceID]; + + // We should have established CASE using our operational key. + XCTAssertEqual(operationalKeys.signatureCount, 1); + + // Ensure that controller2 does not have the same node ID as controller1. + XCTAssertNotEqualObjects(controller1.controllerNodeID, controller2.controllerNodeID); + + __auto_type * device1 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller1]; + __auto_type * device2 = [MTRBaseDevice deviceWithNodeID:deviceID controller:controller2]; + + dispatch_queue_t queue = dispatch_get_main_queue(); + __auto_type * onOff1 = [[MTRBaseClusterOnOff alloc] initWithDevice:device1 endpointID:@(1) queue:queue]; + __auto_type * onOff2 = [[MTRBaseClusterOnOff alloc] initWithDevice:device2 endpointID:@(1) queue:queue]; + + // Check that device1 can read the On/Off attribute + XCTestExpectation * canReadExpectation1 = [self expectationWithDescription:@"Initial commissioner can read on/off"]; + [onOff1 readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + XCTAssertNil(err); + XCTAssertEqualObjects(value, @(0)); + [canReadExpectation1 fulfill]; + }]; + + [self waitForExpectations:@[ canReadExpectation1 ] timeout:kTimeoutInSeconds]; + + // Check that device2 cannot read the On/Off attribute due to missing ACLs. + XCTestExpectation * cantReadExpectation1 = [self expectationWithDescription:@"New node can't read on/off yet"]; + [onOff2 readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + XCTAssertNil(value); + XCTAssertNotNil(err); + XCTAssertEqual([MTRErrorTestUtils errorToZCLErrorCode:err], MTRInteractionErrorCodeUnsupportedAccess); + [cantReadExpectation1 fulfill]; + }]; + + [self waitForExpectations:@[ cantReadExpectation1 ] timeout:kTimeoutInSeconds]; + + // Now change ACLs so that device2 can read. + __auto_type * admin1 = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init]; + admin1.privilege = @(MTRAccessControlEntryPrivilegeAdminister); + admin1.authMode = @(MTRAccessControlEntryAuthModeCASE); + admin1.subjects = @[ controller1.controllerNodeID ]; + + __auto_type * admin2 = [[MTRAccessControlClusterAccessControlEntryStruct alloc] init]; + admin2.privilege = @(MTRAccessControlEntryPrivilegeAdminister); + admin2.authMode = @(MTRAccessControlEntryAuthModeCASE); + admin2.subjects = @[ controller2.controllerNodeID ]; + + __auto_type * acl1 = [[MTRBaseClusterAccessControl alloc] initWithDevice:device1 endpointID:@(0) queue:queue]; + + XCTestExpectation * let2ReadExpectation = [self expectationWithDescription:@"ACLs changed so new node can read"]; + [acl1 writeAttributeACLWithValue:@[ admin1, admin2 ] + completion:^(NSError * _Nullable err) { + XCTAssertNil(err); + [let2ReadExpectation fulfill]; + }]; + + [self waitForExpectations:@[ let2ReadExpectation ] timeout:kTimeoutInSeconds]; + + // Check that device2 can read the On/Off attribute + XCTestExpectation * canReadExpectation2 = [self expectationWithDescription:@"New node can read on/off"]; + [onOff2 readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + XCTAssertNil(err); + XCTAssertEqualObjects(value, @(0)); + [canReadExpectation2 fulfill]; + }]; + + [self waitForExpectations:@[ canReadExpectation2 ] timeout:kTimeoutInSeconds]; + + // Check that device1 can still read the On/Off attribute + XCTestExpectation * canReadExpectation3 = [self expectationWithDescription:@"Initial commissioner can still read on/off"]; + [onOff1 readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + XCTAssertNil(err); + XCTAssertEqualObjects(value, @(0)); + [canReadExpectation3 fulfill]; + }]; + + [self waitForExpectations:@[ canReadExpectation3 ] timeout:kTimeoutInSeconds]; + + // Check that the two devices are running on the same fabric. + __auto_type * opCreds1 = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device1 endpoint:0 queue:queue]; + __auto_type * opCreds2 = [[MTRBaseClusterOperationalCredentials alloc] initWithDevice:device2 endpoint:0 queue:queue]; + + __block NSNumber * fabricIndex; + XCTestExpectation * readFabricIndexExpectation1 = + [self expectationWithDescription:@"Fabric index read by initial commissioner"]; + [opCreds1 readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable readError) { + XCTAssertNil(readError); + XCTAssertNotNil(value); + fabricIndex = value; + [readFabricIndexExpectation1 fulfill]; + }]; + + [self waitForExpectations:@[ readFabricIndexExpectation1 ] timeout:kTimeoutInSeconds]; + + XCTestExpectation * readFabricIndexExpectation2 = [self expectationWithDescription:@"Fabric index read by new node"]; + [opCreds2 readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable readError) { + XCTAssertNil(readError); + XCTAssertNotNil(value); + XCTAssertEqualObjects(value, fabricIndex); + [readFabricIndexExpectation2 fulfill]; + }]; + + [self waitForExpectations:@[ readFabricIndexExpectation2 ] timeout:kTimeoutInSeconds]; + + // Reset our commissionee. + ResetCommissionee(device1, queue, self, kTimeoutInSeconds); + + [controller1 shutdown]; + XCTAssertFalse([controller1 isRunning]); + [controller2 shutdown]; + XCTAssertFalse([controller2 isRunning]); + [controller3 shutdown]; + XCTAssertFalse([controller3 isRunning]); +} + +@end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 5481acdf5ea66a..1520c2a9d12082 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -153,7 +153,13 @@ 51431AF927D2973E008A7943 /* MTRIMDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51431AF827D2973E008A7943 /* MTRIMDispatch.mm */; }; 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51431AFA27D29CA4008A7943 /* ota-provider.cpp */; }; 5143851E2A65885500EDC8E6 /* MTRSwiftPairingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */; }; + 514654492A72F9DF00904E61 /* MTRDemuxingStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514654482A72F9DF00904E61 /* MTRDemuxingStorage.mm */; }; + 5146544B2A72F9F500904E61 /* MTRDemuxingStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 5146544A2A72F9F500904E61 /* MTRDemuxingStorage.h */; }; 51565CAE2A79D42100469F18 /* MTRConversion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51565CAD2A79D42100469F18 /* MTRConversion.mm */; }; + 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */; }; + 51565CB22A7AD77600469F18 /* MTRDeviceControllerDataStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */; }; + 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; 515C1C6F284F9FFB00A48F0C /* MTRFramework.mm in Sources */ = {isa = PBXBuildFile; fileRef = 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */; }; 515C1C70284F9FFB00A48F0C /* MTRFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */; }; 51669AF02913204400F4AA36 /* MTRBackwardsCompatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */; }; @@ -182,6 +188,9 @@ 51E51FBF282AD37A00FC978D /* MTRDeviceControllerStartupParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51E51FC0282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E51FBD282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h */; }; 51E51FC1282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E51FBE282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm */; }; + 51E95DF82A78110900A434F0 /* MTRPerControllerStorageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E95DF72A78110900A434F0 /* MTRPerControllerStorageTests.m */; }; + 51E95DFB2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E95DF92A78443C00A434F0 /* MTRSessionResumptionStorageBridge.h */; }; + 51E95DFC2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E95DFA2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm */; }; 51EF279F2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EF279E2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h */; settings = {ATTRIBUTES = (Public, ); }; }; 5A60370827EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A60370727EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h */; }; 5A6FEC9027B563D900F25F42 /* MTRDeviceControllerOverXPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5A6FEC8F27B563D900F25F42 /* MTRDeviceControllerOverXPC.mm */; }; @@ -457,7 +466,13 @@ 51431AFA27D29CA4008A7943 /* ota-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ota-provider.cpp"; path = "clusters/ota-provider/ota-provider.cpp"; sourceTree = ""; }; 5143851C2A65885400EDC8E6 /* MatterTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MatterTests-Bridging-Header.h"; sourceTree = ""; }; 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTRSwiftPairingTests.swift; sourceTree = ""; }; + 514654482A72F9DF00904E61 /* MTRDemuxingStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDemuxingStorage.mm; sourceTree = ""; }; + 5146544A2A72F9F500904E61 /* MTRDemuxingStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDemuxingStorage.h; sourceTree = ""; }; 51565CAD2A79D42100469F18 /* MTRConversion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRConversion.mm; sourceTree = ""; }; + 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerDataStore.h; sourceTree = ""; }; + 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceControllerDataStore.mm; sourceTree = ""; }; + 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStorageDelegate.h; sourceTree = ""; }; + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParameters.h; sourceTree = ""; }; 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRFramework.mm; sourceTree = ""; }; 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFramework.h; sourceTree = ""; }; 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRBackwardsCompatTests.m; sourceTree = ""; }; @@ -488,6 +503,9 @@ 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParams.h; sourceTree = ""; }; 51E51FBD282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParams_Internal.h; sourceTree = ""; }; 51E51FBE282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceControllerStartupParams.mm; sourceTree = ""; }; + 51E95DF72A78110900A434F0 /* MTRPerControllerStorageTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRPerControllerStorageTests.m; sourceTree = ""; }; + 51E95DF92A78443C00A434F0 /* MTRSessionResumptionStorageBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRSessionResumptionStorageBridge.h; sourceTree = ""; }; + 51E95DFA2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRSessionResumptionStorageBridge.mm; sourceTree = ""; }; 51EF279E2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRBackwardsCompatShims.h; sourceTree = ""; }; 5A60370727EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MTRClusterStateCacheContainer+XPC.h"; sourceTree = ""; }; 5A6FEC8B27B5609C00F25F42 /* MTRDeviceOverXPC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceOverXPC.h; sourceTree = ""; }; @@ -1045,6 +1063,8 @@ 5A7947E227C0101200434CF2 /* MTRDeviceController+XPC.h */, 5A7947E327C0129500434CF2 /* MTRDeviceController+XPC.mm */, 2CB7163E252F731E0026E2BB /* MTRDeviceControllerDelegate.h */, + 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */, + 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */, 2CB71638252E8A7B0026E2BB /* MTRDeviceControllerDelegateBridge.h */, 2CB71639252E8A7B0026E2BB /* MTRDeviceControllerDelegateBridge.mm */, 5136661228067D550025EDAE /* MTRDeviceControllerFactory.h */, @@ -1056,6 +1076,8 @@ 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */, 51E51FBD282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h */, 51E51FBE282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm */, + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */, + 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */, 5A6FEC9427B5976200F25F42 /* MTRDeviceControllerXPCConnection.h */, 5A6FEC9527B5983000F25F42 /* MTRDeviceControllerXPCConnection.mm */, 5A6FEC8B27B5609C00F25F42 /* MTRDeviceOverXPC.h */, @@ -1088,6 +1110,10 @@ 998F287026D56940001846C6 /* MTRP256KeypairBridge.mm */, 2C8C8FBD253E0C2100797F05 /* MTRPersistentStorageDelegateBridge.h */, 2C8C8FBF253E0C2100797F05 /* MTRPersistentStorageDelegateBridge.mm */, + 514654482A72F9DF00904E61 /* MTRDemuxingStorage.mm */, + 5146544A2A72F9F500904E61 /* MTRDemuxingStorage.h */, + 51E95DF92A78443C00A434F0 /* MTRSessionResumptionStorageBridge.h */, + 51E95DFA2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm */, B2E0D7AC245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.h */, B2E0D7AE245B0B5C003C5B48 /* MTRQRCodeSetupPayloadParser.mm */, B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */, @@ -1132,6 +1158,7 @@ 51339B1E2A0DA64D00C798C1 /* MTRCertificateValidityTests.m */, 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */, 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */, + 51E95DF72A78110900A434F0 /* MTRPerControllerStorageTests.m */, B202529D2459E34F00F97062 /* Info.plist */, 5143851C2A65885400EDC8E6 /* MatterTests-Bridging-Header.h */, ); @@ -1198,6 +1225,8 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */, + 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */, 510A07492A685D3900A9241C /* Matter.apinotes in Headers */, 51EF279F2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h in Headers */, 5173A47729C0E2ED00F67F48 /* MTRFabricInfo.h in Headers */, @@ -1273,12 +1302,15 @@ 2C222ADF255C811800E446B9 /* MTRBaseDevice_Internal.h in Headers */, 511913FC28C100EF009235E9 /* MTRBaseSubscriptionCallback.h in Headers */, 51E0310027EA20D20083DC9C /* MTRControllerAccessControl.h in Headers */, + 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */, 3D843713294977000070D20A /* NSDataSpanConversion.h in Headers */, 991DC08B247704DC00C13860 /* MTRLogging_Internal.h in Headers */, 1E4D655029C208DD00BC3478 /* MTRCommissionableBrowserDelegate.h in Headers */, 7596A84828762783004DAE0E /* MTRAsyncCallbackWorkQueue.h in Headers */, 5A7947E527C0129F00434CF2 /* MTRDeviceController+XPC.h in Headers */, + 51E95DFB2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.h in Headers */, B2E0D7B4245B0B5C003C5B48 /* MTRError_Internal.h in Headers */, + 5146544B2A72F9F500904E61 /* MTRDemuxingStorage.h in Headers */, 1EDCE545289049A100E41EC9 /* MTROTAHeader.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1485,6 +1517,7 @@ 75B765C32A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm in Sources */, AF5F90FF2878D351005503FA /* MTROTAProviderDelegateBridge.mm in Sources */, 3D84374B29498BAE0070D20A /* privilege-storage.cpp in Sources */, + 51E95DFC2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm in Sources */, 7534F12828BFF20300390851 /* MTRDeviceAttestationDelegate.mm in Sources */, 2C5EEEF7268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm in Sources */, 51B22C262740CB32008D5055 /* MTRStructsObjc.mm in Sources */, @@ -1496,6 +1529,7 @@ 514304202914CED9004DC7FE /* generic-callback-stubs.cpp in Sources */, 1EDCE546289049A100E41EC9 /* MTROTAHeader.mm in Sources */, 1EC4CE5D25CC26E900D7304F /* MTRBaseClusters.mm in Sources */, + 51565CB22A7AD77600469F18 /* MTRDeviceControllerDataStore.mm in Sources */, 51E0310127EA20D20083DC9C /* MTRControllerAccessControl.mm in Sources */, 1ED276E226C5812A00547A89 /* MTRCluster.mm in Sources */, B2E0D7B3245B0B5C003C5B48 /* MTRError.mm in Sources */, @@ -1523,6 +1557,7 @@ 7596A85528788557004DAE0E /* MTRClusters.mm in Sources */, 88EBF8CF27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm in Sources */, 5A6FEC9827B5C6AF00F25F42 /* MTRDeviceOverXPC.mm in Sources */, + 514654492A72F9DF00904E61 /* MTRDemuxingStorage.mm in Sources */, 51431AF927D2973E008A7943 /* MTRIMDispatch.mm in Sources */, 1E4D655229C30A8700BC3478 /* MTRCommissionableBrowser.mm in Sources */, 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */, @@ -1561,6 +1596,7 @@ 51E24E73274E0DAC007CCF6E /* MTRErrorTestUtils.mm in Sources */, 519498322A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m in Sources */, 51A2F1322A00402A00F03298 /* MTRDataValueParserTests.m in Sources */, + 51E95DF82A78110900A434F0 /* MTRPerControllerStorageTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; From bf23b78f7aed93fe6278a0bdd5a6b49067260219 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 31 Aug 2023 20:47:12 -0400 Subject: [PATCH 07/96] Allow per-controller control of PAAs and CD signing keys. (#28998) * Allow per-controller control of PAAs and CD signing keys. * Address review comments. Also fixes some API docs and init bits. --- .../Framework/CHIP/MTRDeviceController.mm | 51 +++++++++++- .../CHIP/MTRDeviceControllerFactory.mm | 81 ++++++------------- .../MTRDeviceControllerFactory_Internal.h | 3 +- .../MTRDeviceControllerStartupParameters.h | 19 +++++ .../CHIP/MTRDeviceControllerStartupParams.mm | 5 ++ ...TRDeviceControllerStartupParams_Internal.h | 3 + 6 files changed, 101 insertions(+), 61 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 403bc8a0906183..44d3b63712d426 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -18,6 +18,7 @@ #import "MTRDeviceController_Internal.h" +#import "MTRAttestationTrustStoreBridge.h" #import "MTRBaseDevice_Internal.h" #import "MTRCommissionableBrowser.h" #import "MTRCommissionableBrowserResult_Internal.h" @@ -86,6 +87,7 @@ static NSString * const kErrorGetAttestationChallenge = @"Failure getting attestation challenge"; static NSString * const kErrorSpake2pVerifierGenerationFailed = @"PASE verifier generation failed"; static NSString * const kErrorSpake2pVerifierSerializationFailed = @"PASE verifier serialization failed"; +static NSString * const kErrorCDCertStoreInit = @"Init failure while initializing Certificate Declaration Signing Keys store"; typedef void (^SyncWorkQueueBlock)(void); typedef id (^SyncWorkQueueBlockWithReturnValue)(void); @@ -101,6 +103,7 @@ @interface MTRDeviceController () { @property (readonly) chip::Controller::DeviceCommissioner * cppCommissioner; @property (readonly) chip::Credentials::PartialDACVerifier * partialDACVerifier; +@property (readonly) chip::Credentials::DefaultDACVerifier * defaultDACVerifier; @property (readonly) MTRDeviceControllerDelegateBridge * deviceControllerDelegateBridge; @property (readonly) MTROperationalCredentialsDelegate * operationalCredentialsDelegate; @property (readonly) MTRP256KeypairBridge signingKeypairBridge; @@ -110,6 +113,8 @@ @interface MTRDeviceController () { @property (readonly) NSMutableDictionary * nodeIDToDeviceMap; @property (readonly) os_unfair_lock deviceMapLock; // protects nodeIDToDeviceMap @property (readonly) MTRCommissionableBrowser * commissionableBrowser; +@property (readonly) MTRAttestationTrustStoreBridge * attestationTrustStoreBridge; + @end @implementation MTRDeviceController @@ -234,6 +239,16 @@ - (void)cleanup { VerifyOrDie(_cppCommissioner == nullptr); + if (_defaultDACVerifier) { + delete _defaultDACVerifier; + _defaultDACVerifier = nullptr; + } + + if (_attestationTrustStoreBridge) { + delete _attestationTrustStoreBridge; + _attestationTrustStoreBridge = nullptr; + } + [self clearDeviceAttestationDelegateBridge]; if (_operationalCredentialsDelegate) { @@ -388,9 +403,41 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams // fabric information for the relevant fabric indices on controller // bring-up. commissionerParams.removeFromFabricTableOnShutdown = false; - commissionerParams.deviceAttestationVerifier = _factory.deviceAttestationVerifier; commissionerParams.permitMultiControllerFabrics = startupParams.allowMultipleControllersPerFabric; + // Set up our attestation verifier. Assume we want to use the default + // one, until something tells us otherwise. + const chip::Credentials::AttestationTrustStore * trustStore; + if (startupParams.productAttestationAuthorityCertificates) { + _attestationTrustStoreBridge + = new MTRAttestationTrustStoreBridge(startupParams.productAttestationAuthorityCertificates); + trustStore = _attestationTrustStoreBridge; + } else { + // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available + trustStore = chip::Credentials::GetTestAttestationTrustStore(); + } + + _defaultDACVerifier = new chip::Credentials::DefaultDACVerifier(trustStore); + + if (startupParams.certificationDeclarationCertificates) { + auto cdTrustStore = _defaultDACVerifier->GetCertificationDeclarationTrustStore(); + if (cdTrustStore == nullptr) { + errorCode = CHIP_ERROR_INCORRECT_STATE; + } + if ([self checkForStartError:errorCode logMsg:kErrorCDCertStoreInit]) { + return; + } + + for (NSData * cdSigningCert in startupParams.certificationDeclarationCertificates) { + errorCode = cdTrustStore->AddTrustedKey(AsByteSpan(cdSigningCert)); + if ([self checkForStartError:errorCode logMsg:kErrorCDCertStoreInit]) { + return; + } + } + } + + commissionerParams.deviceAttestationVerifier = _defaultDACVerifier; + auto & factory = chip::Controller::DeviceControllerFactory::GetInstance(); errorCode = factory.SetupCommissioner(commissionerParams, *_cppCommissioner); @@ -725,7 +772,7 @@ - (BOOL)setOperationalCertificateIssuer:(nullable id_cppCommissioner->SetDeviceAttestationVerifier(self->_factory.deviceAttestationVerifier); + self->_cppCommissioner->SetDeviceAttestationVerifier(self->_defaultDACVerifier); } return YES; }; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 95282450952ef2..97785a45a9db99 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -17,7 +17,6 @@ #import "MTRDeviceControllerFactory.h" #import "MTRDeviceControllerFactory_Internal.h" -#import "MTRAttestationTrustStoreBridge.h" #import "MTRCertificates.h" #import "MTRControllerAccessControl.h" #import "MTRDemuxingStorage.h" @@ -43,8 +42,6 @@ #include #include #include -#include -#include #include #include #include @@ -58,15 +55,12 @@ static NSString * const kErrorPersistentStorageInit = @"Init failure while creating a persistent storage delegate"; static NSString * const kErrorSessionResumptionStorageInit = @"Init failure while creating a session resumption storage delegate"; -static NSString * const kErrorAttestationTrustStoreInit = @"Init failure while creating the attestation trust store"; -static NSString * const kErrorDACVerifierInit = @"Init failure while creating the device attestation verifier"; static NSString * const kErrorGroupProviderInit = @"Init failure while initializing group data provider"; static NSString * const kErrorControllersInit = @"Init controllers array failure"; static NSString * const kErrorCertificateValidityPolicyInit = @"Init certificate validity policy failure"; static NSString * const kErrorControllerFactoryInit = @"Init failure while initializing controller factory"; static NSString * const kErrorKeystoreInit = @"Init failure while initializing persistent storage keystore"; static NSString * const kErrorCertStoreInit = @"Init failure while initializing persistent storage operational certificate store"; -static NSString * const kErrorCDCertStoreInit = @"Init failure while initializing Certificate Declaration Signing Keys store"; static NSString * const kErrorOtaProviderInit = @"Init failure while creating an OTA provider delegate"; static NSString * const kErrorSessionKeystoreInit = @"Init failure while initializing session keystore"; @@ -78,7 +72,6 @@ @interface MTRDeviceControllerFactory () @property (atomic, readonly) dispatch_queue_t chipWorkQueue; @property (readonly) DeviceControllerFactory * controllerFactory; @property (readonly) PersistentStorageDelegate * persistentStorageDelegate; -@property (readonly) MTRAttestationTrustStoreBridge * attestationTrustStoreBridge; @property (readonly) MTROTAProviderDelegateBridge * otaProviderDelegateBridge; @property (readonly) Crypto::RawKeySessionKeystore * sessionKeystore; // We use TestPersistentStorageDelegate just to get an in-memory store to back @@ -90,7 +83,12 @@ @interface MTRDeviceControllerFactory () @property (readonly) PersistentStorageOperationalKeystore * keystore; @property (readonly) Credentials::PersistentStorageOpCertStore * opCertStore; @property (readonly) MTROperationalBrowser * operationalBrowser; -@property () chip::Credentials::DeviceAttestationVerifier * deviceAttestationVerifier; + +// productAttestationAuthorityCertificates and certificationDeclarationCertificates are just copied +// from MTRDeviceControllerFactoryParams. +@property (readonly, nullable) NSArray * productAttestationAuthorityCertificates; +@property (readonly, nullable) NSArray * certificationDeclarationCertificates; + @property (readonly) BOOL advertiseOperational; @property (nonatomic, readonly) Credentials::IgnoreCertificateValidityPeriodPolicy * certificateValidityPolicy; @property (readonly) MTRSessionResumptionStorageBridge * sessionResumptionStorage; @@ -291,16 +289,6 @@ - (void)cleanupInitObjects - (void)cleanupStartupObjects { - if (_deviceAttestationVerifier) { - delete _deviceAttestationVerifier; - _deviceAttestationVerifier = nullptr; - } - - if (_attestationTrustStoreBridge) { - delete _attestationTrustStoreBridge; - _attestationTrustStoreBridge = nullptr; - } - if (_otaProviderDelegateBridge) { delete _otaProviderDelegateBridge; _otaProviderDelegateBridge = nullptr; @@ -504,44 +492,8 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams return; } - // Initialize device attestation verifier - const Credentials::AttestationTrustStore * trustStore; - if (startupParams.productAttestationAuthorityCertificates) { - _attestationTrustStoreBridge - = new MTRAttestationTrustStoreBridge(startupParams.productAttestationAuthorityCertificates); - if (_attestationTrustStoreBridge == nullptr) { - MTR_LOG_ERROR("Error: %@", kErrorAttestationTrustStoreInit); - errorCode = CHIP_ERROR_NO_MEMORY; - return; - } - trustStore = _attestationTrustStoreBridge; - } else { - // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available - trustStore = Credentials::GetTestAttestationTrustStore(); - } - _deviceAttestationVerifier = new Credentials::DefaultDACVerifier(trustStore); - if (_deviceAttestationVerifier == nullptr) { - MTR_LOG_ERROR("Error: %@", kErrorDACVerifierInit); - errorCode = CHIP_ERROR_NO_MEMORY; - return; - } - - if (startupParams.certificationDeclarationCertificates) { - auto cdTrustStore = _deviceAttestationVerifier->GetCertificationDeclarationTrustStore(); - if (cdTrustStore == nullptr) { - MTR_LOG_ERROR("Error: %@", kErrorCDCertStoreInit); - errorCode = CHIP_ERROR_INCORRECT_STATE; - return; - } - - for (NSData * cdSigningCert in startupParams.certificationDeclarationCertificates) { - errorCode = cdTrustStore->AddTrustedKey(AsByteSpan(cdSigningCert)); - if (errorCode != CHIP_NO_ERROR) { - MTR_LOG_ERROR("Error: %@", kErrorCDCertStoreInit); - return; - } - } - } + _productAttestationAuthorityCertificates = [startupParams.productAttestationAuthorityCertificates copy]; + _certificationDeclarationCertificates = [startupParams.certificationDeclarationCertificates copy]; chip::Controller::FactoryInitParams params; if (startupParams.port != nil) { @@ -827,6 +779,9 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo params:startupParams]; if (params == nil) { fabricError = CHIP_ERROR_NO_MEMORY; + } else { + params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; + params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; } return params; @@ -879,6 +834,9 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl params:startupParams]; if (params == nil) { fabricError = CHIP_ERROR_NO_MEMORY; + } else { + params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; + params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; } return params; } @@ -893,13 +851,22 @@ - (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupP return [self _startDeviceController:startupParameters fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { - return + auto * params = [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller fabricTable:fabricTable keystore:self->_keystore advertiseOperational:self.advertiseOperational params:startupParameters error:fabricError]; + if (params != nil) { + if (params.productAttestationAuthorityCertificates == nil) { + params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; + } + if (params.certificationDeclarationCertificates == nil) { + params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; + } + } + return params; } error:error]; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 4ffcb3af545506..9717f5062c93f5 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -30,7 +30,6 @@ namespace chip { namespace Credentials { class GroupDataProvider; - class DeviceAttestationVerifier; } // namespace Credentials } // namespace chip @@ -70,7 +69,7 @@ NS_ASSUME_NONNULL_BEGIN @property (readonly) chip::PersistentStorageDelegate * storageDelegate; @property (readonly) chip::Credentials::GroupDataProvider * groupData; -@property (readonly) chip::Credentials::DeviceAttestationVerifier * deviceAttestationVerifier; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h index 7087bd87fbaf8e..b592849f066974 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h @@ -27,6 +27,25 @@ MTR_NEWLY_AVAILABLE - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; +/** + * The Product Attestation Authority certificates that are trusted to sign + * device attestation information (and in particular to sign Product Attestation + * Intermediate certificates, which then sign Device Attestation Certificates). + * + * Defaults to nil. + */ +@property (nonatomic, copy, nullable) NSArray * productAttestationAuthorityCertificates; + +/** + * The Certification Declaration certificates whose public keys correspond to + * private keys that are trusted to sign certification declarations. Defaults + * to nil. + * + * These certificates are used in addition to, not replacing, the default set of + * well-known certification declaration signing keys. + */ +@property (nonatomic, copy, nullable) NSArray * certificationDeclarationCertificates; + /** * Set an MTROperationalCertificateIssuer to call (on the provided queue) when * operational certificates need to be provided during commissioning. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 9fb71429a07720..c4ad49dda014cd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -262,6 +262,9 @@ - (instancetype)initWithStorageDelegate:(id) return nil; } + _productAttestationAuthorityCertificates = nil; + _certificationDeclarationCertificates = nil; + _ipk = ipk; _vendorID = vendorID; _rootCertificate = rootCertificate; @@ -601,6 +604,8 @@ - (instancetype)initForNewController:(MTRDeviceController *)controller _allowMultipleControllersPerFabric = YES; _storageDelegate = params.storageDelegate; _storageDelegateQueue = params.storageDelegateQueue; + _productAttestationAuthorityCertificates = params.productAttestationAuthorityCertificates; + _certificationDeclarationCertificates = params.certificationDeclarationCertificates; return self; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 53cec273ebdc52..cb7540c2e16e65 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -96,6 +96,9 @@ MTR_HIDDEN @property (nonatomic, assign, readonly) BOOL allowMultipleControllersPerFabric; +@property (nonatomic, nullable) NSArray * productAttestationAuthorityCertificates; +@property (nonatomic, nullable) NSArray * certificationDeclarationCertificates; + /** * A storage delegate that can be provided when initializing the startup params. * This must be provided if and only if the controller factory was initialized From 08f00d5d4d9aa43c43bd361fe16ba0f35b39bcf8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 31 Aug 2023 21:12:37 -0400 Subject: [PATCH 08/96] Address some review comments on Darwin controller data store. (#29003) 1) More efficient copying of arrays. 2) Make it clear what classes need to go in our storage class list. --- src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm index 4732009ade3513..7336b27f225cee 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm @@ -138,8 +138,7 @@ - (nullable instancetype)initWithController:(MTRDeviceController *)controller return nil; } } - _nodesWithResumptionInfo = [NSMutableArray arrayWithCapacity:[resumptionNodeList count]]; - [_nodesWithResumptionInfo addObjectsFromArray:resumptionNodeList]; + _nodesWithResumptionInfo = [resumptionNodeList mutableCopy]; } else { _nodesWithResumptionInfo = [[NSMutableArray alloc] init]; } @@ -184,7 +183,7 @@ - (void)storeResumptionInfo:(MTRCASESessionResumptionInfo *)resumptionInfo // Update our resumption info node list. [_nodesWithResumptionInfo addObject:resumptionInfo.nodeID]; [_storageDelegate controller:_controller - storeValue:[NSArray arrayWithArray:_nodesWithResumptionInfo] + storeValue:[_nodesWithResumptionInfo copy] forKey:sResumptionNodeListKey securityLevel:MTRStorageSecurityLevelSecure sharingType:MTRStorageSharingTypeNotShared]; @@ -349,6 +348,9 @@ - (void)encodeWithCoder:(NSCoder *)coder NSSet * MTRDeviceControllerStorageClasses() { + // This only needs to return the classes for toplevel things we are storing, + // plus NSNumber because some archivers use that internally to store + // information about what's being archived. static NSSet * const sStorageClasses = [NSSet setWithArray:@[ [NSNumber class], [NSData class], From f3e9cfdcef91b84cc4c1ab5457a8429a6d4e076f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 31 Aug 2023 21:16:53 -0400 Subject: [PATCH 09/96] Factor out per-controller storage into test helper. (#28999) --- .../CHIPTests/MTRPerControllerStorageTests.m | 95 +++---------------- .../TestHelpers/MTRTestPerControllerStorage.h | 43 +++++++++ .../TestHelpers/MTRTestPerControllerStorage.m | 85 +++++++++++++++++ .../Matter.xcodeproj/project.pbxproj | 6 ++ 4 files changed, 148 insertions(+), 81 deletions(-) create mode 100644 src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h create mode 100644 src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index fdf03eab12ba36..894eb5f3893464 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -22,8 +22,8 @@ #import "MTRErrorTestUtils.h" #import "MTRFabricInfoChecker.h" #import "MTRTestKeys.h" +#import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" -#import "MTRTestStorage.h" static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; @@ -69,73 +69,6 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr @end -@interface MTRPerControllerStorageTestsStorageDelegate : NSObject -@property (nonatomic, readonly) NSMutableDictionary * storage; -@property (nonatomic, readonly) NSUUID * controllerID; -@end - -@implementation MTRPerControllerStorageTestsStorageDelegate - -- (instancetype)initWithControllerID:(NSUUID *)controllerID -{ - if (!(self = [super init])) { - return nil; - } - - _storage = [[NSMutableDictionary alloc] init]; - _controllerID = controllerID; - return self; -} - -- (nullable id)controller:(MTRDeviceController *)controller - valueForKey:(NSString *)key - securityLevel:(MTRStorageSecurityLevel)securityLevel - sharingType:(MTRStorageSharingType)sharingType -{ - XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); - - __auto_type * data = self.storage[key]; - if (data == nil) { - return data; - } - - NSError * error; - id value = [NSKeyedUnarchiver unarchivedObjectOfClasses:MTRDeviceControllerStorageClasses() fromData:data error:&error]; - XCTAssertNil(error); - XCTAssertNotNil(data); - - return value; -} - -- (BOOL)controller:(MTRDeviceController *)controller - storeValue:(id)value - forKey:(NSString *)key - securityLevel:(MTRStorageSecurityLevel)securityLevel - sharingType:(MTRStorageSharingType)sharingType -{ - XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); - - NSError * error; - NSData * data = [NSKeyedArchiver archivedDataWithRootObject:value requiringSecureCoding:YES error:&error]; - XCTAssertNil(error); - XCTAssertNotNil(data); - - self.storage[key] = data; - return YES; -} - -- (BOOL)controller:(MTRDeviceController *)controller - removeValueForKey:(NSString *)key - securityLevel:(MTRStorageSecurityLevel)securityLevel - sharingType:(MTRStorageSharingType)sharingType -{ - XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); - self.storage[key] = nil; - return YES; -} - -@end - @interface MTRPerControllerStorageTestsCertificateIssuer : NSObject - (instancetype)initWithRootCertificate:(MTRCertificateDERBytes)rootCertificate intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate @@ -319,7 +252,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo operationalKeys:(MTRTestKeys *)operationalKeys fabricID:(NSNumber *)fabricID nodeID:(NSNumber *)nodeID - storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + storage:(MTRTestPerControllerStorage *)storage caseAuthenticatedTags:(nullable NSSet *)caseAuthenticatedTags error:(NSError * __autoreleasing *)error certificateIssuer: @@ -376,7 +309,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo operationalKeys:(MTRTestKeys *)operationalKeys fabricID:(NSNumber *)fabricID nodeID:(NSNumber *)nodeID - storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + storage:(MTRTestPerControllerStorage *)storage error:(NSError * __autoreleasing *)error certificateIssuer: (MTRPerControllerStorageTestsCertificateIssuer * __autoreleasing *)certificateIssuer @@ -395,7 +328,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo operationalKeys:(MTRTestKeys *)operationalKeys fabricID:(NSNumber *)fabricID nodeID:(NSNumber *)nodeID - storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + storage:(MTRTestPerControllerStorage *)storage caseAuthenticatedTags:(nullable NSSet *)caseAuthenticatedTags error:(NSError * __autoreleasing *)error { @@ -413,7 +346,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo operationalKeys:(MTRTestKeys *)operationalKeys fabricID:(NSNumber *)fabricID nodeID:(NSNumber *)nodeID - storage:(MTRPerControllerStorageTestsStorageDelegate *)storage + storage:(MTRTestPerControllerStorage *)storage error:(NSError * __autoreleasing *)error { return [self startControllerWithRootKeys:rootKeys @@ -436,7 +369,7 @@ - (void)test001_BasicControllerStartup __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; XCTAssertNotNil(operationalKeys); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * nodeID = @(123); NSNumber * fabricID = @(456); @@ -481,7 +414,7 @@ - (void)test002_TryStartingTwoControllersWithSameNodeID __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; XCTAssertNotNil(operationalKeys); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * nodeID = @(123); NSNumber * fabricID = @(456); @@ -526,7 +459,7 @@ - (void)test003_TestTwoControllersSameUUID XCTAssertNotNil(operationalKeys); XCTAssertEqual(operationalKeys.signatureCount, 0); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * fabricID = @(456); @@ -578,7 +511,7 @@ - (void)test004_TestBasicSessionResumption XCTAssertNotNil(operationalKeys); XCTAssertEqual(operationalKeys.signatureCount, 0); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * nodeID = @(123); NSNumber * fabricID = @(456); @@ -675,7 +608,7 @@ - (void)test005_TestSessionResumptionDataClearingNodeIDChanged XCTAssertNotNil(operationalKeys); XCTAssertEqual(operationalKeys.signatureCount, 0); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * nodeID1 = @(123); NSNumber * nodeID2 = @(246); @@ -778,7 +711,7 @@ - (void)test006_TestSessionResumptionDataClearingCATsChanged XCTAssertNotNil(operationalKeys); XCTAssertEqual(operationalKeys.signatureCount, 0); - __auto_type * storageDelegate = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; NSNumber * nodeID = @(123); NSNumber * fabricID = @(456); @@ -887,7 +820,7 @@ - (void)test007_TestMultipleControllers NSNumber * fabricID1 = @(1); NSNumber * fabricID2 = @(2); - __auto_type * storageDelegate1 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate1 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; // Start several controllers that have distinct identities but share some // node/fabric IDs. @@ -904,7 +837,7 @@ - (void)test007_TestMultipleControllers XCTAssertNotNil(controller1); XCTAssertTrue([controller1 isRunning]); - __auto_type * storageDelegate2 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate2 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; MTRDeviceController * controller2 = [self startControllerWithRootKeys:rootKeys operationalKeys:operationalKeys fabricID:fabricID1 @@ -915,7 +848,7 @@ - (void)test007_TestMultipleControllers XCTAssertNotNil(controller2); XCTAssertTrue([controller2 isRunning]); - __auto_type * storageDelegate3 = [[MTRPerControllerStorageTestsStorageDelegate alloc] initWithControllerID:[NSUUID UUID]]; + __auto_type * storageDelegate3 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; MTRDeviceController * controller3 = [self startControllerWithRootKeys:rootKeys operationalKeys:operationalKeys fabricID:fabricID2 diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h new file mode 100644 index 00000000000000..b3052a9929a1af --- /dev/null +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2023 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 +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MTRTestPerControllerStorage : NSObject + +- (instancetype)initWithControllerID:(NSUUID *)controllerID; + +@property (nonatomic, readonly) NSUUID * controllerID; + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType; +@end + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m new file mode 100644 index 00000000000000..1898bd14832cf9 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m @@ -0,0 +1,85 @@ +/** + * Copyright (c) 2023 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 + +#import "MTRTestPerControllerStorage.h" + +@interface MTRTestPerControllerStorage () +@property (nonatomic, readonly) NSMutableDictionary * storage; +@end + +@implementation MTRTestPerControllerStorage + +- (instancetype)initWithControllerID:(NSUUID *)controllerID +{ + if (!(self = [super init])) { + return nil; + } + + _storage = [[NSMutableDictionary alloc] init]; + _controllerID = controllerID; + return self; +} + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + + __auto_type * data = self.storage[key]; + if (data == nil) { + return data; + } + + NSError * error; + id value = [NSKeyedUnarchiver unarchivedObjectOfClasses:MTRDeviceControllerStorageClasses() fromData:data error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(data); + + return value; +} + +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + + NSError * error; + NSData * data = [NSKeyedArchiver archivedDataWithRootObject:value requiringSecureCoding:YES error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(data); + + self.storage[key] = data; + return YES; +} + +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + XCTAssertEqualObjects(_controllerID, controller.uniqueIdentifier); + self.storage[key] = nil; + return YES; +} + +@end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 1520c2a9d12082..edc68cd47eb1c4 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -172,6 +172,7 @@ 517BF3F0282B62B800A8B7DB /* MTRCertificates.h in Headers */ = {isa = PBXBuildFile; fileRef = 517BF3EE282B62B800A8B7DB /* MTRCertificates.h */; settings = {ATTRIBUTES = (Public, ); }; }; 517BF3F1282B62B800A8B7DB /* MTRCertificates.mm in Sources */ = {isa = PBXBuildFile; fileRef = 517BF3EF282B62B800A8B7DB /* MTRCertificates.mm */; }; 517BF3F3282B62CB00A8B7DB /* MTRCertificateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */; }; + 518D3F832AA132DC008E0007 /* MTRTestPerControllerStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 518D3F812AA132DC008E0007 /* MTRTestPerControllerStorage.m */; }; 519498322A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */; }; 51A2F1322A00402A00F03298 /* MTRDataValueParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51A2F1312A00402A00F03298 /* MTRDataValueParserTests.m */; }; 51B22C1E2740CB0A008D5055 /* MTRStructsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B22C1D2740CB0A008D5055 /* MTRStructsObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -486,6 +487,8 @@ 517BF3EE282B62B800A8B7DB /* MTRCertificates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRCertificates.h; sourceTree = ""; }; 517BF3EF282B62B800A8B7DB /* MTRCertificates.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCertificates.mm; sourceTree = ""; }; 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRCertificateTests.m; sourceTree = ""; }; + 518D3F812AA132DC008E0007 /* MTRTestPerControllerStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRTestPerControllerStorage.m; sourceTree = ""; }; + 518D3F822AA132DC008E0007 /* MTRTestPerControllerStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestPerControllerStorage.h; sourceTree = ""; }; 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRSetupPayloadSerializerTests.m; sourceTree = ""; }; 51A2F1312A00402A00F03298 /* MTRDataValueParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRDataValueParserTests.m; sourceTree = ""; }; 51B22C1D2740CB0A008D5055 /* MTRStructsObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRStructsObjc.h; sourceTree = ""; }; @@ -968,6 +971,8 @@ 51742B4829CB5F45009974FE /* MTRTestResetCommissioneeHelper.h */, 51742B4929CB5FC0009974FE /* MTRTestResetCommissioneeHelper.m */, 51C984612A61CE2A00B0AD9A /* MTRFabricInfoChecker.h */, + 518D3F822AA132DC008E0007 /* MTRTestPerControllerStorage.h */, + 518D3F812AA132DC008E0007 /* MTRTestPerControllerStorage.m */, 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */, ); path = TestHelpers; @@ -1581,6 +1586,7 @@ 1E5801C328941C050033A199 /* MTRTestOTAProvider.m in Sources */, 5A6FEC9D27B5E48900F25F42 /* MTRXPCProtocolTests.m in Sources */, 1EE0805E2A44875E008A03C2 /* MTRCommissionableBrowserTests.m in Sources */, + 518D3F832AA132DC008E0007 /* MTRTestPerControllerStorage.m in Sources */, 51339B1F2A0DA64D00C798C1 /* MTRCertificateValidityTests.m in Sources */, 5173A47929C0E82300F67F48 /* MTRFabricInfoTests.m in Sources */, 5143851E2A65885500EDC8E6 /* MTRSwiftPairingTests.swift in Sources */, From 105b771e3727fb9b6522220a2466a402e5659953 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Thu, 31 Aug 2023 23:02:05 -0400 Subject: [PATCH 10/96] [ICD] Add Check-In payload generation (#27615) * Add Check-In payload generation * Applied PR comments * Fix last comment * address comments * address comments * fix comments * fix payload representation type * Fix OpenIotSDK failure * fix last test issue --- src/crypto/CHIPCryptoPAL.h | 2 + src/protocols/secure_channel/BUILD.gn | 3 + .../secure_channel/CheckinMessage.cpp | 102 +++++++ src/protocols/secure_channel/CheckinMessage.h | 90 ++++++ src/protocols/secure_channel/tests/BUILD.gn | 2 + .../secure_channel/tests/TestCheckinMsg.cpp | 272 ++++++++++++++++++ 6 files changed, 471 insertions(+) create mode 100644 src/protocols/secure_channel/CheckinMessage.cpp create mode 100644 src/protocols/secure_channel/CheckinMessage.h create mode 100644 src/protocols/secure_channel/tests/TestCheckinMsg.cpp diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index be19881c342c43..9e276b9eea4359 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -93,6 +93,8 @@ constexpr size_t kAES_CCM128_Block_Length = kAES_CCM128_Key_Length; constexpr size_t kAES_CCM128_Nonce_Length = 13; constexpr size_t kAES_CCM128_Tag_Length = 16; +constexpr size_t CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES = kAES_CCM128_Nonce_Length; + /* These sizes are hardcoded here to remove header dependency on underlying crypto library * in a public interface file. The validity of these sizes is verified by static_assert in * the implementation files. diff --git a/src/protocols/secure_channel/BUILD.gn b/src/protocols/secure_channel/BUILD.gn index 93997d0642b37f..5a24a984719a5e 100644 --- a/src/protocols/secure_channel/BUILD.gn +++ b/src/protocols/secure_channel/BUILD.gn @@ -29,6 +29,8 @@ static_library("secure_channel") { "CASEServer.h", "CASESession.cpp", "CASESession.h", + "CheckinMessage.cpp", + "CheckinMessage.h", "DefaultSessionResumptionStorage.cpp", "DefaultSessionResumptionStorage.h", "PASESession.cpp", @@ -50,6 +52,7 @@ static_library("secure_channel") { public_deps = [ ":type_definitions", + "${chip_root}/src/crypto", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/messaging", diff --git a/src/protocols/secure_channel/CheckinMessage.cpp b/src/protocols/secure_channel/CheckinMessage.cpp new file mode 100644 index 00000000000000..358133a42b81b1 --- /dev/null +++ b/src/protocols/secure_channel/CheckinMessage.cpp @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @file + * This file implements the Matter Checkin protocol. + */ + +#include "CheckinMessage.h" +#include + +#include +#include + +namespace chip { +namespace Protocols { +namespace SecureChannel { + +CHIP_ERROR CheckinMessage::GenerateCheckinMessagePayload(Crypto::Aes128KeyHandle & key, CounterType counter, + const ByteSpan & appData, MutableByteSpan & output) +{ + VerifyOrReturnError(appData.size() <= sMaxAppDataSize, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(output.size() >= (appData.size() + sMinPayloadSize), CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR err = CHIP_NO_ERROR; + uint8_t * appDataStartPtr = output.data() + CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES; + Encoding::LittleEndian::Put32(appDataStartPtr, counter); + + chip::Crypto::HMAC_sha shaHandler; + uint8_t nonceWorkBuffer[CHIP_CRYPTO_HASH_LEN_BYTES] = { 0 }; + + ReturnErrorOnFailure(shaHandler.HMAC_SHA256(key.As(), sizeof(Aes128KeyByteArray), appDataStartPtr, + sizeof(CounterType), nonceWorkBuffer, CHIP_CRYPTO_HASH_LEN_BYTES)); + + static_assert(sizeof(nonceWorkBuffer) >= CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES, "We're reading off the end of our buffer."); + memcpy(output.data(), nonceWorkBuffer, CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES); + + // In place encryption to save some RAM + memcpy(appDataStartPtr + sizeof(CounterType), appData.data(), appData.size()); + + uint8_t * micPtr = appDataStartPtr + sizeof(CounterType) + appData.size(); + ReturnErrorOnFailure(Crypto::AES_CCM_encrypt(appDataStartPtr, sizeof(CounterType) + appData.size(), nullptr, 0, key, + output.data(), CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES, appDataStartPtr, micPtr, + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES)); + + output.reduce_size(appData.size() + sMinPayloadSize); + + return err; +} + +CHIP_ERROR CheckinMessage::ParseCheckinMessagePayload(Crypto::Aes128KeyHandle & key, ByteSpan & payload, CounterType & counter, + MutableByteSpan & appData) +{ + VerifyOrReturnError(payload.size() >= sMinPayloadSize, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(payload.size() <= (sMinPayloadSize + sMaxAppDataSize), CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR err = CHIP_NO_ERROR; + size_t appDataSize = GetAppDataSize(payload); + + // To prevent workbuffer usage, appData size needs to be large enough to hold both the appData and the counter + VerifyOrReturnError(appData.size() >= sizeof(CounterType) + appDataSize, CHIP_ERROR_INVALID_ARGUMENT); + + ByteSpan nonce = payload.SubSpan(0, CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES); + ByteSpan encryptedData = payload.SubSpan(CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES, sizeof(CounterType) + appDataSize); + ByteSpan mic = + payload.SubSpan(CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES + sizeof(CounterType) + appDataSize, CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES); + + err = Crypto::AES_CCM_decrypt(encryptedData.data(), encryptedData.size(), nullptr, 0, mic.data(), mic.size(), key, nonce.data(), + nonce.size(), appData.data()); + + ReturnErrorOnFailure(err); + + counter = Encoding::LittleEndian::Get32(appData.data()); + // Shift to remove the counter from the appData + memmove(appData.data(), sizeof(CounterType) + appData.data(), appDataSize); + + appData.reduce_size(appDataSize); + return err; +} + +size_t CheckinMessage::GetAppDataSize(ByteSpan & payload) +{ + return (payload.size() <= sMinPayloadSize) ? 0 : payload.size() - sMinPayloadSize; +} + +} // namespace SecureChannel +} // namespace Protocols +} // namespace chip diff --git a/src/protocols/secure_channel/CheckinMessage.h b/src/protocols/secure_channel/CheckinMessage.h new file mode 100644 index 00000000000000..aa494c3689b5c8 --- /dev/null +++ b/src/protocols/secure_channel/CheckinMessage.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @file + * This file implements the Matter Checkin protocol. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace Protocols { +namespace SecureChannel { +using namespace Crypto; + +using CounterType = uint32_t; + +/** + * @brief Implement section 4.18.2 of the spec regarding + * Check-in message payload + * + */ +class DLL_EXPORT CheckinMessage +{ +public: + ~CheckinMessage(); + /** + * @brief Generate Check-in Message payload + * + * @param key Key with which to encrypt the check-in payload + * @param counter Check-in counter + * @param appData Application Data to incorporate within the Check-in message. Allowed to be empty. + * @param output Buffer in Which to store the generated payload. SUFFICIENT SPACE MUST BE ALLOCATED by the caller + * Required Buffer Size is : GetCheckinPayloadSize(appData.size()) + * @return CHIP_ERROR + */ + static CHIP_ERROR GenerateCheckinMessagePayload(Crypto::Aes128KeyHandle & key, CounterType counter, const ByteSpan & appData, + MutableByteSpan & output); + + /** + * @brief Parse Check-in Message payload + * + * @param key Key with which to decrypt the check-in payload + * @param payload The received payload to decrypt and parse + * @param counter The counter value retrieved from the payload + * @param appData The optional application data decrypted. The size of appData must be at least the size of + * GetAppDataSize(payload) + sizeof(CounterType) + * @return CHIP_ERROR + */ + static CHIP_ERROR ParseCheckinMessagePayload(Crypto::Aes128KeyHandle & key, ByteSpan & payload, CounterType & counter, + MutableByteSpan & appData); + + static inline size_t GetCheckinPayloadSize(size_t appDataSize) { return appDataSize + sMinPayloadSize; } + + /** + * @brief Get the App Data Size + * + * @param payload The undecrypted payload + * @return size_t size in byte of the application data from the payload + */ + static size_t GetAppDataSize(ByteSpan & payload); + + static constexpr uint16_t sMinPayloadSize = + CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES + sizeof(CounterType) + CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES; + + // Issue #28603 + static constexpr uint16_t sMaxAppDataSize = 1024; +}; + +} // namespace SecureChannel +} // namespace Protocols +} // namespace chip diff --git a/src/protocols/secure_channel/tests/BUILD.gn b/src/protocols/secure_channel/tests/BUILD.gn index 6f7963a2396883..5c3ec4a30696c3 100644 --- a/src/protocols/secure_channel/tests/BUILD.gn +++ b/src/protocols/secure_channel/tests/BUILD.gn @@ -13,6 +13,7 @@ chip_test_suite("tests") { # TODO - Fix Message Counter Sync to use group key # "TestMessageCounterManager.cpp", + "TestCheckinMsg.cpp", "TestDefaultSessionResumptionStorage.cpp", "TestPASESession.cpp", "TestPairingSession.cpp", @@ -22,6 +23,7 @@ chip_test_suite("tests") { public_deps = [ "${chip_root}/src/credentials/tests:cert_test_vectors", + "${chip_root}/src/crypto/tests:tests_lib", "${chip_root}/src/lib/core", "${chip_root}/src/lib/support", "${chip_root}/src/lib/support:testing", diff --git a/src/protocols/secure_channel/tests/TestCheckinMsg.cpp b/src/protocols/secure_channel/tests/TestCheckinMsg.cpp new file mode 100644 index 00000000000000..37f7c765729dd3 --- /dev/null +++ b/src/protocols/secure_channel/tests/TestCheckinMsg.cpp @@ -0,0 +1,272 @@ +/* + * + * Copyright (c) 2021 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 +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +using namespace chip; +using namespace chip::Protocols; +using namespace chip::Protocols::SecureChannel; +using TestSessionKeystoreImpl = Crypto::DefaultSessionKeystore; + +void TestCheckin_Generate(nlTestSuite * inSuite, void * inContext) +{ + uint8_t a[300] = { 0 }; + uint8_t b[300] = { 0 }; + MutableByteSpan outputBuffer{ a }; + MutableByteSpan oldOutputBuffer{ b }; + uint32_t counter = 0; + ByteSpan userData; + CHIP_ERROR err = CHIP_NO_ERROR; + TestSessionKeystoreImpl keystore; + + // Verify that keys imported to the keystore behave as expected. + for (const ccm_128_test_vector * testPtr : ccm_128_test_vectors) + { + const ccm_128_test_vector & test = *testPtr; + + Aes128KeyByteArray keyMaterial; + memcpy(keyMaterial, test.key, test.key_len); + + Aes128KeyHandle keyHandle; + NL_TEST_ASSERT_SUCCESS(inSuite, keystore.CreateKey(keyMaterial, keyHandle)); + + // Validate that counter change, indeed changes the output buffer content + counter = 0; + for (uint8_t j = 0; j < 5; j++) + { + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, userData, outputBuffer); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + // Verifiy that the output buffer changed + NL_TEST_ASSERT(inSuite, !outputBuffer.data_equal(oldOutputBuffer)); + CopySpanToMutableSpan(outputBuffer, oldOutputBuffer); + + // Increment by a random count. On the slim changes the increment is 0 add 1 to change output buffer + counter += chip::Crypto::GetRandU32() + 1; + outputBuffer = MutableByteSpan(a); + } + keystore.DestroyKey(keyHandle); + } + + // Parameter check + { + uint8_t data[] = { "This is some user Data. It should be encrypted" }; + userData = chip::ByteSpan(data); + const ccm_128_test_vector & test = *ccm_128_test_vectors[0]; + uint8_t gargantuaBuffer[2 * CheckinMessage::sMaxAppDataSize] = { 0 }; + + Aes128KeyByteArray keyMaterial; + memcpy(keyMaterial, test.key, test.key_len); + + Aes128KeyHandle keyHandle; + NL_TEST_ASSERT_SUCCESS(inSuite, keystore.CreateKey(keyMaterial, keyHandle)); + + // As of now passing an empty key handle while using PSA crypto will result in a failure. + // However when using OpenSSL this same test result in a success. + // Issue #28986 + + // Aes128KeyHandle emptyKeyHandle; + // err = CheckinMessage::GenerateCheckinMessagePayload(emptyKeyHandle, counter, userData, outputBuffer); + // ChipLogError(Inet, "%s", err.AsString()); + // NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + ByteSpan emptyData; + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, emptyData, outputBuffer); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + MutableByteSpan empty; + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, emptyData, empty); + NL_TEST_ASSERT(inSuite, (CHIP_ERROR_INVALID_ARGUMENT == err)); + + userData = chip::ByteSpan(gargantuaBuffer, sizeof(gargantuaBuffer)); + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, userData, outputBuffer); + NL_TEST_ASSERT(inSuite, (CHIP_ERROR_INVALID_ARGUMENT == err)); + + // Cleanup + keystore.DestroyKey(keyHandle); + } +} + +void TestCheckin_Parse(nlTestSuite * inSuite, void * inContext) +{ + uint8_t a[300] = { 0 }; + uint8_t b[300] = { 0 }; + MutableByteSpan outputBuffer{ a }; + MutableByteSpan buffer{ b }; + uint32_t counter = 0, decryptedCounter; + ByteSpan userData; + + CHIP_ERROR err = CHIP_NO_ERROR; + + TestSessionKeystoreImpl keystore; + + // Verify User Data Encryption Decryption + uint8_t data[] = { "This is some user Data. It should be encrypted" }; + userData = chip::ByteSpan(data); + const ccm_128_test_vector & test = *ccm_128_test_vectors[0]; + + Aes128KeyByteArray keyMaterial; + memcpy(keyMaterial, test.key, test.key_len); + + Aes128KeyHandle keyHandle; + NL_TEST_ASSERT_SUCCESS(inSuite, keystore.CreateKey(keyMaterial, keyHandle)); + + //=================Encrypt======================= + + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, userData, outputBuffer); + ByteSpan payload = chip::ByteSpan(outputBuffer.data(), outputBuffer.size()); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + //=================Decrypt======================= + + MutableByteSpan empty; + err = CheckinMessage::ParseCheckinMessagePayload(keyHandle, payload, decryptedCounter, empty); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR != err)); + + ByteSpan emptyPayload; + err = CheckinMessage::ParseCheckinMessagePayload(keyHandle, emptyPayload, decryptedCounter, buffer); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR != err)); +} + +void TestCheckin_GenerateParse(nlTestSuite * inSuite, void * inContext) +{ + uint8_t a[300] = { 0 }; + uint8_t b[300] = { 0 }; + MutableByteSpan outputBuffer{ a }; + MutableByteSpan buffer{ b }; + uint32_t counter = 0xDEADBEEF; + ByteSpan userData; + + CHIP_ERROR err = CHIP_NO_ERROR; + + TestSessionKeystoreImpl keystore; + + // Verify User Data Encryption Decryption + uint8_t data[] = { "This is some user Data. It should be encrypted" }; + userData = chip::ByteSpan(data); + for (const ccm_128_test_vector * testPtr : ccm_128_test_vectors) + { + const ccm_128_test_vector & test = *testPtr; + + Aes128KeyByteArray keyMaterial; + memcpy(keyMaterial, test.key, test.key_len); + + Aes128KeyHandle keyHandle; + NL_TEST_ASSERT_SUCCESS(inSuite, keystore.CreateKey(keyMaterial, keyHandle)); + + //=================Encrypt======================= + + err = CheckinMessage::GenerateCheckinMessagePayload(keyHandle, counter, userData, outputBuffer); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + //=================Decrypt======================= + uint32_t decryptedCounter = 0; + ByteSpan payload = chip::ByteSpan(outputBuffer.data(), outputBuffer.size()); + + err = CheckinMessage::ParseCheckinMessagePayload(keyHandle, payload, decryptedCounter, buffer); + NL_TEST_ASSERT(inSuite, (CHIP_NO_ERROR == err)); + + NL_TEST_ASSERT(inSuite, (memcmp(data, buffer.data(), sizeof(data)) == 0)); + NL_TEST_ASSERT(inSuite, (counter == decryptedCounter)); + + // reset buffers + memset(a, 0, sizeof(a)); + memset(b, 0, sizeof(b)); + outputBuffer = MutableByteSpan(a); + buffer = MutableByteSpan(b); + + counter += chip::Crypto::GetRandU32() + 1; + keystore.DestroyKey(keyHandle); + } +} + +// Test Suite + +/** + * Test Suite that lists all the test functions. + */ +// clang-format off +static const nlTest sTests[] = +{ + NL_TEST_DEF("TestCheckin_Generate", TestCheckin_Generate), + NL_TEST_DEF("TestCheckin_Parse", TestCheckin_Parse), + NL_TEST_DEF("TestCheckin_GenerateParse", TestCheckin_GenerateParse), + + NL_TEST_SENTINEL() +}; +// clang-format on + +/** + * Set up the test suite. + */ +static int TestSetup(void * inContext) +{ + CHIP_ERROR error = chip::Platform::MemoryInit(); + if (error != CHIP_NO_ERROR) + return FAILURE; + return SUCCESS; +} + +/** + * Tear down the test suite. + */ +static int TestTeardown(void * inContext) +{ + chip::Platform::MemoryShutdown(); + return SUCCESS; +} + +// clang-format off +static nlTestSuite sSuite = +{ + "Test-CHIP-Checkin-Message", + &sTests[0], + TestSetup, + TestTeardown, +}; +// clang-format on + +/** + * Main + */ +int TestCheckinMessage() +{ + // Run test suit against one context + nlTestRunner(&sSuite, nullptr); + + return (nlTestRunnerStats(&sSuite)); +} + +CHIP_REGISTER_TEST_SUITE(TestCheckinMessage) From ea3970a7f11cd227ac55917edaa835a2a9bc4fc8 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 1 Sep 2023 04:01:32 -0400 Subject: [PATCH 11/96] TC-IDM-10.1: add checks for no unexpected global/standard range attributes (#28902) * Add checks for no unexpected global/standard range attributes * add todo * Apply suggestions from code review Co-authored-by: Tennessee Carmel-Veilleux * name the event list id * use the attribute list rather than the list of returned attributes * Split standard attr check by standard / reserved range * Remove second define. * Add manufacturer range attribute checks --------- Co-authored-by: Tennessee Carmel-Veilleux --- .../TC_DeviceBasicComposition.py | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index dd9446ddda98ee..63a03fa9c3a8d7 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -28,6 +28,7 @@ from typing import Any, Callable, Optional import chip.clusters as Clusters +import chip.clusters.ClusterObjects import chip.tlv from chip.clusters.Attribute import ValueDecodeFailure from matter_testing_support import AttributePathLocation, MatterBaseTest, async_test_body, default_matter_test_main @@ -496,6 +497,71 @@ class RequiredMandatoryAttribute: success = False continue + # Validate there are attributes in the global range that are not in the required list + allowed_globals = [a.id for a in ATTRIBUTES_TO_CHECK] + # also allow event list because it's not disallowed + event_list_id = 0xFFFA + allowed_globals.append(event_list_id) + global_range_min = 0x0000_F000 + standard_range_max = 0x000_4FFF + mei_range_min = 0x0001_0000 + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + globals = [a for a in cluster[ATTRIBUTE_LIST_ID] if a >= global_range_min and a < mei_range_min] + unexpected_globals = sorted(list(set(globals) - set(allowed_globals))) + for unexpected in unexpected_globals: + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=unexpected) + self.record_error(self.get_test_name(), location=location, + problem=f"Unexpected global attribute {unexpected} in cluster {cluster_id}", spec_location="Global elements") + success = False + + # validate that all the returned attributes in the standard clusters contain only known attribute ids + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + if cluster_id not in chip.clusters.ClusterObjects.ALL_ATTRIBUTES: + # Skip clusters that are not part of the standard generated corpus (e.g. MS clusters) + continue + standard_attributes = [a for a in cluster[ATTRIBUTE_LIST_ID] if a <= standard_range_max] + allowed_standard_attributes = chip.clusters.ClusterObjects.ALL_ATTRIBUTES[cluster_id] + unexpected_standard_attributes = sorted(list(set(standard_attributes) - set(allowed_standard_attributes))) + for unexpected in unexpected_standard_attributes: + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=unexpected) + self.record_error(self.get_test_name(), location=location, + problem=f"Unexpected standard attribute {unexpected} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") + success = False + + # validate there are no attributes in the range between standard and global + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + bad_range_values = [a for a in cluster[ATTRIBUTE_LIST_ID] if a > standard_range_max and a < global_range_min] + for bad in bad_range_values: + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, attribute_id=bad) + self.record_error(self.get_test_name(), location=location, + problem=f"Attribute in undefined range {bad} in cluster {cluster_id}", spec_location=f"Cluster {cluster_id}") + success = False + + # Validate that any attribute in the manufacturer prefix range is in the standard suffix range. + suffix_mask = 0x000_FFFF + for endpoint_id, endpoint in self.endpoints_tlv.items(): + for cluster_id, cluster in endpoint.items(): + manufacturer_range_values = [a for a in cluster[ATTRIBUTE_LIST_ID] if a > mei_range_min] + for manufacturer_value in manufacturer_range_values: + suffix = manufacturer_value & suffix_mask + location = AttributePathLocation(endpoint_id=endpoint_id, cluster_id=cluster_id, + attribute_id=manufacturer_value) + if suffix > standard_range_max and suffix < global_range_min: + self.record_error(self.get_test_name(), location=location, + problem=f"Manufacturer attribute in undefined range {manufacturer_value} in cluster {cluster_id}", + spec_location=f"Cluster {cluster_id}") + success = False + elif suffix >= global_range_min: + self.record_error(self.get_test_name(), location=location, + problem=f"Manufacturer attribute in global range {manufacturer_value} in cluster {cluster_id}", + spec_location=f"Cluster {cluster_id}") + success = False + + # TODO: maybe while we're at it, we should check that the command list doesn't contain unexpected commands. + # Validate presence of claimed attributes if success: # TODO: Also check the reverse: that each attribute appears in the AttributeList. From ddb9c770419f9eeaaa2860de116d08ea05d4ac96 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 1 Sep 2023 09:50:17 -0400 Subject: [PATCH 12/96] Fix standard naming for ember status codes (#29013) * s/STATE/STATUS * Undo submodule change --- src/app/util/af-enums.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/util/af-enums.h b/src/app/util/af-enums.h index 27a9c76855bfee..bb694ac31b333b 100644 --- a/src/app/util/af-enums.h +++ b/src/app/util/af-enums.h @@ -67,6 +67,6 @@ enum EmberAfStatus : uint8_t EMBER_ZCL_STATUS_PATHS_EXHAUSTED = 0xC8, EMBER_ZCL_STATUS_TIMED_REQUEST_MISMATCH = 0xC9, EMBER_ZCL_STATUS_FAILSAFE_REQUIRED = 0xCA, - EMBER_ZCL_STATE_INVALID_IN_STATE = 0xCB, + EMBER_ZCL_STATUS_INVALID_IN_STATE = 0xCB, EMBER_ZCL_STATUS_WRITE_IGNORED = 0xF0, // NOT SPEC COMPLIANT FOR TEST ONLY }; From 24a694238872f980d972aed8452fdea6b4f7e37b Mon Sep 17 00:00:00 2001 From: William Date: Fri, 1 Sep 2023 15:26:39 +0100 Subject: [PATCH 13/96] AirQuality: fixed typo where the air-quality-server was added to the wrong cluster. (#29006) --- src/app/zap_cluster_list.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 44109ba4634ab1..9cec759b259d71 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -115,14 +115,14 @@ "ServerDirectories": { "ACCESS_CONTROL_CLUSTER": ["access-control-server"], "ACCOUNT_LOGIN_CLUSTER": ["account-login-server"], - "ACTIONS_CLUSTER": ["air-quality-server"], + "ACTIONS_CLUSTER": [], "ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER": [ "resource-monitoring-server" ], "ADMINISTRATOR_COMMISSIONING_CLUSTER": [ "administrator-commissioning-server" ], - "AIR_QUALITY_CLUSTER": [], + "AIR_QUALITY_CLUSTER": ["air-quality-server"], "ALARM_CLUSTER": [], "APPLICATION_BASIC_CLUSTER": ["application-basic-server"], "APPLICATION_LAUNCHER_CLUSTER": ["application-launcher-server"], From 985794a2fd2cda29dee32a6288a2b1ea80fdf4cf Mon Sep 17 00:00:00 2001 From: William Date: Fri, 1 Sep 2023 15:27:34 +0100 Subject: [PATCH 14/96] Fix/post pr 28707 comments (#28993) * AitQuality: Changed the feature attribute type to a BitMask of the Feature type. Fixed bug in the UpdateAirQuality method where checks where made against an incorrect enum. * Added an out-of-band API to set the AirQuality attribute in the linux all-clusters-app. * Added a check to ensure that the value given to UpdateAirQuality is not beyond the list of acceptable enums. * Restyled by clang-format * AirQuality: Renamed the out-of-band message's key Co-authored-by: Boris Zbarsky * AirQuality: Moved the check for the valid enum value in the switch statement. * Restyled by clang-format --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .../include/air-quality-instance.h | 2 ++ .../src/air-quality-instance.cpp | 7 ++++- .../linux/AllClustersCommandDelegate.cpp | 26 +++++++++++++++++++ .../linux/AllClustersCommandDelegate.h | 5 ++++ .../air-quality-server/air-quality-server.cpp | 23 +++++++++------- .../air-quality-server/air-quality-server.h | 6 ++--- 6 files changed, 56 insertions(+), 13 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/include/air-quality-instance.h b/examples/all-clusters-app/all-clusters-common/include/air-quality-instance.h index eb2b7c89288da4..8480fd61509ab8 100644 --- a/examples/all-clusters-app/all-clusters-common/include/air-quality-instance.h +++ b/examples/all-clusters-app/all-clusters-common/include/air-quality-instance.h @@ -7,6 +7,8 @@ namespace app { namespace Clusters { namespace AirQuality { +Instance * GetInstance(); + void Shutdown(); } // namespace AirQuality diff --git a/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp b/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp index eb5f4dc5607dc3..c78f34e9a8f31f 100644 --- a/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp @@ -5,6 +5,11 @@ using namespace chip::app::Clusters::AirQuality; Instance * gAirQualityCluster = nullptr; +Instance * AirQuality::GetInstance() +{ + return gAirQualityCluster; +} + void AirQuality::Shutdown() { if (gAirQualityCluster != nullptr) @@ -20,6 +25,6 @@ void emberAfAirQualityClusterInitCallback(chip::EndpointId endpointId) VerifyOrDie(gAirQualityCluster == nullptr); chip::BitMask airQualityFeatures(Feature::kModerate, Feature::kFair, Feature::kVeryPoor, Feature::kExtremelyPoor); - gAirQualityCluster = new Instance(1, airQualityFeatures.Raw()); + gAirQualityCluster = new Instance(1, airQualityFeatures); gAirQualityCluster->Init(); } diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp index 19c8635a6b665e..39e3516ada4c96 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -164,6 +165,19 @@ void AllClustersAppCommandHandler::HandleCommand(intptr_t context) } self->OnModeChangeHandler(device, type, mode); } + else if (name == "SetAirQuality") + { + Json::Value jsonAirQualityEnum = self->mJsonValue["NewValue"]; + + if (jsonAirQualityEnum.isNull()) + { + ChipLogError(NotSpecified, "The SetAirQuality command requires the NewValue key."); + } + else + { + self->OnAirQualityChange(static_cast(jsonAirQualityEnum.asUInt())); + } + } else { ChipLogError(NotSpecified, "Unhandled command: Should never happens"); @@ -414,6 +428,18 @@ void AllClustersAppCommandHandler::OnModeChangeHandler(std::string device, std:: } } +void AllClustersAppCommandHandler::OnAirQualityChange(uint32_t aNewValue) +{ + AirQuality::Instance * airQualityInstance = AirQuality::GetInstance(); + Protocols::InteractionModel::Status status = + airQualityInstance->UpdateAirQuality(static_cast(aNewValue)); + + if (status != Protocols::InteractionModel::Status::Success) + { + ChipLogDetail(NotSpecified, "Invalid value: %u", aNewValue); + } +} + void AllClustersCommandDelegate::OnEventCommandReceived(const char * json) { auto handler = AllClustersAppCommandHandler::FromJSON(json); diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h index 20b2ab731b75d3..7998cd15581a74 100644 --- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h +++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h @@ -93,6 +93,11 @@ class AllClustersAppCommandHandler * Should be called when it is necessary to change the mode to manual operation. */ void OnModeChangeHandler(std::string device, std::string type, chip::app::DataModel::Nullable mode); + + /** + * Should be called when it is necessary to change the air quality attribute. + */ + void OnAirQualityChange(uint32_t aEnum); }; class AllClustersCommandDelegate : public NamedPipeCommandDelegate diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 938c158e49ca56..875bd4c4dfa9bb 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -32,7 +32,7 @@ namespace app { namespace Clusters { namespace AirQuality { -Instance::Instance(EndpointId aEndpointId, uint32_t aFeature) : +Instance::Instance(EndpointId aEndpointId, BitMask aFeature) : AttributeAccessInterface(Optional(aEndpointId), Id), mEndpointId(aEndpointId), mFeature(aFeature) {} @@ -51,9 +51,9 @@ CHIP_ERROR Instance::Init() return CHIP_NO_ERROR; } -bool Instance::HasFeature(AirQualityEnum aFeature) const +bool Instance::HasFeature(Feature aFeature) const { - return mFeature & to_underlying(aFeature); + return mFeature.Has(aFeature); } Protocols::InteractionModel::Status Instance::UpdateAirQuality(AirQualityEnum aNewAirQuality) @@ -62,35 +62,40 @@ Protocols::InteractionModel::Status Instance::UpdateAirQuality(AirQualityEnum aN switch (aNewAirQuality) { case AirQualityEnum::kFair: { - if (!HasFeature(AirQualityEnum::kFair)) + if (!HasFeature(Feature::kFair)) { return Protocols::InteractionModel::Status::ConstraintError; } } break; case AirQualityEnum::kModerate: { - if (!HasFeature(AirQualityEnum::kModerate)) + if (!HasFeature(Feature::kModerate)) { return Protocols::InteractionModel::Status::ConstraintError; } } break; - case AirQualityEnum::kPoor: { - if (!HasFeature(AirQualityEnum::kPoor)) + case AirQualityEnum::kVeryPoor: { + if (!HasFeature(Feature::kVeryPoor)) { return Protocols::InteractionModel::Status::ConstraintError; } } break; case AirQualityEnum::kExtremelyPoor: { - if (!HasFeature(AirQualityEnum::kExtremelyPoor)) + if (!HasFeature(Feature::kExtremelyPoor)) { return Protocols::InteractionModel::Status::ConstraintError; } } break; - default: + case AirQualityEnum::kUnknown: + case AirQualityEnum::kGood: + case AirQualityEnum::kPoor: break; + default: { + return Protocols::InteractionModel::Status::InvalidValue; + } } mAirQuality = aNewAirQuality; diff --git a/src/app/clusters/air-quality-server/air-quality-server.h b/src/app/clusters/air-quality-server/air-quality-server.h index 90abf3b17e290a..d14d4e52a351a0 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.h +++ b/src/app/clusters/air-quality-server/air-quality-server.h @@ -34,7 +34,7 @@ class Instance : public AttributeAccessInterface * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. * @param aFeature The bitmask value that identifies which features are supported by this instance. */ - Instance(EndpointId aEndpointId, uint32_t eFeature); + Instance(EndpointId aEndpointId, BitMask aFeature); ~Instance() override; @@ -49,7 +49,7 @@ class Instance : public AttributeAccessInterface * Returns true if the feature is supported. * @param feature the feature to check. */ - bool HasFeature(AirQualityEnum) const; + bool HasFeature(Feature aFeature) const; /** * Sets the AirQuality attribute. @@ -66,7 +66,7 @@ class Instance : public AttributeAccessInterface private: EndpointId mEndpointId; AirQualityEnum mAirQuality = AirQualityEnum::kUnknown; - uint32_t mFeature; + BitMask mFeature; // AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; From f2ce180b785377457c9831da73e46e1dfdf06021 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 1 Sep 2023 07:29:09 -0700 Subject: [PATCH 15/96] Fix failing to find Optional class issue (#28991) --- src/lib/support/JniReferences.cpp | 35 +++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index de61a98d74641d..870ec3fc2d1d56 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ +#include #include #include #include @@ -79,8 +80,17 @@ CHIP_ERROR JniReferences::GetClassRef(JNIEnv * env, const char * clsType, jclass CHIP_ERROR err = CHIP_NO_ERROR; jclass cls = nullptr; - cls = env->FindClass(clsType); - env->ExceptionClear(); + // Try `j$/util/Optional` when enabling Java8. + if (strcmp(clsType, "java/util/Optional") == 0) + { + cls = env->FindClass("j$/util/Optional"); + } + + if (cls == nullptr) + { + env->ExceptionClear(); + cls = env->FindClass(clsType); + } if (cls == nullptr) { @@ -121,6 +131,20 @@ CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * VerifyOrReturnError(javaClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); *methodId = env->GetMethodID(javaClass, methodName, methodSignature); + + // Try `j$` when enabling Java8. + std::string methodSignature_java8_str(methodSignature); + if (*methodId == nullptr && methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + { + // Replace all "java/util/Optional" with "j$/util/Optional". + while (methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + { + size_t pos = methodSignature_java8_str.find("java/util/Optional"); + methodSignature_java8_str.replace(pos, strlen("java/util/Optional"), "j$/util/Optional"); + } + *methodId = env->GetMethodID(javaClass, methodName, methodSignature_java8_str.c_str()); + } + VerifyOrReturnError(*methodId != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); return err; @@ -193,6 +217,13 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti chip::JniClass jniClass(optionalCls); jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + + // Try `Lj$/util/Optional;` when enabling Java8. + if (ofMethod == nullptr) + { + ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); + } + VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); outOptional = env->CallStaticObjectMethod(optionalCls, ofMethod, objectToWrap); From 32bd91387a33867e049b4c3b7be24b73c500cc68 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 10:30:35 -0400 Subject: [PATCH 16/96] Update ZAP to v2023.08.30-nightly. (#28988) This fixes non-determinism in .zap files, so they will stop changing every time they are opened/closed. Fixes https://github.com/project-chip/connectedhomeip/issues/28967 --- .../air-quality-sensor-app.zap | 237 ++++++++-------- .../all-clusters-common/all-clusters-app.zap | 31 +- .../all-clusters-minimal-app.zap | 39 +-- .../bridge-app/bridge-common/bridge-app.zap | 20 +- ...noip_rootnode_dimmablelight_bCwGYSDpoe.zap | 19 +- ...r_humiditysensor_thermostat_56de3d5f45.zap | 267 ++++++++---------- .../rootnode_basicvideoplayer_0ff86e943b.zap | 15 +- ...tnode_colortemperaturelight_hbUnzYVeyn.zap | 19 +- .../rootnode_contactsensor_lFAGG1bfRO.zap | 15 +- .../rootnode_dimmablelight_bCwGYSDpoe.zap | 15 +- .../rootnode_dishwasher_cc105034fe.zap | 21 +- .../devices/rootnode_doorlock_aNKYAreMXE.zap | 15 +- ...rootnode_extendedcolorlight_8lcaaYJVAa.zap | 15 +- .../chef/devices/rootnode_fan_7N2TobIlOX.zap | 15 +- .../rootnode_flowsensor_1zVxHedlaV.zap | 15 +- ...rootnode_heatingcoolingunit_ncdGai1E5a.zap | 15 +- .../rootnode_humiditysensor_Xyj4gda6Hb.zap | 15 +- .../rootnode_laundrywasher_fb10d238c8.zap | 19 +- .../rootnode_lightsensor_lZQycTFcJK.zap | 15 +- .../rootnode_occupancysensor_iHyVgifZuo.zap | 15 +- .../rootnode_onofflight_bbs1b7IaOV.zap | 15 +- .../rootnode_onofflightswitch_FsPlMr090Q.zap | 15 +- .../rootnode_onoffpluginunit_Wtf8ss5EBY.zap | 19 +- .../rootnode_pressuresensor_s0qC9wLH4k.zap | 15 +- .../chef/devices/rootnode_pump_a811bb33a0.zap | 19 +- ...emperaturecontrolledcabinet_ffdb696680.zap | 33 +-- ...otnode_roboticvacuumcleaner_1807ff0c49.zap | 15 +- ...rootnode_roomairconditioner_9cf3607804.zap | 15 +- .../rootnode_smokecoalarm_686fe0dcb8.zap | 31 +- .../devices/rootnode_speaker_RpzeXdimqA.zap | 19 +- .../rootnode_temperaturesensor_Qy1zkNW7c3.zap | 15 +- .../rootnode_thermostat_bm3fb8dhYi.zap | 31 +- .../rootnode_windowcovering_RLCxaGi9Yx.zap | 15 +- examples/chef/devices/template.zap | 15 +- .../contact-sensor-app.zap | 15 +- .../dishwasher-common/dishwasher-app.zap | 19 +- .../light-switch-common/light-switch-app.zap | 24 +- .../data_model/lighting-app-thread.zap | 15 +- .../data_model/lighting-app-wifi.zap | 19 +- .../lighting-common/lighting-app.zap | 19 +- .../lighting-app/nxp/zap/lighting-on-off.zap | 19 +- examples/lighting-app/qpg/zap/light.zap | 15 +- .../silabs/data_model/lighting-thread-app.zap | 17 +- .../silabs/data_model/lighting-wifi-app.zap | 17 +- examples/lock-app/lock-common/lock-app.zap | 19 +- examples/lock-app/nxp/zap/lock-app.zap | 19 +- examples/lock-app/qpg/zap/lock.zap | 15 +- .../log-source-common/log-source-app.zap | 10 +- .../ota-provider-common/ota-provider-app.zap | 10 +- .../ota-requestor-app.zap | 20 +- .../placeholder/linux/apps/app1/config.zap | 17 +- .../placeholder/linux/apps/app2/config.zap | 21 +- examples/pump-app/pump-common/pump-app.zap | 15 +- .../silabs/data_model/pump-thread-app.zap | 15 +- .../silabs/data_model/pump-wifi-app.zap | 19 +- .../pump-controller-app.zap | 15 +- .../resource-monitoring-app.zap | 15 +- .../smoke-co-alarm-app.zap | 17 +- .../temperature-measurement.zap | 15 +- .../thermostat-common/thermostat.zap | 31 +- examples/tv-app/tv-common/tv-app.zap | 33 +-- .../tv-casting-common/tv-casting-app.zap | 15 +- .../virtual-device-app.zap | 19 +- examples/window-app/common/window-app.zap | 26 +- scripts/setup/zap.json | 4 +- scripts/setup/zap.version | 2 +- .../zap/tests/inputs/all-clusters-app.zap | 39 +-- .../tools/zap/tests/inputs/lighting-app.zap | 19 +- scripts/tools/zap/zap_execution.py | 2 +- .../data_model/controller-clusters.zap | 232 ++++++++------- 70 files changed, 552 insertions(+), 1400 deletions(-) diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index e38e25ea76d399..2943227d356225 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5538,7 +5533,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 46, "code": 44, "profileId": 259, "label": "MA-air-quality-sensor", @@ -5546,16 +5540,12 @@ }, "deviceTypes": [ { - "id": 46, "code": 44, "profileId": 259, "label": "MA-air-quality-sensor", "name": "MA-air-quality-sensor" } ], - "deviceTypeRefs": [ - 46 - ], "deviceVersions": [ 1 ], @@ -5813,7 +5803,7 @@ "side": "server", "type": "AirQualityEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6401,7 +6391,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6417,7 +6407,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6433,7 +6423,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6449,7 +6439,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6465,7 +6455,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -6481,7 +6471,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6497,7 +6487,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -6513,7 +6503,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6529,7 +6519,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6545,7 +6535,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6561,7 +6551,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6725,7 +6715,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6741,7 +6731,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6757,7 +6747,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -6773,7 +6763,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6789,7 +6779,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -6805,7 +6795,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -6821,7 +6811,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -6837,7 +6827,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6853,7 +6843,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6869,7 +6859,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -6885,7 +6875,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7049,7 +7039,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7065,7 +7055,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7081,7 +7071,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7097,7 +7087,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7113,7 +7103,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7129,7 +7119,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7145,7 +7135,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7161,7 +7151,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7177,7 +7167,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7193,7 +7183,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7209,7 +7199,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7373,7 +7363,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7389,7 +7379,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7405,7 +7395,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7421,7 +7411,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7437,7 +7427,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7453,7 +7443,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7469,7 +7459,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7485,7 +7475,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7501,7 +7491,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7517,7 +7507,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7533,7 +7523,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7697,7 +7687,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7713,7 +7703,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7729,7 +7719,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -7745,7 +7735,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7761,7 +7751,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7777,7 +7767,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7793,7 +7783,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -7809,7 +7799,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7825,7 +7815,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7841,7 +7831,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -7857,7 +7847,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8021,7 +8011,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8037,7 +8027,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8053,7 +8043,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8069,7 +8059,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8085,7 +8075,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8101,7 +8091,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8117,7 +8107,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8133,7 +8123,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8149,7 +8139,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8165,7 +8155,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8181,7 +8171,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8345,7 +8335,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8361,7 +8351,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8377,7 +8367,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8393,7 +8383,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8409,7 +8399,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8425,7 +8415,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8441,7 +8431,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8457,7 +8447,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8473,7 +8463,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8489,7 +8479,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8505,7 +8495,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8669,7 +8659,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8685,7 +8675,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8701,7 +8691,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -8717,7 +8707,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8733,7 +8723,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8749,7 +8739,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8765,7 +8755,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -8781,7 +8771,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8797,7 +8787,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8813,7 +8803,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8829,7 +8819,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -8993,7 +8983,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9009,7 +8999,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9025,7 +9015,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9041,7 +9031,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9057,7 +9047,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -9073,7 +9063,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9089,7 +9079,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -9105,7 +9095,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9121,7 +9111,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9137,7 +9127,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9153,7 +9143,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9317,7 +9307,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9333,7 +9323,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9349,7 +9339,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -9365,7 +9355,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9381,7 +9371,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -9397,7 +9387,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -9413,7 +9403,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -9429,7 +9419,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9445,7 +9435,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9461,7 +9451,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9477,7 +9467,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -9602,6 +9592,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file 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 071729a8462b69..570a4984aa0c45 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 @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -10505,7 +10498,6 @@ "id": 4, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -10513,24 +10505,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -30606,7 +30592,6 @@ "id": 3, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -30614,24 +30599,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -34890,7 +34869,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -34898,16 +34876,12 @@ }, "deviceTypes": [ { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" } ], - "deviceTypeRefs": [ - 53 - ], "deviceVersions": [ 1 ], @@ -35418,6 +35392,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 604607cd491c93..f2658e0fb018c8 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -9554,10 +9547,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -9565,24 +9557,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -22799,10 +22785,9 @@ ] }, { - "id": 4, + "id": 3, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -22810,24 +22795,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -27083,10 +27062,9 @@ ] }, { - "id": 3, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -27094,16 +27072,12 @@ }, "deviceTypes": [ { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" } ], - "deviceTypeRefs": [ - 53 - ], "deviceVersions": [ 1 ], @@ -27614,6 +27588,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 23e72383183ab3..496d4002d95555 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-bridge", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5047,7 +5042,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 6, "code": 14, "profileId": 259, "label": "MA-aggregator", @@ -5055,16 +5049,12 @@ }, "deviceTypes": [ { - "id": 6, "code": 14, "profileId": 259, "label": "MA-aggregator", "name": "MA-aggregator" } ], - "deviceTypeRefs": [ - 6 - ], "deviceVersions": [ 1 ], @@ -5806,7 +5796,6 @@ "id": 3, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5814,16 +5803,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7697,6 +7682,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 3d3e8fca35cf16..0b878ebd10de52 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5443,10 +5438,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5454,16 +5448,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7562,6 +7552,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap index 95485d649df1d5..27843c4d757b5a 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5420,10 +5415,9 @@ ] }, { - "id": 6, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 45, "code": 45, "profileId": 259, "label": "MA-air-purifier", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 45, "code": 45, "profileId": 259, "label": "MA-air-purifier", "name": "MA-air-purifier" } ], - "deviceTypeRefs": [ - 45 - ], "deviceVersions": [ 1 ], @@ -10936,10 +10926,9 @@ ] }, { - "id": 2, + "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 46, "code": 44, "profileId": 259, "label": "MA-air-quality-sensor", @@ -10947,16 +10936,12 @@ }, "deviceTypes": [ { - "id": 46, "code": 44, "profileId": 259, "label": "MA-air-quality-sensor", "name": "MA-air-quality-sensor" } ], - "deviceTypeRefs": [ - 46 - ], "deviceVersions": [ 1 ], @@ -11442,7 +11427,7 @@ "side": "server", "type": "AirQualityEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12030,7 +12015,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12046,7 +12031,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12062,7 +12047,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12078,7 +12063,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12094,7 +12079,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12110,7 +12095,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12126,7 +12111,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12142,7 +12127,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12158,7 +12143,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12174,7 +12159,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12190,7 +12175,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12354,7 +12339,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12370,7 +12355,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12386,7 +12371,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12402,7 +12387,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12418,7 +12403,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12434,7 +12419,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12450,7 +12435,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12466,7 +12451,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12482,7 +12467,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12498,7 +12483,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12514,7 +12499,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12678,7 +12663,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12694,7 +12679,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12710,7 +12695,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12726,7 +12711,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12742,7 +12727,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12758,7 +12743,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -12774,7 +12759,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -12790,7 +12775,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12806,7 +12791,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12822,7 +12807,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -12838,7 +12823,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13002,7 +12987,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13018,7 +13003,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13034,7 +13019,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13050,7 +13035,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13066,7 +13051,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13082,7 +13067,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13098,7 +13083,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13114,7 +13099,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13130,7 +13115,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13146,7 +13131,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13162,7 +13147,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13326,7 +13311,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13342,7 +13327,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13358,7 +13343,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13374,7 +13359,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13390,7 +13375,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13406,7 +13391,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13422,7 +13407,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13438,7 +13423,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13454,7 +13439,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13470,7 +13455,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13486,7 +13471,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13650,7 +13635,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13666,7 +13651,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13682,7 +13667,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13698,7 +13683,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13714,7 +13699,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13730,7 +13715,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13746,7 +13731,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -13762,7 +13747,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13778,7 +13763,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13794,7 +13779,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13810,7 +13795,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -13974,7 +13959,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -13990,7 +13975,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14006,7 +13991,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14022,7 +14007,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14038,7 +14023,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14054,7 +14039,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14070,7 +14055,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14086,7 +14071,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14102,7 +14087,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14118,7 +14103,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14134,7 +14119,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14298,7 +14283,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14314,7 +14299,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14330,7 +14315,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14346,7 +14331,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14362,7 +14347,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14378,7 +14363,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14394,7 +14379,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14410,7 +14395,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14426,7 +14411,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14442,7 +14427,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14458,7 +14443,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14622,7 +14607,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14638,7 +14623,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14654,7 +14639,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14670,7 +14655,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14686,7 +14671,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14702,7 +14687,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14718,7 +14703,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -14734,7 +14719,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14750,7 +14735,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14766,7 +14751,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14782,7 +14767,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -14946,7 +14931,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14962,7 +14947,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14978,7 +14963,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -14994,7 +14979,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -15010,7 +14995,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -15026,7 +15011,7 @@ "side": "server", "type": "single", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -15042,7 +15027,7 @@ "side": "server", "type": "elapsed_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -15058,7 +15043,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -15074,7 +15059,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -15090,7 +15075,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -15106,7 +15091,7 @@ "side": "server", "type": "LevelValueEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -15216,10 +15201,9 @@ ] }, { - "id": 5, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", @@ -15227,16 +15211,12 @@ }, "deviceTypes": [ { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", "name": "MA-tempsensor" } ], - "deviceTypeRefs": [ - 24 - ], "deviceVersions": [ 1 ], @@ -15888,10 +15868,9 @@ ] }, { - "id": 3, + "id": 5, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 27, "code": 775, "profileId": 259, "label": "MA-humiditysensor", @@ -15899,16 +15878,12 @@ }, "deviceTypes": [ { - "id": 27, "code": 775, "profileId": 259, "label": "MA-humiditysensor", "name": "MA-humiditysensor" } ], - "deviceTypeRefs": [ - 27 - ], "deviceVersions": [ 1 ], @@ -16560,10 +16535,9 @@ ] }, { - "id": 4, + "id": 6, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 34, "code": 769, "profileId": 259, "label": "MA-thermostat", @@ -16571,16 +16545,12 @@ }, "deviceTypes": [ { - "id": 34, "code": 769, "profileId": 259, "label": "MA-thermostat", "name": "MA-thermostat" } ], - "deviceTypeRefs": [ - 34 - ], "deviceVersions": [ 1 ], @@ -18121,6 +18091,5 @@ "endpointId": 5, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index e6e64d2c301452..6045c6ad877191 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 37, "code": 40, "profileId": 259, "label": "MA-basic-videoplayer", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 37, "code": 40, "profileId": 259, "label": "MA-basic-videoplayer", "name": "MA-basic-videoplayer" } ], - "deviceTypeRefs": [ - 37 - ], "deviceVersions": [ 1 ], @@ -7549,6 +7539,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 019dc0f1a093be..4f2688c3b159be 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5420,10 +5415,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 10, "code": 268, "profileId": 259, "label": "MA-colortemperaturelight", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 10, "code": 268, "profileId": 259, "label": "MA-colortemperaturelight", "name": "MA-colortemperaturelight" } ], - "deviceTypeRefs": [ - 10 - ], "deviceVersions": [ 1 ], @@ -8361,6 +8351,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 3dcf59c84cbd54..6e47cdf3658dd9 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 21, "code": 21, "profileId": 259, "label": "MA-contactsensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 21, "code": 21, "profileId": 259, "label": "MA-contactsensor", "name": "MA-contactsensor" } ], - "deviceTypeRefs": [ - 21 - ], "deviceVersions": [ 1 ], @@ -6367,6 +6357,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index fb42122deb047e..df5f636f2ef587 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5471,7 +5466,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5479,16 +5473,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7587,6 +7577,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 765e9fdd9a3550..6f88ca3d61b5f0 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 13, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 14, + "id": 2, "name": "MA-dishwasher", "deviceTypeRef": { - "id": 47, "code": 117, "profileId": 259, "label": "MA-dishwasher", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 47, "code": 117, "profileId": 259, "label": "MA-dishwasher", "name": "MA-dishwasher" } ], - "deviceTypeRefs": [ - 47 - ], "deviceVersions": [ 1 ], @@ -10843,6 +10833,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] -} + ] +} \ No newline at end of file diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index 87dfc871a3f41d..bd3428ab431c05 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", "name": "MA-doorlock" } ], - "deviceTypeRefs": [ - 29 - ], "deviceVersions": [ 1 ], @@ -9360,6 +9350,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 0242e62528f3ef..369c83511afb78 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", "name": "MA-extendedcolorlight" } ], - "deviceTypeRefs": [ - 11 - ], "deviceVersions": [ 1 ], @@ -8657,6 +8647,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index 762dfc66f57466..aef5ca08518b80 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5471,7 +5466,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 35, "code": 43, "profileId": 259, "label": "MA-fan", @@ -5479,16 +5473,12 @@ }, "deviceTypes": [ { - "id": 35, "code": 43, "profileId": 259, "label": "MA-fan", "name": "MA-fan" } ], - "deviceTypeRefs": [ - 35 - ], "deviceVersions": [ 1 ], @@ -6435,6 +6425,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 1597985398042a..3afd3a506d9ab1 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 26, "code": 774, "profileId": 259, "label": "MA-flowsensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 26, "code": 774, "profileId": 259, "label": "MA-flowsensor", "name": "MA-flowsensor" } ], - "deviceTypeRefs": [ - 26 - ], "deviceVersions": [ 1 ], @@ -6415,6 +6405,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index e80e5499b9da48..6971f422bb4ab8 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 33, "code": 768, "profileId": 259, "label": "MA-heatcool", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 33, "code": 768, "profileId": 259, "label": "MA-heatcool", "name": "MA-heatcool" } ], - "deviceTypeRefs": [ - 33 - ], "deviceVersions": [ 1 ], @@ -8235,6 +8225,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 361b2e2521fabf..b878d6770ff778 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 27, "code": 775, "profileId": 259, "label": "MA-humiditysensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 27, "code": 775, "profileId": 259, "label": "MA-humiditysensor", "name": "MA-humiditysensor" } ], - "deviceTypeRefs": [ - 27 - ], "deviceVersions": [ 1 ], @@ -6415,6 +6405,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 8bae0a9da88e68..4f2b6a4014c1a2 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 8, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 7, + "id": 2, "name": "MA-laundry-washer", "deviceTypeRef": { - "id": 49, "code": 115, "profileId": 259, "label": "MA-laundry-washer", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 49, "code": 115, "profileId": 259, "label": "MA-laundry-washer", "name": "MA-laundry-washer" } ], - "deviceTypeRefs": [ - 49 - ], "deviceVersions": [ 1 ], @@ -11091,6 +11081,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index 891c8c063506c4..ec99ca3fb42fb7 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 22, "code": 262, "profileId": 259, "label": "MA-lightsensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 22, "code": 262, "profileId": 259, "label": "MA-lightsensor", "name": "MA-lightsensor" } ], - "deviceTypeRefs": [ - 22 - ], "deviceVersions": [ 1 ], @@ -6431,6 +6421,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index b335ca316d508a..e542652c31f056 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 23, "code": 263, "profileId": 259, "label": "MA-occupancysensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 23, "code": 263, "profileId": 259, "label": "MA-occupancysensor", "name": "MA-occupancysensor" } ], - "deviceTypeRefs": [ - 23 - ], "deviceVersions": [ 1 ], @@ -6543,6 +6533,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index d10bd7429a360f..8f2c4aa64fd79a 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" } ], - "deviceTypeRefs": [ - 8 - ], "deviceVersions": [ 1 ], @@ -7539,6 +7529,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index 0f87ab83f0f976..993b6fba9bc591 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", "name": "MA-onofflightswitch" } ], - "deviceTypeRefs": [ - 15 - ], "deviceVersions": [ 1 ], @@ -7539,6 +7529,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index d19660dd111a65..669e146e5966d9 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5420,10 +5415,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 12, "code": 266, "profileId": 259, "label": "MA-onoffpluginunit", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 12, "code": 266, "profileId": 259, "label": "MA-onoffpluginunit", "name": "MA-onoffpluginunit" } ], - "deviceTypeRefs": [ - 12 - ], "deviceVersions": [ 1 ], @@ -7215,6 +7205,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 838e3561b1c506..3d1e2b9935f3b5 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 25, "code": 773, "profileId": 259, "label": "MA-pressuresensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 25, "code": 773, "profileId": 259, "label": "MA-pressuresensor", "name": "MA-pressuresensor" } ], - "deviceTypeRefs": [ - 25 - ], "deviceVersions": [ 1 ], @@ -6495,6 +6485,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_a811bb33a0.zap b/examples/chef/devices/rootnode_pump_a811bb33a0.zap index f03f07603a394a..025f35026f65f8 100644 --- a/examples/chef/devices/rootnode_pump_a811bb33a0.zap +++ b/examples/chef/devices/rootnode_pump_a811bb33a0.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6241,10 +6236,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -6252,16 +6246,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -7586,6 +7576,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index 75587fe72f54a8..b7af38a37391f0 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 8, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 7, + "id": 2, "name": "MA-refrigerator", "deviceTypeRef": { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", "name": "MA-refrigerator" } ], - "deviceTypeRefs": [ - 48 - ], "deviceVersions": [ 1 ], @@ -11686,10 +11676,9 @@ ] }, { - "id": 5, + "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -11697,16 +11686,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12202,10 +12187,9 @@ ] }, { - "id": 6, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -12213,16 +12197,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12747,6 +12727,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap index ee7762e4f302ef..9c8af2af0a8813 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 50, "code": 116, "profileId": 259, "label": "MA-robotic-vacuum-cleaner", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 50, "code": 116, "profileId": 259, "label": "MA-robotic-vacuum-cleaner", "name": "MA-robotic-vacuum-cleaner" } ], - "deviceTypeRefs": [ - 50 - ], "deviceVersions": [ 1 ], @@ -10891,6 +10881,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap index a912923932502d..2d8721152ec487 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 43, "code": 114, "profileId": 259, "label": "MA-room-airconditioner", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 43, "code": 114, "profileId": 259, "label": "MA-room-airconditioner", "name": "MA-room-airconditioner" } ], - "deviceTypeRefs": [ - 43 - ], "deviceVersions": [ 1 ], @@ -11617,6 +11607,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap index bb5372c901a309..9903f33942ae14 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 10, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5420,10 +5415,9 @@ ] }, { - "id": 9, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -5431,24 +5425,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 44, "code": 118, "profileId": 259, "label": "MA-smokecoalarm", "name": "MA-smokecoalarm" } ], - "deviceTypeRefs": [ - 3, - 44 - ], "deviceVersions": [ 1, 1 @@ -5540,7 +5528,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -5556,7 +5544,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0x0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7060,7 +7048,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7076,7 +7064,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -7092,7 +7080,7 @@ "singleton": 0, "bounded": 0, "defaultValue": "0", - "reportable": 0, + "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 @@ -11263,6 +11251,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index 227be12d36f0eb..7a3660d0ef8f51 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5420,10 +5415,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 40, "code": 34, "profileId": 259, "label": "MA-speaker", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 40, "code": 34, "profileId": 259, "label": "MA-speaker", "name": "MA-speaker" } ], - "deviceTypeRefs": [ - 40 - ], "deviceVersions": [ 1 ], @@ -6647,6 +6637,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 5e2dec02d304b1..7fb22c808eecf7 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", "name": "MA-tempsensor" } ], - "deviceTypeRefs": [ - 24 - ], "deviceVersions": [ 1 ], @@ -6415,6 +6405,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index 22f3247af489bf..470a4644e18ade 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -29,14 +23,19 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ { - "id": 7, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 55 - ], "deviceVersions": [ 1 ], @@ -5468,10 +5463,9 @@ ] }, { - "id": 8, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 87, "code": 769, "profileId": 259, "label": "MA-thermostat", @@ -5479,16 +5473,12 @@ }, "deviceTypes": [ { - "id": 87, "code": 769, "profileId": 259, "label": "MA-thermostat", "name": "MA-thermostat" } ], - "deviceTypeRefs": [ - 87 - ], "deviceVersions": [ 1 ], @@ -7895,6 +7885,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index b20b648b19452a..c829626a281d76 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", "name": "MA-windowcovering" } ], - "deviceTypeRefs": [ - 31 - ], "deviceVersions": [ 1 ], @@ -7097,6 +7087,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/template.zap b/examples/chef/devices/template.zap index daa049bec63d18..d81d430809fa5d 100644 --- a/examples/chef/devices/template.zap +++ b/examples/chef/devices/template.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5423,7 +5418,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 52, "code": 0, "profileId": 259, "label": "MA-all-clusters-app", @@ -5431,16 +5425,12 @@ }, "deviceTypes": [ { - "id": 52, "code": 0, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" } ], - "deviceTypeRefs": [ - 52 - ], "deviceVersions": [ 1 ], @@ -10123,6 +10113,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index e4ef5141fd1938..750d403a8d5764 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5414,7 +5409,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 21, "code": 21, "profileId": 259, "label": "MA-contactsensor", @@ -5422,16 +5416,12 @@ }, "deviceTypes": [ { - "id": 21, "code": 21, "profileId": 259, "label": "MA-contactsensor", "name": "MA-contactsensor" } ], - "deviceTypeRefs": [ - 21 - ], "deviceVersions": [ 1 ], @@ -8833,6 +8823,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index de954c4bb4bb69..c07689aff2ef84 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-dishwasher", "deviceTypeRef": { - "id": 47, "code": 117, "profileId": 259, "label": "MA-dishwasher", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 47, "code": 117, "profileId": 259, "label": "MA-dishwasher", "name": "MA-dishwasher" } ], - "deviceTypeRefs": [ - 47 - ], "deviceVersions": [ 1 ], @@ -10843,6 +10833,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index 5e83229e81a428..4662666352c860 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6092,10 +6087,9 @@ ] }, { - "id": 3, + "id": 2, "name": "MA-onofflightswitch", "deviceTypeRef": { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", @@ -6103,16 +6097,12 @@ }, "deviceTypes": [ { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", "name": "MA-onofflightswitch" } ], - "deviceTypeRefs": [ - 15 - ], "deviceVersions": [ 1 ], @@ -8766,10 +8756,9 @@ ] }, { - "id": 2, + "id": 3, "name": "MA-genericswitch", "deviceTypeRef": { - "id": 20, "code": 15, "profileId": 259, "label": "MA-genericswitch", @@ -8777,16 +8766,12 @@ }, "deviceTypes": [ { - "id": 20, "code": 15, "profileId": 259, "label": "MA-genericswitch", "name": "MA-genericswitch" } ], - "deviceTypeRefs": [ - 20 - ], "deviceVersions": [ 1 ], @@ -10105,6 +10090,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 779988b5bd3c0d..26f2b8f3f04044 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5467,7 +5462,6 @@ "id": 2, "name": "MA-extendedcolorlight", "deviceTypeRef": { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", @@ -5475,16 +5469,12 @@ }, "deviceTypes": [ { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", "name": "MA-extendedcolorlight" } ], - "deviceTypeRefs": [ - 11 - ], "deviceVersions": [ 1 ], @@ -8389,6 +8379,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index e5524a5ae20819..9e99cbc70f93b6 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5464,10 +5459,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-extendedcolorlight", "deviceTypeRef": { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", @@ -5475,16 +5469,12 @@ }, "deviceTypes": [ { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", "name": "MA-extendedcolorlight" } ], - "deviceTypeRefs": [ - 11 - ], "deviceVersions": [ 1 ], @@ -8389,6 +8379,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index cbac430e8a2932..bb3acbf79e8a5d 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -4753,10 +4748,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -4764,16 +4758,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7806,6 +7796,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 520039f45c8ab0..6ff41025de535f 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5512,10 +5507,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -5523,16 +5517,12 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" } ], - "deviceTypeRefs": [ - 8 - ], "deviceVersions": [ 1 ], @@ -9161,6 +9151,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index 57926603d7d604..da4aa1826cabf4 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6419,7 +6414,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", @@ -6427,16 +6421,12 @@ }, "deviceTypes": [ { - "id": 11, "code": 269, "profileId": 259, "label": "MA-extendedcolorlight", "name": "MA-extendedcolorlight" } ], - "deviceTypeRefs": [ - 11 - ], "deviceVersions": [ 1 ], @@ -10329,6 +10319,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 474821f1f1902a..9517d51134c345 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5793,7 +5788,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5801,24 +5795,18 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 9, - 3 - ], "deviceVersions": [ 1, 1 @@ -9558,6 +9546,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index 1c71379552a8b6..08d5d554c3eaeb 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5539,7 +5534,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5547,24 +5541,18 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 9, - 3 - ], "deviceVersions": [ 1, 1 @@ -9643,6 +9631,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index 5bf8b66ba66051..026f356fdba7a5 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -7308,7 +7301,6 @@ "id": 2, "name": "MA-doorlock", "deviceTypeRef": { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", @@ -7316,24 +7308,18 @@ }, "deviceTypes": [ { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", "name": "MA-doorlock" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 29, - 3 - ], "deviceVersions": [ 1, 1 @@ -10553,6 +10539,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/nxp/zap/lock-app.zap b/examples/lock-app/nxp/zap/lock-app.zap index 89b565629b61a8..af67d0da943663 100644 --- a/examples/lock-app/nxp/zap/lock-app.zap +++ b/examples/lock-app/nxp/zap/lock-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5512,10 +5507,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", @@ -5523,16 +5517,12 @@ }, "deviceTypes": [ { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", "name": "MA-doorlock" } ], - "deviceTypeRefs": [ - 29 - ], "deviceVersions": [ 1 ], @@ -6768,6 +6758,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index d0ce7a043e25d0..60987b13d94882 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6374,7 +6369,6 @@ "id": 2, "name": "MA-doorlock", "deviceTypeRef": { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", @@ -6382,16 +6376,12 @@ }, "deviceTypes": [ { - "id": 29, "code": 10, "profileId": 259, "label": "MA-doorlock", "name": "MA-doorlock" } ], - "deviceTypeRefs": [ - 29 - ], "deviceVersions": [ 1 ], @@ -9447,6 +9437,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/log-source-app/log-source-common/log-source-app.zap b/examples/log-source-app/log-source-common/log-source-app.zap index 78e05e37b1da6b..722baad868631b 100644 --- a/examples/log-source-app/log-source-common/log-source-app.zap +++ b/examples/log-source-app/log-source-common/log-source-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 52, "code": 0, "profileId": 259, "label": "MA-all-clusters-app", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 52, "code": 0, "profileId": 259, "label": "MA-all-clusters-app", "name": "MA-all-clusters-app" } ], - "deviceTypeRefs": [ - 52 - ], "deviceVersions": [ 1 ], @@ -3551,6 +3546,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap index 55f04a968f71ea..0de1ba9ca9452f 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5015,6 +5010,5 @@ "endpointId": 0, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap index 339541aa07151b..e3ce15fdd068e1 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5087,7 +5082,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", @@ -5095,16 +5089,12 @@ }, "deviceTypes": [ { - "id": 15, "code": 259, "profileId": 259, "label": "MA-onofflightswitch", "name": "MA-onofflightswitch" } ], - "deviceTypeRefs": [ - 15 - ], "deviceVersions": [ 1 ], @@ -6955,7 +6945,6 @@ "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -6963,16 +6952,12 @@ }, "deviceTypes": [ { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" } ], - "deviceTypeRefs": [ - 53 - ], "deviceVersions": [ 1 ], @@ -7540,6 +7525,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 8fc11afcb89c2f..a6d4b3a1c028c9 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -12102,7 +12095,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -12110,16 +12102,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -15950,6 +15938,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 931ee37410a193..abdf3ac2e318f4 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -12183,10 +12176,9 @@ ] }, { - "id": 1, + "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -12194,16 +12186,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -15776,6 +15764,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index af278263bea1d2..26a52650f37a3d 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-pump", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5699,7 +5694,6 @@ "id": 2, "name": "MA-pump", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -5707,16 +5701,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -8033,6 +8023,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index 8b8fc821323b64..4f943ac9a1ee32 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-pump", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5699,7 +5694,6 @@ "id": 2, "name": "MA-pump", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -5707,16 +5701,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -8033,6 +8023,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index ad985a894a1f4d..4f943ac9a1ee32 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-pump", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5696,10 +5691,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-pump", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -5707,16 +5701,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -8033,6 +8023,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap index 4ddbc45f851702..4af5b26b68f89d 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5647,7 +5642,6 @@ "id": 2, "name": "MA-pumpcontroller", "deviceTypeRef": { - "id": 19, "code": 772, "profileId": 2457, "label": "MA-pumpcontroller", @@ -5655,16 +5649,12 @@ }, "deviceTypes": [ { - "id": 19, "code": 772, "profileId": 2457, "label": "MA-pumpcontroller", "name": "MA-pumpcontroller" } ], - "deviceTypeRefs": [ - 19 - ], "deviceVersions": [ 1 ], @@ -6861,6 +6851,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 4f612e4090eeef..012f9b9557d681 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5467,7 +5462,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 35, "code": 43, "profileId": 259, "label": "MA-fan", @@ -5475,16 +5469,12 @@ }, "deviceTypes": [ { - "id": 35, "code": 43, "profileId": 259, "label": "MA-fan", "name": "MA-fan" } ], - "deviceTypeRefs": [ - 35 - ], "deviceVersions": [ 1 ], @@ -7003,6 +6993,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index f3c9f6c5f59854..aff63eb8d64de3 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5574,7 +5569,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -5582,24 +5576,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 44, "code": 118, "profileId": 259, "label": "MA-smokecoalarm", "name": "MA-smokecoalarm" } ], - "deviceTypeRefs": [ - 3, - 44 - ], "deviceVersions": [ 1, 1 @@ -7418,6 +7406,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index 1f50f0757d2ef6..28e8cd3fcf020a 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -3343,7 +3338,6 @@ "id": 2, "name": "MA-tempsensor", "deviceTypeRef": { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", @@ -3351,16 +3345,12 @@ }, "deviceTypes": [ { - "id": 24, "code": 770, "profileId": 259, "label": "MA-tempsensor", "name": "MA-tempsensor" } ], - "deviceTypeRefs": [ - 24 - ], "deviceVersions": [ 1 ], @@ -4255,6 +4245,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index 0a6a637d51fb2a..c72838cef8db59 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -29,14 +23,19 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ { - "id": 5, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 55 - ], "deviceVersions": [ 1 ], @@ -7655,10 +7650,9 @@ ] }, { - "id": 6, + "id": 2, "name": "MA-thermostat", "deviceTypeRef": { - "id": 87, "code": 769, "profileId": 259, "label": "MA-thermostat", @@ -7666,16 +7660,12 @@ }, "deviceTypes": [ { - "id": 87, "code": 769, "profileId": 259, "label": "MA-thermostat", "name": "MA-thermostat" } ], - "deviceTypeRefs": [ - 87 - ], "deviceVersions": [ 1 ], @@ -14830,6 +14820,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index d2488a3c098a12..4bda8a62fbf725 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 3, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -7437,10 +7432,9 @@ ] }, { - "id": 4, + "id": 2, "name": "MA-videoplayer", "deviceTypeRef": { - "id": 36, "code": 35, "profileId": 259, "label": "MA-casting-videoplayer", @@ -7448,16 +7442,12 @@ }, "deviceTypes": [ { - "id": 36, "code": 35, "profileId": 259, "label": "MA-casting-videoplayer", "name": "MA-casting-videoplayer" } ], - "deviceTypeRefs": [ - 36 - ], "deviceVersions": [ 1 ], @@ -9793,10 +9783,9 @@ ] }, { - "id": 1, + "id": 3, "name": "MA-speaker", "deviceTypeRef": { - "id": 40, "code": 34, "profileId": 259, "label": "MA-speaker", @@ -9804,16 +9793,12 @@ }, "deviceTypes": [ { - "id": 40, "code": 34, "profileId": 259, "label": "MA-speaker", "name": "MA-speaker" } ], - "deviceTypeRefs": [ - 40 - ], "deviceVersions": [ 1 ], @@ -10593,10 +10578,9 @@ ] }, { - "id": 2, + "id": 4, "name": "MA-contentapplication", "deviceTypeRef": { - "id": 41, "code": 36, "profileId": 259, "label": "MA-contentapp", @@ -10604,16 +10588,12 @@ }, "deviceTypes": [ { - "id": 41, "code": 36, "profileId": 259, "label": "MA-contentapp", "name": "MA-contentapp" } ], - "deviceTypeRefs": [ - 41 - ], "deviceVersions": [ 1 ], @@ -12556,6 +12536,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap index 6255dcf327c397..42bd7e60647a13 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -7089,7 +7084,6 @@ "id": 2, "name": "MA-videoplayer", "deviceTypeRef": { - "id": 38, "code": 41, "profileId": 259, "label": "MA-casting-videoclient", @@ -7097,16 +7091,12 @@ }, "deviceTypes": [ { - "id": 38, "code": 41, "profileId": 259, "label": "MA-casting-videoclient", "name": "MA-casting-videoclient" } ], - "deviceTypeRefs": [ - 38 - ], "deviceVersions": [ 1 ], @@ -15477,6 +15467,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap index 7bd3d94c04c4bc..5b04932c6989b1 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 7, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 55, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 55 - ], "deviceVersions": [ 1 ], @@ -7029,10 +7024,9 @@ ] }, { - "id": 8, + "id": 2, "name": "MA-videoplayer", "deviceTypeRef": { - "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -7040,16 +7034,12 @@ }, "deviceTypes": [ { - "id": 61, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" } ], - "deviceTypeRefs": [ - 61 - ], "deviceVersions": [ 1 ], @@ -15802,6 +15792,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 628aaed4485b21..04a9d85b79feef 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-windowcovering", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -6989,10 +6982,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-windowcovering", "deviceTypeRef": { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", @@ -7000,16 +6992,12 @@ }, "deviceTypes": [ { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", "name": "MA-windowcovering" } ], - "deviceTypeRefs": [ - 31 - ], "deviceVersions": [ 2 ], @@ -8554,7 +8542,6 @@ "id": 3, "name": "MA-windowcovering", "deviceTypeRef": { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", @@ -8562,16 +8549,12 @@ }, "deviceTypes": [ { - "id": 31, "code": 514, "profileId": 259, "label": "MA-windowcovering", "name": "MA-windowcovering" } ], - "deviceTypeRefs": [ - 31 - ], "deviceVersions": [ 2 ], @@ -10135,6 +10118,5 @@ "endpointId": 2, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 4f837c2f012b7f..c27f4df51ab556 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.08.04-nightly.1"] + "tags": ["version:2@v2023.08.30-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.08.04-nightly.1"] + "tags": ["version:2@v2023.08.30-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index e30f5e8a88c715..1cedd0fcbd5c11 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.08.04-nightly +v2023.08.30-nightly diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index e88f5012b4af64..9e73cd21902857 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", @@ -44,24 +43,18 @@ }, "deviceTypes": [ { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" }, { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 3, - 2 - ], "deviceVersions": [ 1, 1 @@ -9777,10 +9770,9 @@ ] }, { - "id": 3, + "id": 2, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -9788,24 +9780,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -22502,10 +22488,9 @@ ] }, { - "id": 1, + "id": 3, "name": "MA-onofflight", "deviceTypeRef": { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", @@ -22513,24 +22498,18 @@ }, "deviceTypes": [ { - "id": 8, "code": 256, "profileId": 259, "label": "MA-onofflight", "name": "MA-onofflight" }, { - "id": 3, "code": 17, "profileId": 259, "label": "MA-powersource", "name": "MA-powersource" } ], - "deviceTypeRefs": [ - 8, - 3 - ], "deviceVersions": [ 1, 1 @@ -26789,7 +26768,6 @@ "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", @@ -26797,16 +26775,12 @@ }, "deviceTypes": [ { - "id": 53, "code": 61442, "profileId": 259, "label": "MA-secondary-network-commissioning", "name": "MA-secondary-network-commissioning" } ], - "deviceTypeRefs": [ - 53 - ], "deviceVersions": [ 1 ], @@ -27317,6 +27291,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] -} + ] +} \ No newline at end of file diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index d3cbd586228952..d89edd6f164c73 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 2, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5432,10 +5427,9 @@ ] }, { - "id": 1, + "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5443,16 +5437,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -8357,6 +8347,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 2bae1f00004f30..4e69557eb99486 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.8.4' +MIN_ZAP_VERSION = '2023.8.30' class ZapTool: diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 77c4ee67eca5a6..5a1c9afa03a6d6 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -12610,7 +12605,7 @@ "side": "server", "type": "AirQualityEnum", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -20910,7 +20905,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20926,7 +20921,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20942,7 +20937,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20958,7 +20953,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -20974,7 +20969,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -20990,7 +20985,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21006,7 +21001,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21022,7 +21017,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21038,7 +21033,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21054,7 +21049,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21070,7 +21065,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21234,7 +21229,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21250,7 +21245,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21266,7 +21261,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21282,7 +21277,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21298,7 +21293,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21314,7 +21309,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21330,7 +21325,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21346,7 +21341,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21362,7 +21357,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21378,7 +21373,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21394,7 +21389,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21558,7 +21553,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21574,7 +21569,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21590,7 +21585,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21606,7 +21601,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21622,7 +21617,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21638,7 +21633,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21654,7 +21649,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21670,7 +21665,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21686,7 +21681,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21702,7 +21697,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21718,7 +21713,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -21882,7 +21877,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21898,7 +21893,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21914,7 +21909,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21930,7 +21925,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21946,7 +21941,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21962,7 +21957,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -21978,7 +21973,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -21994,7 +21989,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22010,7 +22005,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22026,7 +22021,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22042,7 +22037,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22206,7 +22201,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22222,7 +22217,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22238,7 +22233,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22254,7 +22249,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22270,7 +22265,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22286,7 +22281,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22302,7 +22297,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22318,7 +22313,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22334,7 +22329,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22350,7 +22345,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22366,7 +22361,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22530,7 +22525,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22546,7 +22541,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22562,7 +22557,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22578,7 +22573,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22594,7 +22589,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22610,7 +22605,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22626,7 +22621,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22642,7 +22637,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22658,7 +22653,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22674,7 +22669,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22690,7 +22685,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22854,7 +22849,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22870,7 +22865,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22886,7 +22881,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22902,7 +22897,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22918,7 +22913,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22934,7 +22929,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -22950,7 +22945,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -22966,7 +22961,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22982,7 +22977,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -22998,7 +22993,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23014,7 +23009,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23178,7 +23173,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23194,7 +23189,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23210,7 +23205,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23226,7 +23221,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23242,7 +23237,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23258,7 +23253,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23274,7 +23269,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23290,7 +23285,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23306,7 +23301,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23322,7 +23317,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23338,7 +23333,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23502,7 +23497,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23518,7 +23513,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23534,7 +23529,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23550,7 +23545,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23566,7 +23561,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23582,7 +23577,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23598,7 +23593,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23614,7 +23609,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23630,7 +23625,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23646,7 +23641,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23662,7 +23657,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23826,7 +23821,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23842,7 +23837,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23858,7 +23853,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23874,7 +23869,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23890,7 +23885,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23906,7 +23901,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -23922,7 +23917,7 @@ "side": "server", "type": "elapsed_s", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "1", @@ -23938,7 +23933,7 @@ "side": "server", "type": "single", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23954,7 +23949,7 @@ "side": "server", "type": "MeasurementUnitEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23970,7 +23965,7 @@ "side": "server", "type": "MeasurementMediumEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -23986,7 +23981,7 @@ "side": "server", "type": "LevelValueEnum", "included": 0, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "0", @@ -28788,6 +28783,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file From f8668c74cf9370ca39b29a44254d59106b94a0a2 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Fri, 1 Sep 2023 07:31:43 -0700 Subject: [PATCH 17/96] Fix UnsatisfiedLinkError on QrCode read (#29001) --- .../onboardingpayload/OnboardingPayloadParser.kt | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt index 0dff2ff5cdd411..e1d8357908e236 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt @@ -17,9 +17,6 @@ package chip.onboardingpayload -import java.util.logging.Level -import java.util.logging.Logger - /** Parser for scanned QR code or Manual Pairing Code. */ class OnboardingPayloadParser { /** @@ -115,17 +112,4 @@ class OnboardingPayloadParser { return payload } - - companion object { - private val LOGGER: Logger = - Logger.getLogger(OnboardingPayloadParser::class.java.getSimpleName()) - - init { - try { - System.loadLibrary("OnboardingPayload") - } catch (e: UnsatisfiedLinkError) { - LOGGER.log(Level.SEVERE, "Cannot load library.", e) - } - } - } } From 5deb59b6caec86fb40726f2574d4bc2d5423106f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 11:31:46 -0400 Subject: [PATCH 18/96] Fix incorrect loop condition in HasValidEventPathForEndpointAndCluster. (#28989) The test was backwards, so when CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE was defined for the "wildcard event" case we always ended up treating the list of events for the cluster as empty. Fixes https://github.com/project-chip/connectedhomeip/issues/28981 --- src/app/InteractionModelEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index a86dd4b98aed9e..b0a993fb614a1f 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -452,7 +452,7 @@ static bool HasValidEventPathForEndpointAndCluster(EndpointId aEndpoint, const E if (aEventPath.HasWildcardEventId()) { #if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE - for (decltype(aCluster->eventCount) idx = 0; idx > aCluster->eventCount; ++idx) + for (decltype(aCluster->eventCount) idx = 0; idx < aCluster->eventCount; ++idx) { ConcreteEventPath path(aEndpoint, aCluster->clusterId, aCluster->eventList[idx]); // If we get here, the path exists. We just have to do an ACL check for it. From 064cec09001f4ce84a7f6facaf25e277bd5ca987 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Fri, 1 Sep 2023 11:58:54 -0400 Subject: [PATCH 19/96] Script for test plan and VS for commissioner DUT (#28794) Script generates the test plan tables and verification step spreadsheet values for TC-DA-1.4 and TC-DA-1.8 from the commissioner_dut test vectors. --- .../gen_commissioner_dut_test_plan_table.py | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100755 credentials/development/gen_commissioner_dut_test_plan_table.py diff --git a/credentials/development/gen_commissioner_dut_test_plan_table.py b/credentials/development/gen_commissioner_dut_test_plan_table.py new file mode 100755 index 00000000000000..d8887a2f86f331 --- /dev/null +++ b/credentials/development/gen_commissioner_dut_test_plan_table.py @@ -0,0 +1,104 @@ +#!/usr/bin/env -S python3 -B +# +# Copyright (c) 2023 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. +# + +import argparse +import json +import os +from dataclasses import dataclass + + +@dataclass +class TestInfo: + desc: str + dir: str + pid: int + + +CHIP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')) +RUNNER_SCRIPT_DIR = os.path.join(CHIP_ROOT, 'scripts/tests') + + +def write_test_plan_output(filename: str, cases: TestInfo, test_num: str): + with open(filename, "w") as output: + output.write(f'[[ref:da-{test_num}-certs]]\n') + output.write(f'Certificates for TC-DA-{test_num}\n') + output.write('|===\n') + output.write('|#| Cert Description| Example certs\n') + for i, f in enumerate(cases): + output.write(f'|{i+1}|{f.desc} | {f.dir} (pid={f.pid})\n') + output.write('|===\n') + + +def write_validation_steps(filename: str, cases: TestInfo): + with open(filename, "w") as output: + for f in cases: + cmd = f'./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/{f.dir}/test_case_vector.json --product-id {f.pid}' + output.write(f'{f.desc.replace(",","")}, {f.dir}, {f.pid}, {cmd}\n') + + +def main(): + + argparser = argparse.ArgumentParser() + + argparser.add_argument("--failure_table", default="failure_table") + argparser.add_argument("--success_table", default="success_table") + argparser.add_argument("--success_vs", default="success_vs.csv") + argparser.add_argument("--failure_vs", default="failure_vs.csv") + args = argparser.parse_args() + + cred_path = 'credentials/development/commissioner_dut' + cert_path = os.path.abspath(os.path.join(CHIP_ROOT, cred_path)) + + # The following test vectors are success conditions for an SDK commissioner for the following reasons: + # struct_cd_device_type_id_mismatch - requires DCL access, which the SDK does not have and is not required + # struct_cd_security_info_wrong - while devices are required to set this to 0, commissioners are required to ignore it + # (see 6.3.1) + # hence this is marked as a failure for devices, but should be a success case for + # commissioners + # struct_cd_security_level_wrong - as with security info, commissioners are required to ignore this value (see 6.3.1) + # struct_cd_version_number_wrong - this value is not meant to be interpreted by commissioners, so errors here should be + # ignored (6.3.1) + # struct_cd_cert_id_mismatch - requires DCL access, which the SDK does not have and is not required. + skip_cases = ['struct_cd_device_type_id_mismatch', 'struct_cd_security_info_wrong', + 'struct_cd_security_level_wrong', 'struct_cd_version_number_wrong', 'struct_cd_cert_id_mismatch'] + + success_cases = [] + failure_cases = [] + for p in os.listdir(cert_path): + if p in skip_cases: + continue + path = str(os.path.join(cert_path, p, 'test_case_vector.json')) + with open(path, 'r') as f: + j = json.loads(f.read()) + success_expected = j['is_success_case'].lower() == 'true' + pid = 177 if 'fallback_encoding' in p else 32768 + desc = TestInfo(desc=j['description'], dir=p, pid=pid) + if success_expected: + success_cases.append(desc) + else: + failure_cases.append(desc) + + write_test_plan_output(args.failure_table, failure_cases, '1.4') + write_test_plan_output(args.success_table, success_cases, '1.8') + + write_validation_steps(args.failure_vs, failure_cases) + write_validation_steps(args.success_vs, success_cases) + + +if __name__ == '__main__': + main() From 3e6fec662e4bb0305a8847c423ecf90b9a548231 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 12:09:41 -0400 Subject: [PATCH 20/96] Allow advertising multiple operational identities on the same fabric on Darwin. (#29000) We need to check the instance name before coalescing registrations, not just the type, because all operational advertisements for a given fabric have the same type. --- src/platform/Darwin/DnssdContexts.cpp | 4 ++-- src/platform/Darwin/DnssdImpl.cpp | 2 +- src/platform/Darwin/DnssdImpl.h | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp index 96ae760c3475a8..86df18e5432fee 100644 --- a/src/platform/Darwin/DnssdContexts.cpp +++ b/src/platform/Darwin/DnssdContexts.cpp @@ -268,14 +268,14 @@ CHIP_ERROR MdnsContexts::Has(GenericContext * context) return CHIP_ERROR_KEY_NOT_FOUND; } -CHIP_ERROR MdnsContexts::GetRegisterContextOfType(const char * type, RegisterContext ** context) +CHIP_ERROR MdnsContexts::GetRegisterContextOfTypeAndName(const char * type, const char * name, RegisterContext ** context) { bool found = false; std::vector::iterator iter; for (iter = mContexts.begin(); iter != mContexts.end(); iter++) { - if ((*iter)->type == ContextType::Register && (static_cast(*iter))->matches(type)) + if ((*iter)->type == ContextType::Register && (static_cast(*iter))->matches(type, name)) { *context = static_cast(*iter); found = true; diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp index e08fbb178bb094..eb2ebb205e1b31 100644 --- a/src/platform/Darwin/DnssdImpl.cpp +++ b/src/platform/Darwin/DnssdImpl.cpp @@ -152,7 +152,7 @@ CHIP_ERROR Register(void * context, DnssdPublishCallback callback, uint32_t inte StringOrNullMarker(name), StringOrNullMarker(hostname), port, StringOrNullMarker(type), interfaceId); RegisterContext * sdCtx = nullptr; - if (CHIP_NO_ERROR == MdnsContexts::GetInstance().GetRegisterContextOfType(type, &sdCtx)) + if (CHIP_NO_ERROR == MdnsContexts::GetInstance().GetRegisterContextOfTypeAndName(type, name, &sdCtx)) { auto err = DNSServiceUpdateRecord(sdCtx->serviceRef, nullptr, kRegisterFlags, record.size(), record.data(), 0 /* ttl */); VerifyOrReturnError(kDNSServiceErr_NoError == err, sdCtx->Finalize(err)); diff --git a/src/platform/Darwin/DnssdImpl.h b/src/platform/Darwin/DnssdImpl.h index 1dd6319222599e..0f724747da2fd2 100644 --- a/src/platform/Darwin/DnssdImpl.h +++ b/src/platform/Darwin/DnssdImpl.h @@ -82,12 +82,13 @@ class MdnsContexts * Example: * _matterc._udp,_V65521,_S15,_L3840,_CM * _matter._tcp,_I4CEEAD044CC35B63 + * @param[in] name The instance name for the service. * @param[out] context A reference to the context previously registered * * @return On success, the context parameter will point to the previously * registered context. */ - CHIP_ERROR GetRegisterContextOfType(const char * type, RegisterContext ** context); + CHIP_ERROR GetRegisterContextOfTypeAndName(const char * type, const char * name, RegisterContext ** context); /** * Return a pointer to an existing ResolveContext for the given @@ -146,7 +147,7 @@ struct RegisterContext : public GenericContext void DispatchFailure(const char * errorStr, CHIP_ERROR err) override; void DispatchSuccess() override; - bool matches(const char * sType) { return mType.compare(sType) == 0; } + bool matches(const char * type, const char * name) { return mType == type && mInstanceName == name; } }; struct BrowseHandler : public GenericContext From eb23e9b5a5e78ad8ad703966d856dd7be2a93f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Josefsen?= <69624991+ReneJosefsen@users.noreply.github.com> Date: Fri, 1 Sep 2023 19:05:47 +0200 Subject: [PATCH 21/96] [TC-IDM-10.1] Verify invalid/not allowed attribute and command id ranges (#28926) * Initial test script to verify invalid ranges for 1.1 test cases * Reworked test script based on suggestion * Fix restyle * Fix restyle take 2 * Fix restyle take 3 * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Reworked scripts based on review feedback * Changed command list print to hex * Renamed script file to IDM-10.1 * Renamed test case name to match file name * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Update src/python_testing/TC_IDM_10_1.py * Fix restyle * Adjusted STANDARD_RANGE to STANDARD_PREFIX --------- Co-authored-by: Boris Zbarsky --- src/python_testing/TC_IDM_10_1.py | 122 ++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 src/python_testing/TC_IDM_10_1.py diff --git a/src/python_testing/TC_IDM_10_1.py b/src/python_testing/TC_IDM_10_1.py new file mode 100644 index 00000000000000..44ac9f3f64712c --- /dev/null +++ b/src/python_testing/TC_IDM_10_1.py @@ -0,0 +1,122 @@ +# +# Copyright (c) 2022 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. +# + +import logging + +from matter_testing_support import MatterBaseTest, async_test_body, default_matter_test_main +from mobly import asserts + +STANDARD_PREFIX = 0x0000 +MANUFACTURER_CODE_RANGE = range(0x0001, 0xFFF0 + 1) +TEST_VENDOR_RANGE = range(0xFFF1, 0xFFF4 + 1) +INVALID_VENDOR_RANGE = range(0xFFF5, 0xFFFF + 1) + +ATTRIBUTE_ID_RANGE = range(0x0000, 0x4FFF + 1) +GLOBAL_ATTRIBUTE_ID_RANGE = range(0xF000, 0xFFFE + 1) +COMMAND_ID_RANGE = range(0x00, 0xFF + 1) + +ATTRIBUTE_LIST_ID = 0xFFFB +ACCEPTED_COMMAND_LIST_ID = 0xFFF9 +GENERATED_COMMAND_LIST_ID = 0xFFF8 + + +def split_element_into_prefix_suffix(element): + return (element >> 16), (element & 0xFFFF) + + +def validate_attribute_id_range(attribute_id): + prefix, suffix = split_element_into_prefix_suffix(attribute_id) + + if prefix == STANDARD_PREFIX: + if suffix not in ATTRIBUTE_ID_RANGE and suffix not in GLOBAL_ATTRIBUTE_ID_RANGE: + asserts.fail(f"Invalid attribute id (0x{attribute_id:08X}) in standard range") + + elif prefix in MANUFACTURER_CODE_RANGE: + if suffix not in ATTRIBUTE_ID_RANGE: + asserts.fail(f"Invalid attribute id (0x{attribute_id:08X}) in MC range") + + elif prefix in TEST_VENDOR_RANGE: + if suffix in ATTRIBUTE_ID_RANGE: + logging.info(f"Warning: Attribute id (0x{attribute_id:08X}) found in test vendor range") + else: + asserts.fail(f"Invalid attribute id (0x{attribute_id:08X}) in Test Vendor MC range") + + else: # prefix in INVALID_VENDOR_RANGE + asserts.fail(f"Invalid attribute id (0x{attribute_id:08X}) in invalid range") + + +def validate_command_id_range(command_id): + prefix, suffix = split_element_into_prefix_suffix(command_id) + + if prefix == STANDARD_PREFIX: + if suffix not in COMMAND_ID_RANGE: + asserts.fail(f"Invalid command id (0x{command_id:08X}) in standard range") + + elif prefix in MANUFACTURER_CODE_RANGE: + if suffix not in COMMAND_ID_RANGE: + asserts.fail(f"Invalid command id (0x{command_id:08X}) in MC range") + + elif prefix in TEST_VENDOR_RANGE: + if suffix in COMMAND_ID_RANGE: + logging.info(f"Warning: Command id (0x{command_id:08X}) found in test vendor range") + else: + asserts.fail(f"Invalid command id (0x{command_id:08X}) in Test Vendor MC range") + + else: # prefix in INVALID_VENDOR_RANGE + asserts.fail(f"Invalid command id (0x{command_id:08X}) in invalid range") + + +class TC_IDM_10_1(MatterBaseTest): + @async_test_body + async def test_xx_1_1(self): + + dev_ctrl = self.default_controller + + self.print_step(1, "Perform a wildcard read of attributes on all endpoints") + wildcard_read = (await dev_ctrl.Read(self.dut_node_id, [()])) + endpoints_tlv = wildcard_read.tlvAttributes + + self.print_step(2, "Check invalid elements on all clusters, across all endpoints") + for endpoint_id, endpoint in endpoints_tlv.items(): + logging.info(f"Verifying Endpoint: {endpoint_id}") + + for cluster_id, cluster in endpoint.items(): + logging.info(f"Verifying ClusterID: 0x{cluster_id:04X}") + + attribute_list = cluster[ATTRIBUTE_LIST_ID] + accepted_command_list = cluster[ACCEPTED_COMMAND_LIST_ID] + generated_command_list = cluster[GENERATED_COMMAND_LIST_ID] + + # -- Attributes + logging.info(f"AttributeList: {[f'0x{attribute_id:04X}' for attribute_id in attribute_list]}") + + for attribute_id in attribute_list: + validate_attribute_id_range(attribute_id) + + # -- Commands + logging.info(f"AcceptedCommandList: {[f'0x{command_id:02X}' for command_id in accepted_command_list]}") + + for command_id in accepted_command_list: + validate_command_id_range(command_id) + + logging.info(f"GeneratedCommandList: {[f'0x{command_id:02X}' for command_id in generated_command_list]}") + for command_id in generated_command_list: + validate_command_id_range(command_id) + + +if __name__ == "__main__": + default_matter_test_main() From 4064446632e86f7ae04261687858ed2e923b6a5b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 13:30:41 -0400 Subject: [PATCH 22/96] Add dishwasher alarm Reset feature to XML. (#28994) Fixes https://github.com/project-chip/connectedhomeip/issues/28177 --- .../all-clusters-common/all-clusters-app.matter | 4 ++++ .../dishwasher-alarm-server/dishwasher-alarm-server.cpp | 2 +- .../zcl/data-model/chip/dishwasher-alarm-cluster.xml | 5 +++++ src/controller/data_model/controller-clusters.matter | 4 ++++ src/controller/python/chip/clusters/Objects.py | 3 +++ src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h | 4 ++++ .../app-common/app-common/zap-generated/cluster-enums.h | 6 ++++++ 7 files changed, 27 insertions(+), 1 deletion(-) 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 8ed04348a47f3c..f4b5dfbb3e58c0 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 @@ -2983,6 +2983,10 @@ server cluster DishwasherAlarm = 93 { kWaterLevelError = 0x20; } + bitmap Feature : BITMAP32 { + kReset = 0x1; + } + info event Notify = 0 { AlarmMap active = 0; AlarmMap inactive = 1; diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp index c0d167f2993ec6..a89bf17ae4ef9c 100644 --- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp +++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp @@ -296,7 +296,7 @@ bool DishwasherAlarmServer::HasResetFeature(EndpointId endpoint) return false; } - if (featureMap & 1) + if (featureMap & to_underlying(Feature::kReset)) { return true; } diff --git a/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml index b734980d1d78ba..13fed1ecfdd9db 100644 --- a/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/dishwasher-alarm-cluster.xml @@ -60,4 +60,9 @@ limitations under the License. + + + + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index cea8a51bb4d640..ebd2a1cf32c196 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3306,6 +3306,10 @@ client cluster DishwasherAlarm = 93 { kWaterLevelError = 0x20; } + bitmap Feature : BITMAP32 { + kReset = 0x1; + } + info event Notify = 0 { AlarmMap active = 0; AlarmMap inactive = 1; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 1ee10b3c5bdb19..96662454953e0e 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -18092,6 +18092,9 @@ class AlarmMap(IntFlag): kTempTooHigh = 0x10 kWaterLevelError = 0x20 + class Feature(IntFlag): + kReset = 0x1 + class Commands: @dataclass class Reset(ClusterCommand): diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index f8b8aebc1350fd..8f95cdc8da0b9c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -26616,6 +26616,10 @@ typedef NS_OPTIONS(uint32_t, MTRDishwasherAlarmAlarmMap) { MTRDishwasherAlarmAlarmMapWaterLevelError MTR_PROVISIONALLY_AVAILABLE = 0x20, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_OPTIONS(uint32_t, MTRDishwasherAlarmFeature) { + MTRDishwasherAlarmFeatureReset MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTROperationalStateErrorState) { MTROperationalStateErrorStateNoError MTR_PROVISIONALLY_AVAILABLE = 0x00, MTROperationalStateErrorStateUnableToStartOrResume MTR_PROVISIONALLY_AVAILABLE = 0x01, diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 590330cb5f5bb2..40cef5085e5861 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1814,6 +1814,12 @@ enum class AlarmMap : uint32_t kTempTooHigh = 0x10, kWaterLevelError = 0x20, }; + +// Bitmap for Feature +enum class Feature : uint32_t +{ + kReset = 0x1, +}; } // namespace DishwasherAlarm namespace OperationalState { From f3245d411db1f3112ce9f49611e8dd95b555bacb Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Sat, 2 Sep 2023 00:18:36 +0530 Subject: [PATCH 23/96] Modified tests Aug 31 (#28985) * Modified tests: TC_ACL_2_10 TC_ACL_2_7 TC_ACT_2_1 TC_ALOGIN_12_1 TC_BIND_2_3 TC_BRBINFO_1_1 TC_BR_4 TC_CADMIN_1_13 TC_CADMIN_1_15 TC_CADMIN_1_17 TC_CADMIN_1_18 TC_DESC_2_1 TC_DGGEN_2_2 TC_DRLK_3_2 TC_G_2_2 TC_G_2_3 TC_G_3_2 TC_ICDM_2_2 TC_ICDM_2_3 TC_IDM_4_4 TC_IDM_6_2 TC_IDM_6_4 TC_IDM_7_1 TC_I_2_2 TC_MC_11_1 TC_OPCREDS_3_2 TC_OPCREDS_3_3 TC_OPSTATE_2_2 TC_OPSTATE_2_3 TC_RVCCLEANM_3_1 TC_RVCOPSTATE_2_2 TC_RVCRUNM_3_1 TC_SC_3_1 TC_SC_3_2 TC_SC_3_3 TC_SC_4_10 TC_SC_4_2 TC_SC_4_3 TC_SC_4_4 TC_SC_4_5 TC_SC_4_6 TC_SC_4_7 TC_SC_4_9 TC_SC_6_1 TC_SU_2_8 TC_SU_3_3 TC_SU_4_1 TC_S_2_5 TC_S_2_6 TC_TCTL_2_2 TC_TSTAT_3_2 TC_WASHERCTRL_1_1 TC_WASHERCTRL_2_1 TC_WASHERCTRL_2_2 * Restyled by whitespace * Fixes script issue 629 * Disabled TC-RVCRUNM-3.1 test in init.py Removed step 2a subscribe operationalstatus from test: TC-WNCV-3.1 TC-WNCV-3.2 * Restyled by whitespace * Modified tests: TC-WNCV-3.1 TC-WNCV-3.2 * Fix script issue: 953 Updated DRLK writable PICS in drl_2_x_common.py * Disabled RVCCLEANM-3.1 test in init.py * Added high level PICS for tests: TC-CADMIN-1.25 TC-CADMIN-1.26 TC-DA-1.8 * Fix script issue 632. * Restyled by whitespace * Fix issue 28997 * Removed WASHERCTRL-2.2 from Darwin JSON file. Modified manual script : TC-GRPKEY-5.4 TC-SC-6.1 TC-OPCREDS-3.6 TC-G-3.2 * Restyled by whitespace * Modified test: TC-SC-6.1 * Restyled by whitespace * Modified test: TC-SC-6.1 * Restyled by whitespace * Added WASHERCTRL-2.2 test in Darwin --------- Co-authored-by: Restyled.io --- scripts/tests/chiptest/__init__.py | 2 + src/app/tests/suites/certification/PICS.yaml | 84 +- .../certification/Test_TC_ACL_2_10.yaml | 5 +- .../suites/certification/Test_TC_ACL_2_7.yaml | 2 +- .../suites/certification/Test_TC_ACT_2_1.yaml | 2 +- .../certification/Test_TC_ALOGIN_12_1.yaml | 10 +- .../certification/Test_TC_BIND_2_3.yaml | 6 +- .../certification/Test_TC_BRBINFO_1_1.yaml | 25 +- .../suites/certification/Test_TC_BR_4.yaml | 4 +- .../certification/Test_TC_CADMIN_1_13.yaml | 4 +- .../certification/Test_TC_CADMIN_1_15.yaml | 4 +- .../certification/Test_TC_CADMIN_1_17.yaml | 4 +- .../certification/Test_TC_CADMIN_1_18.yaml | 4 +- .../certification/Test_TC_CADMIN_1_25.yaml | 3 + .../certification/Test_TC_CADMIN_1_26.yaml | 4 + .../suites/certification/Test_TC_DA_1_8.yaml | 3 + .../certification/Test_TC_DESC_2_1.yaml | 268 +- .../certification/Test_TC_DGGEN_2_2.yaml | 10 +- .../certification/Test_TC_DRLK_2_1.yaml | 203 +- .../certification/Test_TC_DRLK_2_4.yaml | 8 +- .../certification/Test_TC_DRLK_3_2.yaml | 2626 +++++------------ .../certification/Test_TC_GRPKEY_5_4.yaml | 4 +- .../suites/certification/Test_TC_G_2_2.yaml | 10 +- .../suites/certification/Test_TC_G_2_3.yaml | 6 +- .../suites/certification/Test_TC_G_3_2.yaml | 6 +- .../certification/Test_TC_ICDM_2_2.yaml | 8 + .../certification/Test_TC_ICDM_2_3.yaml | 12 +- .../suites/certification/Test_TC_IDM_4_2.yaml | 177 +- .../suites/certification/Test_TC_IDM_4_4.yaml | 13 + .../suites/certification/Test_TC_IDM_6_2.yaml | 10 +- .../suites/certification/Test_TC_IDM_6_4.yaml | 12 +- .../suites/certification/Test_TC_IDM_7_1.yaml | 72 +- .../suites/certification/Test_TC_I_2_2.yaml | 2 +- .../suites/certification/Test_TC_MC_11_1.yaml | 14 + .../certification/Test_TC_OPCREDS_3_2.yaml | 38 +- .../certification/Test_TC_OPCREDS_3_3.yaml | 7 +- .../certification/Test_TC_OPCREDS_3_6.yaml | 17 +- .../certification/Test_TC_OPSTATE_2_1.yaml | 374 --- .../certification/Test_TC_OPSTATE_2_2.yaml | 8 +- .../certification/Test_TC_OPSTATE_2_3.yaml | 174 -- .../certification/Test_TC_RVCCLEANM_1_2.yaml | 115 - .../certification/Test_TC_RVCCLEANM_2_1.yaml | 241 -- .../certification/Test_TC_RVCCLEANM_3_1.yaml | 18 + .../certification/Test_TC_RVCCLEANM_3_2.yaml | 203 -- .../certification/Test_TC_RVCOPSTATE_2_2.yaml | 280 +- .../certification/Test_TC_RVCRUNM_1_2.yaml | 113 - .../certification/Test_TC_RVCRUNM_2_1.yaml | 215 -- .../certification/Test_TC_RVCRUNM_3_1.yaml | 206 +- .../certification/Test_TC_RVCRUNM_3_2.yaml | 223 -- .../suites/certification/Test_TC_SC_3_1.yaml | 7 +- .../suites/certification/Test_TC_SC_3_2.yaml | 427 ++- .../suites/certification/Test_TC_SC_3_3.yaml | 53 +- .../suites/certification/Test_TC_SC_4_10.yaml | 20 +- .../suites/certification/Test_TC_SC_4_2.yaml | 7 +- .../suites/certification/Test_TC_SC_4_3.yaml | 19 +- .../suites/certification/Test_TC_SC_4_4.yaml | 7 +- .../suites/certification/Test_TC_SC_4_5.yaml | 14 +- .../suites/certification/Test_TC_SC_4_6.yaml | 11 +- .../suites/certification/Test_TC_SC_4_7.yaml | 8 +- .../suites/certification/Test_TC_SC_4_9.yaml | 11 + .../suites/certification/Test_TC_SC_6_1.yaml | 131 +- .../suites/certification/Test_TC_SU_2_8.yaml | 43 +- .../suites/certification/Test_TC_SU_3_3.yaml | 44 +- .../suites/certification/Test_TC_SU_4_1.yaml | 9 + .../suites/certification/Test_TC_S_2_5.yaml | 91 +- .../suites/certification/Test_TC_S_2_6.yaml | 79 +- .../certification/Test_TC_TCCM_1_1.yaml | 3 + .../certification/Test_TC_TCCM_3_1.yaml | 4 + .../certification/Test_TC_TCCM_3_2.yaml | 2 +- .../certification/Test_TC_TCCM_3_3.yaml | 4 +- .../certification/Test_TC_TCTL_2_2.yaml | 28 +- .../certification/Test_TC_TSTAT_3_2.yaml | 17 +- .../certification/Test_TC_WASHERCTRL_1_1.yaml | 156 +- .../certification/Test_TC_WASHERCTRL_2_1.yaml | 96 +- .../certification/Test_TC_WASHERCTRL_2_2.yaml | 94 +- .../certification/Test_TC_WNCV_3_1.yaml | 23 +- .../certification/Test_TC_WNCV_3_2.yaml | 23 +- .../tests/suites/certification/ci-pics-values | 55 +- src/app/tests/suites/ciTests.json | 7 +- src/app/tests/suites/manualTests.json | 22 +- src/python_testing/drlk_2_x_common.py | 14 +- .../zap-generated/test/Commands.h | 2514 ++++++++++------ 82 files changed, 4171 insertions(+), 5731 deletions(-) mode change 100755 => 100644 src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OPSTATE_2_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_OPSTATE_2_3.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml delete mode 100644 src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index fd06d7f93632a6..1350e8c0c5a82a 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -174,6 +174,8 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_DGGEN_2_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_LWM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster } diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index 76db6c83d37f08..b3d8e330b10113 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -2664,67 +2664,60 @@ PICS: # # Server write attributes # + - label: "Does the device implement simulation of a Not Fully Locked State?" + id: DRLK.S.M.SimulateNotFullyLocked - - label: "Does the DUT(server) support the DoorOpen Events attribute?" - id: DRLK.S.A0004.Write - - - label: "Does the DUT(server) support the DoorClosedEvents attribute?" - id: DRLK.S.A0005.Write - - - label: "Does the DUT(server) support the OpenPeriod attribute?" - id: DRLK.S.A0006.Write - - - label: "Does the DUT(server) support the Language attribute?" - id: DRLK.S.A0021.Write - - - label: "Does the DUT(server) support the LEDSettings attribute?" - id: DRLK.S.A0022.Write - - - label: "Does the DUT(server) support the AutoRelockTime attribute?" - id: DRLK.S.A0023.Write - - - label: "Does the DUT(server) support the SoundVolume attribute?" - id: DRLK.S.A0024.Write + - label: "Does the device implement detection of a LockJammed State?" + id: DRLK.S.M.DetectLockJammed - - label: "Does the DUT(server) support the OperatingMode attribute?" - id: DRLK.S.A0025.Write + - label: "Does the device implement Language attribute with write access?" + id: DRLK.S.M.LanguageAttributeWritable - label: - "Does the DUT(server) support the EnableLocalProgramming attribute?" - id: DRLK.S.A0028.Write + "Does the device implement LEDSettings attribute with write access?" + id: DRLK.S.M.LEDSettingsAttributeWritable - - label: "Does the DUT(server) support the EnableOneTouchLocking attribute?" - id: DRLK.S.A0029.Write + - label: + "Does the device implement AutoRelockTime attribute with write access?" + id: DRLK.S.M.AutoRelockTimeAttributeWritable - - label: "Does the DUT(server) support the EnableInsideStatusLED attribute?" - id: DRLK.S.A002a.Write + - label: + "Does the device implement SoundVolume attribute with write access?" + id: DRLK.S.M.SoundVolumeAttributeWritable - label: - "Does the DUT(server) support the EnablePrivacyModeButton attribute?" - id: DRLK.S.A002b.Write + "Does the device implement OperatingMode attribute with write access?" + id: DRLK.S.M.OperatingModeAttributeWritable - label: - "Does the DUT(server) support the LocalProgrammingFeatures attribute?" - id: DRLK.S.A002c.Write + "Does the device implement EnableLocalProgramming attribute with write + access?" + id: DRLK.S.M.EnableLocalProgrammingAttributeWritable - - label: "Does the DUT(server) support the WrongCodeEntryLimit attribute?" - id: DRLK.S.A0030.Write + - label: + "Does the device implement LocalProgrammingFeatures attribute with + write access?" + id: DRLK.S.M.LocalProgrammingFeaturesAttributeWritable - label: - "Does the DUT(server) support the UserCodedTemporaryDisableTime - attribute?" - id: DRLK.S.A0031.Write + "Does the device implement WrongCodeEntryLimit attribute with write + access?" + id: DRLK.S.M.WrongCodeEntryLimitAttributeWritable - - label: "Does the DUT(server) support the SendPINOverTheAir attribute?" - id: DRLK.S.A0032.Write + - label: + "Does the device implement UserCodedTemporaryDisableTime attribute + with write access?" + id: DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable - label: - "Does the DUT(server) support the RequirePINForRemoteOperation - attribute?" - id: DRLK.S.A0033.Write + "Does the device implement RequirePINForRemoteOperation attribute with + write access?" + id: DRLK.S.M.RequirePINForRemoteOperationAttributeWritable - - label: "Does the DUT(server) support the ExpiringUserTimeOut attribute?" - id: DRLK.S.A0035.Write + - label: + "Does the device implement ExpiringUserTimeOut attribute with write + access?" + id: DRLK.S.M.ExpiringUserTimeOutAttributeWritable # # server / commandsReceived @@ -9237,6 +9230,9 @@ PICS: "Can the Rinse attribute changed by physical control at the device?" id: WASHERCTRL.S.M.ManuallyControlledRinse + - label: "Can the device be controlled manually?" + id: WASHERCTRL.S.M.ManuallyControlled + # #RVC Run Mode # diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml index cd77adbe3b1bff..46cee17ddfd5a2 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml @@ -557,13 +557,14 @@ tests: verification: | ./chip-tool accesscontrol read extension 2 0 --commissioner-name beta --commissioner-nodeid 223344 - On TH2(Chiptool) , Verify AccessControlExtensionStruct containing 1 element, and MUST NOT contain an element with FabricIndex F1 + Via the TH2(chip-tool), Verify the AccessControlExtensionStruct containing 1 element, and MUST NOT contain an element with FabricIndex F1 [1657289746.737641][19293:19298] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Attribute 0x0000_0001 DataVersion: 1884338152 [1657289746.737713][19293:19298] CHIP:TOO: Extension: 1 entries [1657289746.737778][19293:19298] CHIP:TOO: [1]: { [1657289746.737803][19293:19298] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018 - [1657289746.737844][19293:19298] CHIP:TOO: Fab + [1657289746.737844][19293:19298] CHIP:TOO: FabricIndex: 2 + [1657289746.737862][19293:19298] CHIP:TOO: } cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP && ACL.S.A0001 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml index 61a98cd52ddb95..195e2fbf5c5d51 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_7.yaml @@ -392,7 +392,7 @@ tests: #Issue https://github.com/CHIP-Specifications/chip-certification-tool/issues/768 - label: "TH2 writes Extension attribute value as empty list" verification: | - ./chip-tool accesscontrol write extension '[{}]' 2 0 --commissioner-name beta --commissioner-nodeid 223344 + ./chip-tool accesscontrol write extension '[]' 2 0 --commissioner-name beta --commissioner-nodeid 223344 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP && ACL.S.A0001 diff --git a/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml old mode 100755 new mode 100644 index ea44aa586a99d9..af2e4d8fae2228 --- a/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACT_2_1.yaml @@ -451,7 +451,7 @@ tests: disabled: true - label: - "Step 6d: Verify SetupURL appended by '?/a='' and the decimal numeric + "Step 6d: Verify SetupURL appended by '?/a=' and the decimal numeric value of one of the exposed ActionIDs (see step 5a) points to a site providing information about the action" PICS: ACT.S.A0002 && ACT.S.M.SetupURLWithSuffix diff --git a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml index eeb659dc6283d9..db1826a4949557 100644 --- a/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ALOGIN_12_1.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 3.14.1. [TC-ALOGIN-12.1] Account Login Verification @@ -60,10 +59,11 @@ tests: - name: "Status" value: 0 + #Issue: https://github.com/project-chip/connectedhomeip/issues/28992 - label: "Step 1: TH sends a GetSetupPIN command to the DUT with test values provided by the product maker." - PICS: ALOGIN.S.C00.Rsp + PICS: ALOGIN.S.C00.Rsp && PICS_SKIP_SAMPLE_APP command: "GetSetupPIN" timedInteractionTimeoutMs: 10000 arguments: @@ -74,11 +74,13 @@ tests: values: - name: "SetupPIN" saveAs: setupPIN + constraints: + minLength: 11 - label: "Step 2: TH sends a Login command to the DUT with test values provided by the product maker." - PICS: ALOGIN.S.C02.Rsp + PICS: ALOGIN.S.C02.Rsp && PICS_SKIP_SAMPLE_APP command: "Login" timedInteractionTimeoutMs: 10000 arguments: @@ -91,6 +93,6 @@ tests: - label: "Step 3: TH sends a Logout command to the DUT with test values provided by the product maker." - PICS: ALOGIN.S.C03.Rsp + PICS: ALOGIN.S.C03.Rsp && PICS_SKIP_SAMPLE_APP command: "Logout" timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml b/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml index f1fcc17f0985cd..68fd298978f2f6 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_2_3.yaml @@ -127,11 +127,7 @@ tests: Run this command for lighting app in chip-tool: - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, - "groupKeySecurityPolicy": 0, "epochKey0": - "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": - "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": - "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 2 0 + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, "groupKeySecurityPolicy": 0, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 2 0 On TH1, Verify the success response for KeySetWrite diff --git a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml index 87405f6168ad3e..2112bad42bf989 100644 --- a/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BRBINFO_1_1.yaml @@ -34,26 +34,13 @@ tests: - name: "nodeId" value: nodeId - #Issue https://github.com/project-chip/connectedhomeip/issues/26602 - label: "Step 2: TH reads the ClusterRevision from DUT" - verification: | - ./chip-tool bridgeddevicebasicinformation read cluster-revision 1 3 - - Via the TH (chip-tool), verify: - -that the ClusterRevision attribute contains value as 2. - -that value is in the type of uint16. - - [1657695910.794487][15411:15416] CHIP:TOO: Endpoint: 3 Cluster: 0x0000_0039 Attribute 0x0000_FFFD DataVersion: 2577979325 - [1657695910.794568][15411:15416] CHIP:TOO: ClusterRevision: 2 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 2 + constraints: + type: int16u - label: "Step 3: TH reads the FeatureMap from DUT" command: "readAttribute" diff --git a/src/app/tests/suites/certification/Test_TC_BR_4.yaml b/src/app/tests/suites/certification/Test_TC_BR_4.yaml index 15d01deed0434d..b3be40bb03f05c 100644 --- a/src/app/tests/suites/certification/Test_TC_BR_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_BR_4.yaml @@ -6042,7 +6042,7 @@ tests: contains the state of the battery of the (supported) devices from the above list" verification: | - ./chip-tool powersource read bat-charge-level 1 9 + ./chip-tool powersource read bat-charge-level 1 6 Verify BatChargeLevel attribute response on TH(bridge-app) Log: @@ -6063,7 +6063,7 @@ tests: [1663925822.845919][1588:1588] CHIP:DMG: Attribute = 0x0000_000E, [1663925822.845946][1588:1588] CHIP:DMG: } [1663925822.845978][1588:1588] CHIP:DMG: - [1663925822.846007][1588:1588] CHIP:DMG: Data = 58, + [1663925822.846007][1588:1588] CHIP:DMG: Data = 3, [1663925822.846035][1588:1588] CHIP:DMG: }, [1663925822.846063][1588:1588] CHIP:DMG: [1663925822.846086][1588:1588] CHIP:DMG: }, diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_13.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_13.yaml index 4af0406adfdb17..a64e94c08d1f4b 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_13.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_13.yaml @@ -159,7 +159,7 @@ tests: verification: | On TH_CR3 send the below command - ./chip-tool pairing onnetwork 3 20202021 --commissioner-name gamma + ./chip-tool pairing code 3 34970112332 --commissioner-name gamma Verify you got below message on TH_CR3(chip-tool) log Device commissioning completed with success @@ -210,7 +210,7 @@ tests: On 2nd controller using chip tool connect to the accessory - ./chip-tool pairing onnetwork 2 20202021 --commissioner-name beta + ./chip-tool pairing code 2 34970112332 --commissioner-name beta Verify you got below message on TH_CR2(chip-tool) log Device commissioning completed with success diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml index 3ca0f9b9905bf0..72f93fe51ae3d4 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_15.yaml @@ -221,8 +221,8 @@ tests: disabled: true - label: - "Verify DUT_CE is now discoverable over DNS-SD with 2 Operational - service records (_matter._tcp SRV records)." + "Step 10: Verify DUT_CE is now discoverable over DNS-SD with 2 + Operational service records (_matter._tcp SRV records)." PICS: CADMIN.S.C00.Rsp verification: | Execute the below command in any linux platform or in TH_CR1 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml index 65bcd3f07c5878..c0d1a6e6e40b51 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_17.yaml @@ -358,8 +358,8 @@ tests: disabled: true - label: - "Verify TH_CE is now discoverable over DNS-SD with 2 Operational - service records (_matter._tcp SRV records)." + "Step 10: Verify TH_CE is now discoverable over DNS-SD with 2 + Operational service records (_matter._tcp SRV records)." verification: | On any Linux platform execute this command or in TH_CR2 diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_18.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_18.yaml index 977eed436268c5..00ee383deaf5ee 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_18.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_18.yaml @@ -339,8 +339,8 @@ tests: disabled: true - label: - "Verify TH_CE is now discoverable over DNS-SD with 2 Operational - service records (_matter._tcp SRV records)." + "Step 10: Verify TH_CE is now discoverable over DNS-SD with 2 + Operational service records (_matter._tcp SRV records)." verification: | Below are the example command for using single RPI as multiple controller. Vendor should have the provision to use the equivalent command in their DUT or use multiple commissioners/controllers diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_25.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_25.yaml index fed38e16e2916d..0bafc91390b043 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_25.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_25.yaml @@ -17,6 +17,9 @@ name: 36.1.25. [TC-CADMIN-1.25] Subscription to the attributes - verify subscription response [ECM] [DUT - Commissionee] +PICS: + - CADMIN.S + config: nodeId: 0x12344321 cluster: "Basic Information" diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml index a923be83b413ba..d6af78ccfd2b92 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml @@ -17,6 +17,10 @@ name: 36.1.26. [TC-CADMIN-1.26] Subscription to the attributes - verify subscription response [BCM] [DUT - Commissionee] +PICS: + - CADMIN.S + - CADMIN.S.F00 + config: nodeId: 0x12344321 cluster: "Basic Information" diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml index 72263840727302..188e23dcccf156 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml @@ -17,6 +17,9 @@ name: 29.1.8. [TC-DA-1.8] Device Attestation Request Validation-Success Scenario [DUT-Commissioner] +PICS: + - MCORE.ROLE.COMMISSIONER + config: nodeId: 0x12344321 cluster: "Basic Information" diff --git a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml index b95c22cf3e2c4d..5fb15e49a1530e 100644 --- a/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DESC_2_1.yaml @@ -55,17 +55,20 @@ tests: ./chip-tool descriptor read device-type-list 1 0 - on TH (Chip-tool) log, Verify "DeviceTypeList" count is at least one entry and - - The entry should contain one Root Node Device Type, here 22(In hex 0x0016) is a Root Node Device Type + on TH (Chip-tool) log, Verify that the DeviceTypeList contains one Root Node Device Type and may only contain other Node Device Types (device types with scope=node, it can be any of the following Power Source, OTA Requestor, OTA Provider) next to the Root Node Device Type. (here DeviceType: 17 is power source ) - Revision value is not less than 1 and it should match the Revision of the DeviceType and below is the sample log provided for the raspi platform [1674552598.748946][21129:21131] CHIP:DMG: } - [1674552598.749017][21129:21131] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2963153058 - [1674552598.749027][21129:21131] CHIP:TOO: DeviceTypeList: 1 entries - [1674552598.749036][21129:21131] CHIP:TOO: [1]: { - [1674552598.749042][21129:21131] CHIP:TOO: DeviceType: 22 - [1674552598.749045][21129:21131] CHIP:TOO: Revision: 1 - [1674552598.749048][21129:21131] CHIP:TOO: } + [[1692617243.785786][31325:31327] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1437984882 + [1692617243.785840][31325:31327] CHIP:TOO: DeviceTypeList: 2 entries + [1692617243.785862][31325:31327] CHIP:TOO: [1]: { + [1692617243.785881][31325:31327] CHIP:TOO: DeviceType: 17 + [1692617243.785892][31325:31327] CHIP:TOO: Revision: 1 + [1692617243.785901][31325:31327] CHIP:TOO: } + [1692617243.785917][31325:31327] CHIP:TOO: [2]: { + [1692617243.785926][31325:31327] CHIP:TOO: DeviceType: 22 + [1692617243.785936][31325:31327] CHIP:TOO: Revision: 1 + [1692617243.785944][31325:31327] CHIP:TOO: } disabled: true - label: @@ -88,16 +91,41 @@ tests: On TH (Chip-tool) log, Verify that - If PartsLists count is 0 then, DeviceTypeList count is at least one. - DeviceTypeList should contains exactly one Application Device Type [In below log 256(In hex 0x100) is a Application Device Type(On/OffLight)] or set of Application Device Types which are a subset of each other. - - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type. + - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type.[In below log DeviceType: 17(In hex 0x0011) is a Utility DeviceType ] - Revision value is not less than 1 and it should match the Revision of the DeviceType and below is the sample log provided for the raspi platform [1674552599.264189][21135:21137] CHIP:DMG: } - [1674552599.264258][21135:21137] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2605122001 - [1674552599.264268][21135:21137] CHIP:TOO: DeviceTypeList: 1 entries - [1674552599.264277][21135:21137] CHIP:TOO: [1]: { - [1674552599.264284][21135:21137] CHIP:TOO: DeviceType: 256 - [1674552599.264287][21135:21137] CHIP:TOO: Revision: 1 - [1674552599.264290][21135:21137] CHIP:TOO: } + [1692617790.900384][31584:31586] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2832593371 + [1692617790.900398][31584:31586] CHIP:TOO: DeviceTypeList: 2 entries + [1692617790.900410][31584:31586] CHIP:TOO: [1]: { + [1692617790.900413][31584:31586] CHIP:TOO: DeviceType: 256 + [1692617790.900416][31584:31586] CHIP:TOO: Revision: 1 + [1692617790.900419][31584:31586] CHIP:TOO: } + [1692617790.900423][31584:31586] CHIP:TOO: [2]: { + [1692617790.900425][31584:31586] CHIP:TOO: DeviceType: 17 + [1692617790.900428][31584:31586] CHIP:TOO: Revision: 1 + [1692617790.900430][31584:31586] CHIP:TOO: } + + ./chip-tool descriptor read device-type-list 1 1 + + On TH (Chip-tool) log, Verify that + - If PartsLists count is 0 then, DeviceTypeList count is at least one. + - DeviceTypeList should contains exactly one Application Device Type [In below log 256(In hex 0x100) is a Application Device Type(On/OffLight)] or set of Application Device Types which are a subset of each other. + - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type.[In below log DeviceType: 17(In hex 0x0011) is a Utility DeviceType ] + - Revision value is not less than 1 and it should match the Revision of the DeviceType and below is the sample log provided for the raspi platform + + [1674552599.264189][21135:21137] CHIP:DMG: } + [1692617790.900384][31584:31586] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 2832593371 + [1692617790.900398][31584:31586] CHIP:TOO: DeviceTypeList: 2 entries + [1692617790.900410][31584:31586] CHIP:TOO: [1]: { + [1692617790.900413][31584:31586] CHIP:TOO: DeviceType: 256 + [1692617790.900416][31584:31586] CHIP:TOO: Revision: 1 + [1692617790.900419][31584:31586] CHIP:TOO: } + [1692617790.900423][31584:31586] CHIP:TOO: [2]: { + [1692617790.900425][31584:31586] CHIP:TOO: DeviceType: 17 + [1692617790.900428][31584:31586] CHIP:TOO: Revision: 1 + [1692617790.900430][31584:31586] CHIP:TOO: } + ./chip-tool descriptor read parts-list 1 2 @@ -106,21 +134,24 @@ tests: [1660127879.565330][46472:46477] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0003 DataVersion: 1237610137 [1660127879.565473][46472:46477] CHIP:TOO: parts list: 0 entries - ./chip-tool descriptor read device-type-list 1 2 On TH (Chip-tool) log, Verify that - If PartsLists count is 0 then, DeviceTypeList count is at least one. - DeviceTypeList should contains exactly one Application Device Type [In below log 256(In hex 0x100) is a Application Device Type(On/OffLight)] or set of Application Device Types which are a subset of each other. - - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type. + - DeviceTypeList may contain one or more Utility Device Types, but not Root Node Device Type.[In below log DeviceType: 17(In hex 0x0011) is a Utility DeviceType ] - Revision value is not less than 1 and it should match the Revision of the DeviceType and below is the sample log provided for the raspi platform - [1674552599.786124][21141:21143] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 4029338401 - [1674552599.786141][21141:21143] CHIP:TOO: DeviceTypeList: 1 entries - [1674552599.786155][21141:21143] CHIP:TOO: [1]: { - [1674552599.786164][21141:21143] CHIP:TOO: DeviceType: 256 - [1674552599.786168][21141:21143] CHIP:TOO: Revision: 1 - [1674552599.786171][21141:21143] CHIP:TOO: } + [1692618454.794870][31669:31671] CHIP:TOO: Endpoint: 2 Cluster: 0x0000_001D Attribute 0x0000_0000 DataVersion: 1103199808 + [1692618454.794946][31669:31671] CHIP:TOO: DeviceTypeList: 2 entries + [1692618454.794990][31669:31671] CHIP:TOO: [1]: { + [1692618454.795027][31669:31671] CHIP:TOO: DeviceType: 256 + [1692618454.795038][31669:31671] CHIP:TOO: Revision: 1 + [1692618454.795048][31669:31671] CHIP:TOO: } + [1692618454.795063][31669:31671] CHIP:TOO: [2]: { + [1692618454.795072][31669:31671] CHIP:TOO: DeviceType: 17 + [1692618454.795080][31669:31671] CHIP:TOO: Revision: 1 + [1692618454.795089][31669:31671] CHIP:TOO: } disabled: true - label: "Step 2: TH reads 'ServerList' attribute." @@ -130,79 +161,80 @@ tests: ./chip-tool descriptor read server-list 1 1 - Verify ServerList entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ServerList entries are 69. - - [1692618512.334390][31683:31685] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 2832593371 - [1692618512.334424][31683:31685] CHIP:TOO: ServerList: 69 entries - [1692618512.334429][31683:31685] CHIP:TOO: [1]: 3 - [1692618512.334432][31683:31685] CHIP:TOO: [2]: 4 - [1692618512.334435][31683:31685] CHIP:TOO: [3]: 5 - [1692618512.334438][31683:31685] CHIP:TOO: [4]: 6 - [1692618512.334441][31683:31685] CHIP:TOO: [5]: 7 - [1692618512.334443][31683:31685] CHIP:TOO: [6]: 8 - [1692618512.334446][31683:31685] CHIP:TOO: [7]: 15 - [1692618512.334449][31683:31685] CHIP:TOO: [8]: 29 - [1692618512.334452][31683:31685] CHIP:TOO: [9]: 30 - [1692618512.334455][31683:31685] CHIP:TOO: [10]: 37 - [1692618512.334458][31683:31685] CHIP:TOO: [11]: 47 - [1692618512.334461][31683:31685] CHIP:TOO: [12]: 59 - [1692618512.334464][31683:31685] CHIP:TOO: [13]: 64 - [1692618512.334467][31683:31685] CHIP:TOO: [14]: 65 - [1692618512.334469][31683:31685] CHIP:TOO: [15]: 69 - [1692618512.334472][31683:31685] CHIP:TOO: [16]: 80 - [1692618512.334475][31683:31685] CHIP:TOO: [17]: 81 - [1692618512.334478][31683:31685] CHIP:TOO: [18]: 82 - [1692618512.334481][31683:31685] CHIP:TOO: [19]: 84 - [1692618512.334483][31683:31685] CHIP:TOO: [20]: 85 - [1692618512.334486][31683:31685] CHIP:TOO: [21]: 86 - [1692618512.334489][31683:31685] CHIP:TOO: [22]: 87 - [1692618512.334492][31683:31685] CHIP:TOO: [23]: 89 - [1692618512.334495][31683:31685] CHIP:TOO: [24]: 91 - [1692618512.334498][31683:31685] CHIP:TOO: [25]: 92 - [1692618512.334501][31683:31685] CHIP:TOO: [26]: 93 - [1692618512.334504][31683:31685] CHIP:TOO: [27]: 96 - [1692618512.334506][31683:31685] CHIP:TOO: [28]: 97 - [1692618512.334509][31683:31685] CHIP:TOO: [29]: 113 - [1692618512.334512][31683:31685] CHIP:TOO: [30]: 114 - [1692618512.334515][31683:31685] CHIP:TOO: [31]: 257 - [1692618512.334517][31683:31685] CHIP:TOO: [32]: 258 - [1692618512.334520][31683:31685] CHIP:TOO: [33]: 259 - [1692618512.334523][31683:31685] CHIP:TOO: [34]: 512 - [1692618512.334526][31683:31685] CHIP:TOO: [35]: 513 - [1692618512.334529][31683:31685] CHIP:TOO: [36]: 514 - [1692618512.334532][31683:31685] CHIP:TOO: [37]: 516 - [1692618512.334535][31683:31685] CHIP:TOO: [38]: 768 - [1692618512.334538][31683:31685] CHIP:TOO: [39]: 769 - [1692618512.334541][31683:31685] CHIP:TOO: [40]: 1024 - [1692618512.334543][31683:31685] CHIP:TOO: [41]: 1026 - [1692618512.334546][31683:31685] CHIP:TOO: [42]: 1027 - [1692618512.334549][31683:31685] CHIP:TOO: [43]: 1028 - [1692618512.334552][31683:31685] CHIP:TOO: [44]: 1029 - [1692618512.334555][31683:31685] CHIP:TOO: [45]: 1030 - [1692618512.334558][31683:31685] CHIP:TOO: [46]: 1036 - [1692618512.334560][31683:31685] CHIP:TOO: [47]: 1037 - [1692618512.334563][31683:31685] CHIP:TOO: [48]: 1043 - [1692618512.334566][31683:31685] CHIP:TOO: [49]: 1045 - [1692618512.334569][31683:31685] CHIP:TOO: [50]: 1066 - [1692618512.334572][31683:31685] CHIP:TOO: [51]: 1067 - [1692618512.334575][31683:31685] CHIP:TOO: [52]: 1068 - [1692618512.334578][31683:31685] CHIP:TOO: [53]: 1069 - [1692618512.334580][31683:31685] CHIP:TOO: [54]: 1070 - [1692618512.334583][31683:31685] CHIP:TOO: [55]: 1071 - [1692618512.334586][31683:31685] CHIP:TOO: [56]: 1283 - [1692618512.334589][31683:31685] CHIP:TOO: [57]: 1284 - [1692618512.334592][31683:31685] CHIP:TOO: [58]: 1285 - [1692618512.334595][31683:31685] CHIP:TOO: [59]: 1286 - [1692618512.334597][31683:31685] CHIP:TOO: [60]: 1287 - [1692618512.334600][31683:31685] CHIP:TOO: [61]: 1288 - [1692618512.334603][31683:31685] CHIP:TOO: [62]: 1289 - [1692618512.334606][31683:31685] CHIP:TOO: [63]: 1290 - [1692618512.334609][31683:31685] CHIP:TOO: [64]: 1291 - [1692618512.334612][31683:31685] CHIP:TOO: [65]: 1292 - [1692618512.334614][31683:31685] CHIP:TOO: [66]: 1293 - [1692618512.334617][31683:31685] CHIP:TOO: [67]: 1294 - [1692618512.334620][31683:31685] CHIP:TOO: [68]: 2820 - [1692618512.334623][31683:31685] CHIP:TOO: [69]: 4294048773 + Verify ServerList entries on the TH (Chip-tool) and below is the sample log provided for the raspi platform, Here ServerList entries are 70. + + [1693218196.392903][13451:13453] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001D Attribute 0x0000_0001 DataVersion: 3853201227 + [1693218196.393030][13451:13453] CHIP:TOO: ServerList: 70 entries + [1693218196.393047][13451:13453] CHIP:TOO: [1]: 3 + [1693218196.393059][13451:13453] CHIP:TOO: [2]: 4 + [1693218196.393071][13451:13453] CHIP:TOO: [3]: 5 + [1693218196.393081][13451:13453] CHIP:TOO: [4]: 6 + [1693218196.393092][13451:13453] CHIP:TOO: [5]: 7 + [1693218196.393103][13451:13453] CHIP:TOO: [6]: 8 + [1693218196.393114][13451:13453] CHIP:TOO: [7]: 15 + [1693218196.393125][13451:13453] CHIP:TOO: [8]: 29 + [1693218196.393136][13451:13453] CHIP:TOO: [9]: 30 + [1693218196.393147][13451:13453] CHIP:TOO: [10]: 37 + [1693218196.393159][13451:13453] CHIP:TOO: [11]: 47 + [1693218196.393169][13451:13453] CHIP:TOO: [12]: 59 + [1693218196.393180][13451:13453] CHIP:TOO: [13]: 64 + [1693218196.393191][13451:13453] CHIP:TOO: [14]: 65 + [1693218196.393201][13451:13453] CHIP:TOO: [15]: 69 + [1693218196.393212][13451:13453] CHIP:TOO: [16]: 80 + [1693218196.393222][13451:13453] CHIP:TOO: [17]: 81 + [1693218196.393233][13451:13453] CHIP:TOO: [18]: 82 + [1693218196.393244][13451:13453] CHIP:TOO: [19]: 83 + [1693218196.393254][13451:13453] CHIP:TOO: [20]: 84 + [1693218196.393265][13451:13453] CHIP:TOO: [21]: 85 + [1693218196.393276][13451:13453] CHIP:TOO: [22]: 86 + [1693218196.393286][13451:13453] CHIP:TOO: [23]: 87 + [1693218196.393297][13451:13453] CHIP:TOO: [24]: 89 + [1693218196.393308][13451:13453] CHIP:TOO: [25]: 91 + [1693218196.393318][13451:13453] CHIP:TOO: [26]: 92 + [1693218196.393329][13451:13453] CHIP:TOO: [27]: 93 + [1693218196.393340][13451:13453] CHIP:TOO: [28]: 96 + [1693218196.393350][13451:13453] CHIP:TOO: [29]: 97 + [1693218196.393362][13451:13453] CHIP:TOO: [30]: 113 + [1693218196.393373][13451:13453] CHIP:TOO: [31]: 114 + [1693218196.393384][13451:13453] CHIP:TOO: [32]: 257 + [1693218196.393394][13451:13453] CHIP:TOO: [33]: 258 + [1693218196.393405][13451:13453] CHIP:TOO: [34]: 259 + [1693218196.393416][13451:13453] CHIP:TOO: [35]: 512 + [1693218196.393427][13451:13453] CHIP:TOO: [36]: 513 + [1693218196.393437][13451:13453] CHIP:TOO: [37]: 514 + [1693218196.393448][13451:13453] CHIP:TOO: [38]: 516 + [1693218196.393459][13451:13453] CHIP:TOO: [39]: 768 + [1693218196.393470][13451:13453] CHIP:TOO: [40]: 769 + [1693218196.393481][13451:13453] CHIP:TOO: [41]: 1024 + [1693218196.393492][13451:13453] CHIP:TOO: [42]: 1026 + [1693218196.393503][13451:13453] CHIP:TOO: [43]: 1027 + [1693218196.393514][13451:13453] CHIP:TOO: [44]: 1028 + [1693218196.393525][13451:13453] CHIP:TOO: [45]: 1029 + [1693218196.393536][13451:13453] CHIP:TOO: [46]: 1030 + [1693218196.393546][13451:13453] CHIP:TOO: [47]: 1036 + [1693218196.393557][13451:13453] CHIP:TOO: [48]: 1037 + [1693218196.393568][13451:13453] CHIP:TOO: [49]: 1043 + [1693218196.393579][13451:13453] CHIP:TOO: [50]: 1045 + [1693218196.393590][13451:13453] CHIP:TOO: [51]: 1066 + [1693218196.393601][13451:13453] CHIP:TOO: [52]: 1067 + [1693218196.393611][13451:13453] CHIP:TOO: [53]: 1068 + [1693218196.393622][13451:13453] CHIP:TOO: [54]: 1069 + [1693218196.393633][13451:13453] CHIP:TOO: [55]: 1070 + [1693218196.393643][13451:13453] CHIP:TOO: [56]: 1071 + [1693218196.393654][13451:13453] CHIP:TOO: [57]: 1283 + [1693218196.393664][13451:13453] CHIP:TOO: [58]: 1284 + [1693218196.393675][13451:13453] CHIP:TOO: [59]: 1285 + [1693218196.393686][13451:13453] CHIP:TOO: [60]: 1286 + [1693218196.393697][13451:13453] CHIP:TOO: [61]: 1287 + [1693218196.393708][13451:13453] CHIP:TOO: [62]: 1288 + [1693218196.393718][13451:13453] CHIP:TOO: [63]: 1289 + [1693218196.393729][13451:13453] CHIP:TOO: [64]: 1290 + [1693218196.393740][13451:13453] CHIP:TOO: [65]: 1291 + [1693218196.393750][13451:13453] CHIP:TOO: [66]: 1292 + [1693218196.393761][13451:13453] CHIP:TOO: [67]: 1293 + [1693218196.393772][13451:13453] CHIP:TOO: [68]: 1294 + [1693218196.393783][13451:13453] CHIP:TOO: [69]: 2820 + [1693218196.393794][13451:13453] CHIP:TOO: [70]: 4294048773 disabled: true - label: "Step 3: TH reads 'ClientList' attribute" @@ -241,23 +273,37 @@ tests: [1672919326.178777][33468:33470] CHIP:TOO: [2]: 2 disabled: true - - label: "Step 6: TH reads from the DUT the 'TagList' attribute." + - label: "Step 5: TH reads from the DUT the 'TagList' attribute." PICS: DESC.S.A0004 verification: | ./chip-tool descriptor read tag-list 1 0 - Verify that the DUT response contains a TagList and SHALL contain at least one element: - - [1692930031.171338][161314:161316] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0004 DataVersion: 3040764429 - [1692930031.171357][161314:161316] CHIP:TOO: TagList: 2 entries - [1692930031.171384][161314:161316] CHIP:TOO: [1]: { - [1692930031.171389][161314:161316] CHIP:TOO: MfgCode: null - [1692930031.171392][161314:161316] CHIP:TOO: NamespaceID: 7 - [1692930031.171394][161314:161316] CHIP:TOO: Tag: 0 - [1692930031.171396][161314:161316] CHIP:TOO: } - [1692930031.171399][161314:161316] CHIP:TOO: [2]: { - [1692930031.171410][161314:161316] CHIP:TOO: MfgCode: null - [1692930031.171413][161314:161316] CHIP:TOO: NamespaceID: 8 - [1692930031.171425][161314:161316] CHIP:TOO: Tag: 3 - [1692930031.171427][161314:161316] CHIP:TOO: } + - Verify that the DUT response contains a TagList and SHALL contain at least one element. + - Read each TagStruct from the list and check for the following: + - Number of entries in TagList is in the range of 1 to 6 and each entry contains at least a NamespaceID and a Tag property. Confirm that each entry is unique (i.e. no duplicate tags). + - If the MfgCode field is not null, confirm that it is the Vendor ID of the manufacturer who has defined a certain namespace and that the NamespaceID field indicates which namespace from the manufacturer is associated with the Tag field. + - Confirm that each non-manufacturer specific tag is from a namespace defined in the spec (either from an common namespace or from a namespace for the particular device type). + - If a manufacturer specific Tag field is indicated, at least one standardized tag which is not from any manufacturer’s namespace shall be included in the TagList. + - Tag field is the ID of a semantic tag within the namespace indicated by the NamespaceID property. + + [1692959866.253223][12664:12666] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001D Attribute 0x0000_0004 DataVersion: 2088189574 + [1692959866.253237][12664:12666] CHIP:TOO: TagList: 2 entries + [1692959866.253248][12664:12666] CHIP:TOO: [1]: { + [1692959866.253251][12664:12666] CHIP:TOO: MfgCode: null + [1692959866.253255][12664:12666] CHIP:TOO: NamespaceID: 7 + [1692959866.253257][12664:12666] CHIP:TOO: Tag: 0 + [1692959866.253260][12664:12666] CHIP:TOO: } + [1692959866.253265][12664:12666] CHIP:TOO: [2]: { + [1692959866.253267][12664:12666] CHIP:TOO: MfgCode: null + [1692959866.253270][12664:12666] CHIP:TOO: NamespaceID: 8 + [1692959866.253272][12664:12666] CHIP:TOO: Tag: 3 + [1692959866.253274][12664:12666] CHIP:TOO: } + disabled: true + + - label: + "Step 5: The cluster tests applicable to each Device Type should be + executed to make sure all mandatory (and applicable optional) + attributes/commands are implemented." + verification: | + This step is redundant as during certification the appropriate tests are being run disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_2.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_2.yaml index 184b36a5531ea3..adb1fcf7931014 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_2.yaml @@ -39,7 +39,15 @@ tests: - label: "Step 1: Commission DUT to TH" verification: | - Commission DUT to TH + execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT + ./chip-all-clusters-app + + Once DUT reach the commissionable state pls send below mentioned command on TH. Pls use equivalent command on the respective DUT + ./chip-tool pairing onnetwork 1 20202021 + Verify the commissioning completed with success on TH(chip-tool) from DUT + [1650455358.501816][4366:4371] CHIP:TOO: Device commissioning completed with success + + This step can be skipped if done in a preceding test disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index d1f05401eeb4ea..cc67a0908626ac 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -222,7 +222,8 @@ tests: - label: "Step 1f: Simulate a not fully locked scenario on the DUT." PICS: - DRLK.S.A0000 && DRLK.S.Simulate.NotFullyLocked && PICS_SKIP_SAMPLE_APP + DRLK.S.A0000 && DRLK.S.M.SimulateNotFullyLocked && + PICS_SKIP_SAMPLE_APP verification: | vendor will give instructions on how to simulate if applicable and if that is possible, then send the below command to read the lock state attribute. @@ -328,7 +329,7 @@ tests: maxValue: 4294967294 - label: "Step 5b: TH writes DoorOpenEvents attribute as 0" - PICS: DRLK.S.A0004.Write + PICS: DRLK.S.A0004 command: "writeAttribute" attribute: "DoorOpenEvents" arguments: @@ -343,7 +344,7 @@ tests: #Test plan issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/2863 - label: "Step 5c: TH reads DoorOpenEvents attribute from DUT" - PICS: DRLK.S.A0004.Write && PICS_SKIP_SAMPLE_APP + PICS: DRLK.S.A0004 && PICS_SKIP_SAMPLE_APP verification: | This is an Optional attribute, so its not compulsory to get the expected outcome @@ -382,7 +383,7 @@ tests: maxValue: 4294967294 - label: "Step 6b: TH writes DoorClosedEvents attribute as 0" - PICS: DRLK.S.A0005.Write + PICS: DRLK.S.A0005 command: "writeAttribute" attribute: "DoorClosedEvents" arguments: @@ -397,7 +398,7 @@ tests: #Test plan issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/2863 - label: "Step 6c: TH reads DoorOpenEvents attribute from DUT" - PICS: DRLK.S.A0005.Write && PICS_SKIP_SAMPLE_APP + PICS: DRLK.S.A0005 && PICS_SKIP_SAMPLE_APP verification: | This is an Optional attribute, so its not compulsory to get the expected outcome @@ -781,14 +782,14 @@ tests: maxLength: 3 - label: "Step 19b: TH writes Language attribute as fr" - PICS: DRLK.S.A0021 && DRLK.S.A0021.Write + PICS: DRLK.S.A0021 && DRLK.S.M.LanguageAttributeWritable command: "writeAttribute" attribute: "Language" arguments: value: "fr" - label: "Step 19b: TH writes Language attribute as fr" - PICS: DRLK.S.A0021 && !DRLK.S.A0021.Write + PICS: DRLK.S.A0021 && !DRLK.S.M.LanguageAttributeWritable command: "writeAttribute" attribute: "Language" arguments: @@ -797,14 +798,14 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 19c: TH reads Language attribute from DUT" - PICS: DRLK.S.A0021 && DRLK.S.A0021.Write + PICS: DRLK.S.A0021 && DRLK.S.M.LanguageAttributeWritable command: "readAttribute" attribute: "Language" response: value: "fr" - label: "Step 19c: TH reads Language attribute from DUT" - PICS: DRLK.S.A0021 && !DRLK.S.A0021.Write + PICS: DRLK.S.A0021 && !DRLK.S.M.LanguageAttributeWritable command: "readAttribute" attribute: "Language" response: @@ -824,14 +825,14 @@ tests: maxValue: 2 - label: "Step 20b: TH writes LEDSettings attribute as 2" - PICS: DRLK.S.A0022.Write + PICS: DRLK.S.M.LEDSettingsAttributeWritable && DRLK.S.A0022 command: "writeAttribute" attribute: "LEDSettings" arguments: value: 2 - label: "Step 20b: TH writes LEDSettings attribute as 2" - PICS: " !DRLK.S.A0022.Write && DRLK.S.A0022 " + PICS: " !DRLK.S.M.LEDSettingsAttributeWritable && DRLK.S.A0022 " command: "writeAttribute" attribute: "LEDSettings" arguments: @@ -840,14 +841,14 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 20c: TH reads LEDSettings attribute from DUT" - PICS: DRLK.S.A0022.Write + PICS: DRLK.S.M.LEDSettingsAttributeWritable && DRLK.S.A0022 command: "readAttribute" attribute: "LEDSettings" response: value: 2 - label: "Step 20c: TH reads LEDSettings attribute from DUT" - PICS: " !DRLK.S.A0022.Write && DRLK.S.A0022 " + PICS: " !DRLK.S.M.LEDSettingsAttributeWritable && DRLK.S.A0022 " command: "readAttribute" attribute: "LEDSettings" response: @@ -867,14 +868,14 @@ tests: maxValue: 4294967294 - label: "Step 21b: TH writes AutoRelockTime attribute as 180 seconds" - PICS: DRLK.S.A0023.Write + PICS: DRLK.S.M.AutoRelockTimeAttributeWritable && DRLK.S.A0023 command: "writeAttribute" attribute: "AutoRelockTime" arguments: value: 180 - label: "Step 21b: TH writes AutoRelockTime attribute as 180 seconds" - PICS: " !DRLK.S.A0023.Write && DRLK.S.A0023 " + PICS: " !DRLK.S.M.AutoRelockTimeAttributeWritable && DRLK.S.A0023 " command: "writeAttribute" attribute: "AutoRelockTime" arguments: @@ -883,14 +884,14 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 21c: TH reads AutoRelockTime attribute from DUT" - PICS: DRLK.S.A0023.Write + PICS: DRLK.S.M.AutoRelockTimeAttributeWritable && DRLK.S.A0023 command: "readAttribute" attribute: "AutoRelockTime" response: value: 180 - label: "Step 21c: TH reads AutoRelockTime attribute from DUT" - PICS: " !DRLK.S.A0023.Write && DRLK.S.A0023 " + PICS: " !DRLK.S.M.AutoRelockTimeAttributeWritable && DRLK.S.A0023 " command: "readAttribute" attribute: "AutoRelockTime" response: @@ -910,14 +911,14 @@ tests: maxValue: 3 - label: "Step 22b: TH writes SoundVolume attribute as 3" - PICS: DRLK.S.A0024.Write + PICS: DRLK.S.M.SoundVolumeAttributeWritable && DRLK.S.A0024 command: "writeAttribute" attribute: "SoundVolume" arguments: value: 3 - label: "Step 22b: TH writes SoundVolume attribute as 3" - PICS: " !DRLK.S.A0024.Write && DRLK.S.A0024 " + PICS: " !DRLK.S.M.SoundVolumeAttributeWritable && DRLK.S.A0024 " command: "writeAttribute" attribute: "SoundVolume" arguments: @@ -926,14 +927,14 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 22c: TH reads SoundVolume attribute from DUT" - PICS: DRLK.S.A0024.Write + PICS: DRLK.S.M.SoundVolumeAttributeWritable && DRLK.S.A0024 command: "readAttribute" attribute: "SoundVolume" response: value: 3 - label: "Step 22c: TH reads SoundVolume attribute from DUT" - PICS: " !DRLK.S.A0024.Write && DRLK.S.A0024 " + PICS: " !DRLK.S.M.SoundVolumeAttributeWritable && DRLK.S.A0024 " command: "readAttribute" attribute: "SoundVolume" response: @@ -952,28 +953,13 @@ tests: - label: "Step 23b: TH writes Supported OperatingModes attribute as bit 0 is set to 0" - PICS: PICS_SKIP_SAMPLE_APP && DRLK.S.A0026 - verification: | - ./chip-tool doorlock write-by-id 38 0 1 1 - - Via the TH (chip-tool), verify the UNSUPPORTED_WRITE response for Supported OperatingModes attribute write functionality. - - [1653637108.039160][3522:3527] CHIP:DMG: StatusIB = - [1653637108.039205][3522:3527] CHIP:DMG: { - [1653637108.039250][3522:3527] CHIP:DMG: status = 0x88 (UNSUPPORTED_WRITE), - [1653637108.039297][3522:3527] CHIP:DMG: }, - [1653637108.039343][3522:3527] CHIP:DMG: - [1653637108.039380][3522:3527] CHIP:DMG: }, - [1653637108.039424][3522:3527] CHIP:DMG: - [1653637108.039460][3522:3527] CHIP:DMG: ], - cluster: "LogCommands" - command: "UserPrompt" + PICS: DRLK.S.A0026 + command: "writeAttribute" + attribute: "SupportedOperatingModes" arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + value: 0 + response: + error: UNSUPPORTED_WRITE - label: "Step 23c: TH reads Supported OperatingModes attribute from DUT" PICS: DRLK.S.A0026 @@ -998,7 +984,7 @@ tests: - label: "Step 24b: TH writes OperatingMode attribute to a value as Normal and the new value is present in SupportedOperatingModes" - PICS: DRLK.S.A0025.Write + PICS: DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 command: "writeAttribute" attribute: "OperatingMode" arguments: @@ -1007,7 +993,7 @@ tests: - label: "Step 24b: TH writes OperatingMode attribute to a value as Normal and the new value is present in SupportedOperatingModes" - PICS: " !DRLK.S.A0025.Write && DRLK.S.A0025 " + PICS: " !DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 " command: "writeAttribute" attribute: "OperatingMode" arguments: @@ -1019,7 +1005,7 @@ tests: "Step 24c: TH writes OperatingMode attribute to a value as NoRemoteLockUnlock and the new value is present in Supported OperatingModes" - PICS: DRLK.S.A0025.Write + PICS: DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 command: "writeAttribute" attribute: "OperatingMode" arguments: @@ -1029,7 +1015,7 @@ tests: "Step 24c: TH writes OperatingMode attribute to a value as NoRemoteLockUnlock and the new value is present in Supported OperatingModes" - PICS: " !DRLK.S.A0025.Write && DRLK.S.A0025 " + PICS: " !DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 " command: "writeAttribute" attribute: "OperatingMode" arguments: @@ -1038,7 +1024,7 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 24d: TH reads OperatingMode attribute from DUT" - PICS: DRLK.S.A0025.Write + PICS: DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 command: "readAttribute" attribute: "OperatingMode" response: @@ -1046,7 +1032,7 @@ tests: anyOf: [0, 3] - label: "Step 24d: TH reads OperatingMode attribute from DUT" - PICS: " !DRLK.S.A0025.Write && DRLK.S.A0025 " + PICS: " !DRLK.S.M.OperatingModeAttributeWritable && DRLK.S.A0025 " command: "readAttribute" attribute: "OperatingMode" response: @@ -1067,30 +1053,13 @@ tests: - label: "Step 25b: TH writes Default ConfigurationRegister attribute as bit 0 is set to 1" - PICS: DRLK.S.A0027 && PICS_SKIP_SAMPLE_APP - verification: | - This is an Optional attribute, so its not compulsory to get the expected outcome - - ./chip-tool doorlock write-by-id 39 1 1 1 - - Via the TH (chip-tool), verify the UNSUPPORTED_WRITE response for Default ConfigurationRegister attribute write functionality. - - [1653637348.333879][3570:3575] CHIP:DMG: StatusIB = - [1653637348.333920][3570:3575] CHIP:DMG: { - [1653637348.333961][3570:3575] CHIP:DMG: status = 0x86 (UNSUPPORTED_ATTRIBUTE), - [1653637348.334007][3570:3575] CHIP:DMG: }, - [1653637348.334048][3570:3575] CHIP:DMG: - [1653637348.334084][3570:3575] CHIP:DMG: }, - [1653637348.334124][3570:3575] CHIP:DMG: - [1653637348.334156][3570:3575] CHIP:DMG: ], - cluster: "LogCommands" - command: "UserPrompt" + PICS: DRLK.S.A0027 + command: "writeAttribute" + attribute: "DefaultConfigurationRegister" arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + value: 1 + response: + error: UNSUPPORTED_WRITE - label: "Step 25c: TH reads Default ConfigurationRegister attribute from DUT" @@ -1112,14 +1081,15 @@ tests: type: boolean - label: "Step 26b: TH writes EnableLocalProgramming attribute as false" - PICS: DRLK.S.A0028.Write + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A0028 command: "writeAttribute" attribute: "EnableLocalProgramming" arguments: value: 0 - label: "Step 26b: TH writes EnableLocalProgramming attribute as false" - PICS: " !DRLK.S.A0028.Write && DRLK.S.A0028 " + PICS: + " !DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A0028 " command: "writeAttribute" attribute: "EnableLocalProgramming" arguments: @@ -1128,14 +1098,15 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 26c: TH reads EnableLocalProgramming attribute from DUT" - PICS: DRLK.S.A0028.Write + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A0028 command: "readAttribute" attribute: "EnableLocalProgramming" response: value: 0 - label: "Step 26c: TH reads EnableLocalProgramming attribute from DUT" - PICS: " !DRLK.S.A0028.Write && DRLK.S.A0028 " + PICS: + " !DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A0028 " command: "readAttribute" attribute: "EnableLocalProgramming" response: @@ -1245,7 +1216,7 @@ tests: - label: "Step 30c: TH writes to LocalProgrammingFeatures to disable all the features (Change all bits to 0)" - PICS: DRLK.S.A002c.Write && DRLK.S.A0028 + PICS: DRLK.S.M.LocalProgrammingFeaturesAttributeWritable && DRLK.S.A0028 command: "writeAttribute" attribute: "LocalProgrammingFeatures" arguments: @@ -1254,7 +1225,7 @@ tests: - label: "Step 30c: TH reads LocalProgrammingFeatures attribute from DUT. DRLK.S.A0028(EnableLocalProgramming) is False." - PICS: DRLK.S.A002c.Write && DRLK.S.A0028 + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A0028 command: "readAttribute" attribute: "LocalProgrammingFeatures" response: @@ -1263,7 +1234,7 @@ tests: hasMasksClear: [0x1, 0x2, 0x4, 0x8] - label: "Step 30d: TH sets the EnableLocalProgramming attribute to False" - PICS: DRLK.S.A002c + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A002c command: "writeAttribute" attribute: "EnableLocalProgramming" arguments: @@ -1272,7 +1243,7 @@ tests: - label: "Step 30d: Verify that all the 4 bits in the LocalProgrammingFeatures is set to 0." - PICS: DRLK.S.A002c + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A002c command: "readAttribute" attribute: "LocalProgrammingFeatures" response: @@ -1281,7 +1252,7 @@ tests: hasMasksClear: [0x1, 0x2, 0x4, 0x8] - label: "Step 30e: TH sets the EnableLocalProgramming attribute to True" - PICS: DRLK.S.A0028.Write + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A002c command: "writeAttribute" attribute: "EnableLocalProgramming" arguments: @@ -1290,7 +1261,7 @@ tests: - label: "Step 30e: Verify that all the 4 bits in the LocalProgrammingFeatures is set to 1." - PICS: DRLK.S.A0028.Write + PICS: DRLK.S.M.EnableLocalProgrammingAttributeWritable && DRLK.S.A002c command: "readAttribute" attribute: "LocalProgrammingFeatures" response: @@ -1301,7 +1272,7 @@ tests: - label: "Step 30f: TH sends a write message to change any one of the bits of the LocalProgrammingFeatures." - PICS: DRLK.S.A002c && DRLK.S.A002c.Write + PICS: DRLK.S.A002c && DRLK.S.M.LocalProgrammingFeaturesAttributeWritable command: "writeAttribute" attribute: "LocalProgrammingFeatures" arguments: @@ -1310,7 +1281,7 @@ tests: - label: "Step 30f: Verify that the correct bit has been changed by doing a Read on LocalProgrammingFeatures attribute.." - PICS: DRLK.S.A0028.Write + PICS: DRLK.S.M.LocalProgrammingFeaturesAttributeWritable command: "readAttribute" attribute: "LocalProgrammingFeatures" response: @@ -1321,7 +1292,7 @@ tests: - label: "Step 30g: TH sends a write message to change any one of the bits of the LocalProgrammingFeatures." - PICS: DRLK.S.A002c && DRLK.S.A002c.ReadOnly + PICS: DRLK.S.A002c command: "writeAttribute" attribute: "LocalProgrammingFeatures" arguments: @@ -1343,14 +1314,18 @@ tests: maxValue: 255 - label: "Step 31b: TH writes WrongCodeEntryLimit attribute as 8" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write + PICS: + ( DRLK.S.F00 || DRLK.S.F01 ) && + DRLK.S.M.WrongCodeEntryLimitAttributeWritable command: "writeAttribute" attribute: "WrongCodeEntryLimit" arguments: value: 8 - label: "Step 31b: TH writes WrongCodeEntryLimit attribute as 8" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write + PICS: + " ( DRLK.S.F00 || DRLK.S.F01 ) && + !DRLK.S.M.WrongCodeEntryLimitAttributeWritable " command: "writeAttribute" attribute: "WrongCodeEntryLimit" arguments: @@ -1359,14 +1334,18 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 31c: TH reads WrongCode EntryLimit attribute" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0030.Write + PICS: + ( DRLK.S.F00 || DRLK.S.F01 ) && + DRLK.S.M.WrongCodeEntryLimitAttributeWritable command: "readAttribute" attribute: "WrongCodeEntryLimit" response: value: 8 - label: "Step 31c: TH reads WrongCode EntryLimit attribute" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0030.Write + PICS: + " ( DRLK.S.F00 || DRLK.S.F01 ) && + !DRLK.S.M.WrongCodeEntryLimitAttributeWritable " command: "readAttribute" attribute: "WrongCodeEntryLimit" response: @@ -1386,14 +1365,18 @@ tests: maxValue: 255 - label: "Step 32b: TH writes UserCodeTemporaryDisableTime attribute as 120" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write + PICS: + ( DRLK.S.F00 || DRLK.S.F01 ) && + DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable command: "writeAttribute" attribute: "UserCodeTemporaryDisableTime" arguments: value: 120 - label: "Step 32b: TH writes UserCodeTemporaryDisableTime attribute as 120" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write + PICS: + " ( DRLK.S.F00 || DRLK.S.F01 ) && + !DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable " command: "writeAttribute" attribute: "UserCodeTemporaryDisableTime" arguments: @@ -1402,14 +1385,18 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 32c: TH reads UserCodeTemporary DisableTime attribute" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && DRLK.S.A0031.Write + PICS: + ( DRLK.S.F00 || DRLK.S.F01 ) && + DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable command: "readAttribute" attribute: "UserCodeTemporaryDisableTime" response: value: 120 - label: "Step 32c: TH reads UserCodeTemporary DisableTime attribute" - PICS: ( DRLK.S.F00 || DRLK.S.F01 ) && !DRLK.S.A0031.Write + PICS: + " ( DRLK.S.F00 || DRLK.S.F01 ) && + !DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable " command: "readAttribute" attribute: "UserCodeTemporaryDisableTime" response: @@ -1427,7 +1414,9 @@ tests: - label: "Step 33b: TH writes RequirePINfor RemoteOperation attribute as true" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write + PICS: + DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 && + DRLK.S.M.RequirePINForRemoteOperationAttributeWritable command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -1435,7 +1424,9 @@ tests: - label: "Step 33b: TH writes RequirePINfor RemoteOperation attribute as true" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write + PICS: + " DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 && + !DRLK.S.M.RequirePINForRemoteOperationAttributeWritable " command: "writeAttribute" attribute: "RequirePINforRemoteOperation" arguments: @@ -1444,14 +1435,18 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 33c: TH reads RequirePINfor RemoteOperation attribute" - PICS: DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033.Write + PICS: + DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 && + DRLK.S.M.RequirePINForRemoteOperationAttributeWritable command: "readAttribute" attribute: "RequirePINforRemoteOperation" response: value: 1 - label: "Step 33c: TH reads RequirePINfor RemoteOperation attribute" - PICS: DRLK.S.F07 && DRLK.S.F00 && !DRLK.S.A0033.Write + PICS: + " DRLK.S.F07 && DRLK.S.F00 && DRLK.S.A0033 && + !DRLK.S.M.RequirePINForRemoteOperationAttributeWritable " command: "readAttribute" attribute: "RequirePINforRemoteOperation" response: @@ -1471,14 +1466,18 @@ tests: maxValue: 2880 - label: "Step 34b: TH writes ExpiringUserTimeout attribute as 10 minutes" - PICS: DRLK.S.F08 && DRLK.S.A0035.Write && DRLK.S.A0035 + PICS: + DRLK.S.F08 && DRLK.S.A0035 && + DRLK.S.M.ExpiringUserTimeOutAttributeWritable command: "writeAttribute" attribute: "ExpiringUserTimeout" arguments: value: 10 - label: "Step 34b: TH writes ExpiringUserTimeout attribute as 10 minutes" - PICS: DRLK.S.F08 && !DRLK.S.A0035.Write && DRLK.S.A0035 + PICS: + DRLK.S.F08 && !DRLK.S.M.ExpiringUserTimeOutAttributeWritable && + DRLK.S.A0035 command: "writeAttribute" attribute: "ExpiringUserTimeout" arguments: @@ -1487,14 +1486,18 @@ tests: error: UNSUPPORTED_WRITE - label: "Step 34c: TH reads ExpiringUserTimeout attribute" - PICS: DRLK.S.F08 && DRLK.S.A0035.Write && DRLK.S.A0035 + PICS: + DRLK.S.F08 && DRLK.S.A0035 && + DRLK.S.M.ExpiringUserTimeOutAttributeWritable command: "readAttribute" attribute: "ExpiringUserTimeout" response: value: 10 - label: "Step 34c: TH reads ExpiringUserTimeout attribute" - PICS: DRLK.S.F08 && !DRLK.S.A0035.Write && DRLK.S.A0035 + PICS: + " DRLK.S.F08 && DRLK.S.A0035 && + !DRLK.S.M.ExpiringUserTimeOutAttributeWritable " command: "readAttribute" attribute: "ExpiringUserTimeout" response: diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml index 7ae95330c7b37e..bd593dadbf973c 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_4.yaml @@ -130,7 +130,7 @@ tests: - label: "Step 1a: TH writes AutoRelockTime attribute value as 10 seconds on the DUT" - PICS: DRLK.S.A0023.Write && PICS_SDK_CI_ONLY + PICS: DRLK.S.M.AutoRelockTimeAttributeWritable && PICS_SDK_CI_ONLY command: "writeAttribute" attribute: "AutoRelockTime" arguments: @@ -139,7 +139,7 @@ tests: - label: "Step 1b: TH writes AutoRelockTime attribute value as 60 seconds on the DUT" - PICS: DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP + PICS: DRLK.S.M.AutoRelockTimeAttributeWritable && PICS_SKIP_SAMPLE_APP command: "writeAttribute" attribute: "AutoRelockTime" arguments: @@ -148,7 +148,7 @@ tests: - label: "Step 1c: TH writes AutoRelockTime attribute value as 10 seconds on the DUT" - PICS: PICS_SDK_CI_ONLY && !DRLK.S.A0023.Write + PICS: PICS_SDK_CI_ONLY && !DRLK.S.M.AutoRelockTimeAttributeWritable command: "writeAttribute" attribute: "AutoRelockTime" arguments: @@ -159,7 +159,7 @@ tests: - label: "Step 1d: TH writes AutoRelockTime attribute value as 60 seconds on the DUT" - PICS: PICS_SKIP_SAMPLE_APP && !DRLK.S.A0023.Write + PICS: PICS_SKIP_SAMPLE_APP && !DRLK.S.M.AutoRelockTimeAttributeWritable command: "writeAttribute" attribute: "AutoRelockTime" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml index 234c3b16b68679..3c38efe9802c5d 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_3_2.yaml @@ -37,1992 +37,782 @@ tests: lock disabled: true - - label: "DUT sends Lock Door command to TH." + - label: "Step 1: DUT sends Lock Door command to TH." PICS: DRLK.C.C00.Tx verification: | - ./chip-tool doorlock lock-door 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Lock Door command response" on TH(lock-app): - - [1667211168.741765][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1ae992d0 exchange 12975r - [1667211168.741897][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211168.741963][14571:14571] CHIP:DMG: { - [1667211168.742021][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211168.742112][14571:14571] CHIP:DMG: timedRequest = true, - [1667211168.742176][14571:14571] CHIP:DMG: InvokeRequests = - [1667211168.742252][14571:14571] CHIP:DMG: [ - [1667211168.742336][14571:14571] CHIP:DMG: CommandDataIB = - [1667211168.742420][14571:14571] CHIP:DMG: { - [1667211168.742552][14571:14571] CHIP:DMG: CommandPathIB = - [1667211168.742650][14571:14571] CHIP:DMG: { - [1667211168.742767][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211168.742871][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211168.742981][14571:14571] CHIP:DMG: CommandId = 0x0, - [1667211168.743073][14571:14571] CHIP:DMG: }, - [1667211168.743195][14571:14571] CHIP:DMG: - [1667211168.743271][14571:14571] CHIP:DMG: CommandFields = - [1667211168.743387][14571:14571] CHIP:DMG: { - [1667211168.743479][14571:14571] CHIP:DMG: }, - [1667211168.743575][14571:14571] CHIP:DMG: }, - [1667211168.743659][14571:14571] CHIP:DMG: - [1667211168.743728][14571:14571] CHIP:DMG: ], - [1667211168.743826][14571:14571] CHIP:DMG: - [1667211168.743889][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211168.743977][14571:14571] CHIP:DMG: }, - [1667211168.744148][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=o - [1667211168.744232][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211168.744330][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0000 - [1667211168.744405][14571:14571] CHIP:ZCL: Received command: LockDoor - [1667211168.744503][14571:14571] CHIP:ZCL: Door Lock App: PIN code is not specified [endpointId=1] - [1667211168.744561][14571:14571] CHIP:ZCL: Door Lock App: setting door lock state to "Locked" [endpointId=1] - [1667211168.745043][14571:14571] CHIP:DL: writing settings to file (/tmp/chip_kvs-PL8ciy) - [1667211168.747033][14571:14571] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs) - [1667211168.747214][14571:14571] CHIP:DMG: Endpoint 1, Cluster 0x0000_0101 update version to b353ec51 - [1667211168.747284][14571:14571] CHIP:ZCL: Door Lock attribute changed - [1667211168.747376][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211168.747452][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211168.747519][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211168.747672][14571:14571] CHIP:EVL: LogEvent event number: 0x0000000000000004 priority: 2, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x2 Sys timestamp: 0x00000000012017A5 - [1667211168.747840][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211168.748497][14571:14571] CHIP:EM: <<< [E:12975r M:85727605 (Ack:252354155)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211168.748712][14571:14571] CHIP:IN: (S) Sending msg 85727605 on secure session with LSID: 42466 - [1667211168.749498][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:45017 | 85727605 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 140 / Exchange = 12975] - [1667211168.749605][14571:14571] CHIP:DMG: Header Flags = - [1667211168.749664][14571:14571] CHIP:DMG: { - [1667211168.749753][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211168.749811][14571:14571] CHIP:DMG: { - [1667211168.749874][14571:14571] CHIP:DMG: AckMsg = 252354155 - [1667211168.749930][14571:14571] CHIP:DMG: NeedsAck = true - [1667211168.749985][14571:14571] CHIP:DMG: } - [1667211168.750087][14571:14571] CHIP:DMG: } - [1667211168.750143][14571:14571] CHIP:DMG: - [1667211168.750217][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211168.750296][14571:14571] CHIP:DMG: { - [1667211168.750351][14571:14571] CHIP:DMG: data = 008c000075191c052fd5a859bb32eeaa412a0f49ad60407a9dcbb11e2783182dce02395d25d4a9d77216b57c1358b700b03d9ba9ed2529116cdcea0d4fde035e6f16b4e0 - [1667211168.750411][14571:14571] CHIP:DMG: buffer_ptr = 187651867773680 - [1667211168.750541][14571:14571] CHIP:DMG: } - [1667211168.750598][14571:14571] CHIP:DMG: - [1667211168.750683][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211168.750763][14571:14571] CHIP:DMG: { - [1667211168.750818][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402001835012400001818181824ff0118 - [1667211168.750875][14571:14571] CHIP:DMG: } - [1667211168.750949][14571:14571] CHIP:DMG: - [1667211168.751118][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211168.751185][14571:14571] CHIP:DMG: { - [1667211168.751245][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211168.751308][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211168.751409][14571:14571] CHIP:DMG: [ - [1667211168.751476][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211168.751570][14571:14571] CHIP:DMG: { - [1667211168.751668][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211168.751761][14571:14571] CHIP:DMG: { - [1667211168.751871][14571:14571] CHIP:DMG: CommandPathIB = - [1667211168.751968][14571:14571] CHIP:DMG: { - [1667211168.752090][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211168.752216][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211168.752320][14571:14571] CHIP:DMG: CommandId = 0x0, - [1667211168.752439][14571:14571] CHIP:DMG: }, - [1667211168.752570][14571:14571] CHIP:DMG: - [1667211168.752661][14571:14571] CHIP:DMG: StatusIB = - [1667211168.752784][14571:14571] CHIP:DMG: { - [1667211168.752883][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211168.753002][14571:14571] CHIP:DMG: }, - [1667211168.753099][14571:14571] CHIP:DMG: - [1667211168.753208][14571:14571] CHIP:DMG: }, - [1667211168.753317][14571:14571] CHIP:DMG: + ./chip-tool doorlock lock-door 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Lock Door command with SUCCESS response on TH(lock-app) log: + + [1685673050.566811][2584:2586] CHIP:DMG: InvokeResponseMessage = + [1685673050.566867][2584:2586] CHIP:DMG: { + [1685673050.566921][2584:2586] CHIP:DMG: suppressResponse = false, + [1685673050.566977][2584:2586] CHIP:DMG: InvokeResponseIBs = + [1685673050.567050][2584:2586] CHIP:DMG: [ + [1685673050.567107][2584:2586] CHIP:DMG: InvokeResponseIB = + [1685673050.567186][2584:2586] CHIP:DMG: { + [1685673050.567248][2584:2586] CHIP:DMG: CommandStatusIB = + [1685673050.567320][2584:2586] CHIP:DMG: { + [1685673050.567387][2584:2586] CHIP:DMG: CommandPathIB = + [1685673050.567464][2584:2586] CHIP:DMG: { + [1685673050.567540][2584:2586] CHIP:DMG: EndpointId = 0x1, + [1685673050.567625][2584:2586] CHIP:DMG: ClusterId = 0x101, + [1685673050.567706][2584:2586] CHIP:DMG: CommandId = 0x0, + [1685673050.567784][2584:2586] CHIP:DMG: }, + [1685673050.567870][2584:2586] CHIP:DMG: + [1685673050.567938][2584:2586] CHIP:DMG: StatusIB = + [1685673050.568015][2584:2586] CHIP:DMG: { + [1685673050.568092][2584:2586] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673050.568171][2584:2586] CHIP:DMG: }, + [1685673050.568246][2584:2586] CHIP:DMG: + [1685673050.568313][2584:2586] CHIP:DMG: }, + [1685673050.568389][2584:2586] CHIP:DMG: + [1685673050.568451][2584:2586] CHIP:DMG: }, + [1685673050.568524][2584:2586] CHIP:DMG: + [1685673050.568578][2584:2586] CHIP:DMG: ], + [1685673050.568650][2584:2586] CHIP:DMG: + [1685673050.568707][2584:2586] CHIP:DMG: InteractionModelRevision = 1 + [1685673050.568761][2584:2586] CHIP:DMG: }, disabled: true - - label: "DUT sends Unlock Door command to TH." + - label: "Step 2: DUT sends Unlock Door command to TH." PICS: DRLK.C.C01.Tx verification: | - ./chip-tool doorlock unlock-door 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Unlock Door command response" on TH(lock-app): - - [1667211210.888806][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeae8d0 exchange 13369r - [1667211210.888932][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211210.888996][14571:14571] CHIP:DMG: { - [1667211210.889054][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211210.889148][14571:14571] CHIP:DMG: timedRequest = true, - [1667211210.889211][14571:14571] CHIP:DMG: InvokeRequests = - [1667211210.889288][14571:14571] CHIP:DMG: [ - [1667211210.889372][14571:14571] CHIP:DMG: CommandDataIB = - [1667211210.889450][14571:14571] CHIP:DMG: { - [1667211210.889538][14571:14571] CHIP:DMG: CommandPathIB = - [1667211210.889627][14571:14571] CHIP:DMG: { - [1667211210.889731][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211210.889818][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211210.889934][14571:14571] CHIP:DMG: CommandId = 0x1, - [1667211210.890015][14571:14571] CHIP:DMG: }, - [1667211210.890126][14571:14571] CHIP:DMG: - [1667211210.890199][14571:14571] CHIP:DMG: CommandFields = - [1667211210.890299][14571:14571] CHIP:DMG: { - [1667211210.890380][14571:14571] CHIP:DMG: }, - [1667211210.890511][14571:14571] CHIP:DMG: }, - [1667211210.890595][14571:14571] CHIP:DMG: - [1667211210.890851][14571:14571] CHIP:DMG: ], - [1667211210.890930][14571:14571] CHIP:DMG: - [1667211210.890992][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211210.891057][14571:14571] CHIP:DMG: }, - [1667211210.891222][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=o - [1667211210.891303][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211210.891397][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0001 - [1667211210.891471][14571:14571] CHIP:ZCL: Received command: UnlockDoor - [1667211210.891589][14571:14571] CHIP:ZCL: Door Lock App: PIN code is not specified [endpointId=1] - [1667211210.891647][14571:14571] CHIP:ZCL: Door Lock App: setting door lock state to "Unlocked" [endpointId=1] - [1667211210.892108][14571:14571] CHIP:DL: writing settings to file (/tmp/chip_kvs-0agKuS) - [1667211210.893899][14571:14571] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs) - [1667211210.894042][14571:14571] CHIP:DMG: Endpoint 1, Cluster 0x0000_0101 update version to b353ec52 - [1667211210.894109][14571:14571] CHIP:ZCL: Door Lock attribute changed - [1667211210.894195][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211210.894270][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211210.894369][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211210.894554][14571:14571] CHIP:EVL: LogEvent event number: 0x0000000000000005 priority: 2, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x2 Sys timestamp: 0x000000000120BC47 - [1667211210.894731][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211210.895390][14571:14571] CHIP:EM: <<< [E:13369r M:260723914 (Ack:152448902)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211210.895497][14571:14571] CHIP:IN: (S) Sending msg 260723914 on secure session with LSID: 42467 - [1667211210.896195][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:58898 | 260723914 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 18140 / Exchange = 13369] - [1667211210.896294][14571:14571] CHIP:DMG: Header Flags = - [1667211210.896353][14571:14571] CHIP:DMG: { - [1667211210.896440][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211210.896497][14571:14571] CHIP:DMG: { - [1667211210.896558][14571:14571] CHIP:DMG: AckMsg = 152448902 - [1667211210.896638][14571:14571] CHIP:DMG: NeedsAck = true - [1667211210.896694][14571:14571] CHIP:DMG: } - [1667211210.896767][14571:14571] CHIP:DMG: } - [1667211210.896846][14571:14571] CHIP:DMG: - [1667211210.896915][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211210.896972][14571:14571] CHIP:DMG: { - [1667211210.897051][14571:14571] CHIP:DMG: data = 00dc4600ca548a0f60b7468a74de96ab927f1330336ba152aef8f28cc48a8f33f68a755ea9502cdbb67530880e104c90ebcbd525bc5b1c7f46d03f109624324a41148ed9 - [1667211210.897109][14571:14571] CHIP:DMG: buffer_ptr = 187651867773984 - [1667211210.897163][14571:14571] CHIP:DMG: } - [1667211210.897238][14571:14571] CHIP:DMG: - [1667211210.897314][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211210.897371][14571:14571] CHIP:DMG: { - [1667211210.897448][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402011835012400001818181824ff0118 - [1667211210.897503][14571:14571] CHIP:DMG: } - [1667211210.897556][14571:14571] CHIP:DMG: - [1667211210.897691][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211210.897754][14571:14571] CHIP:DMG: { - [1667211210.897813][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211210.897875][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211210.897952][14571:14571] CHIP:DMG: [ - [1667211210.898015][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211210.898261][14571:14571] CHIP:DMG: { - [1667211210.898334][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211210.898414][14571:14571] CHIP:DMG: { - [1667211210.898548][14571:14571] CHIP:DMG: CommandPathIB = - [1667211210.898638][14571:14571] CHIP:DMG: { - [1667211210.898733][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211210.898830][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211210.898929][14571:14571] CHIP:DMG: CommandId = 0x1, - [1667211210.899021][14571:14571] CHIP:DMG: }, - [1667211210.899124][14571:14571] CHIP:DMG: - [1667211210.899201][14571:14571] CHIP:DMG: StatusIB = - [1667211210.899286][14571:14571] CHIP:DMG: { - [1667211210.899372][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211210.899466][14571:14571] CHIP:DMG: }, - [1667211210.899551][14571:14571] CHIP:DMG: + ./chip-tool doorlock unlock-door 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Unlock Door command with SUCCESS response on TH(lock-app) log: + + [1685673083.557613][2593:2595] CHIP:DMG: InvokeResponseMessage = + [1685673083.557668][2593:2595] CHIP:DMG: { + [1685673083.557724][2593:2595] CHIP:DMG: suppressResponse = false, + [1685673083.557834][2593:2595] CHIP:DMG: InvokeResponseIBs = + [1685673083.557915][2593:2595] CHIP:DMG: [ + [1685673083.557973][2593:2595] CHIP:DMG: InvokeResponseIB = + [1685673083.558070][2593:2595] CHIP:DMG: { + [1685673083.558133][2593:2595] CHIP:DMG: CommandStatusIB = + [1685673083.558222][2593:2595] CHIP:DMG: { + [1685673083.558306][2593:2595] CHIP:DMG: CommandPathIB = + [1685673083.558399][2593:2595] CHIP:DMG: { + [1685673083.558493][2593:2595] CHIP:DMG: EndpointId = 0x1, + [1685673083.558589][2593:2595] CHIP:DMG: ClusterId = 0x101, + [1685673083.558685][2593:2595] CHIP:DMG: CommandId = 0x1, + [1685673083.558775][2593:2595] CHIP:DMG: }, + [1685673083.558878][2593:2595] CHIP:DMG: + [1685673083.558962][2593:2595] CHIP:DMG: StatusIB = + [1685673083.559058][2593:2595] CHIP:DMG: { + [1685673083.559150][2593:2595] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673083.559243][2593:2595] CHIP:DMG: }, + [1685673083.559335][2593:2595] CHIP:DMG: + [1685673083.559418][2593:2595] CHIP:DMG: }, + [1685673083.559513][2593:2595] CHIP:DMG: + [1685673083.559582][2593:2595] CHIP:DMG: }, + [1685673083.559663][2593:2595] CHIP:DMG: + [1685673083.559720][2593:2595] CHIP:DMG: ], + [1685673083.559792][2593:2595] CHIP:DMG: + [1685673083.559848][2593:2595] CHIP:DMG: InteractionModelRevision = 1 + [1685673083.559903][2593:2595] CHIP:DMG: }, disabled: true - - label: "DUT sends Unlock with Timeout command to TH." + - label: "Step 3: DUT sends Unlock with Timeout command to TH." PICS: DRLK.C.C03.Tx verification: | - ./chip-tool doorlock unlock-with-timeout 60 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Unlock with Timeout command response" on TH(lock-app): - - - [1667211279.826689][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeae8d0 exchange 43708r - [1667211279.826800][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211279.826864][14571:14571] CHIP:DMG: { - [1667211279.826923][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211279.827006][14571:14571] CHIP:DMG: timedRequest = true, - [1667211279.827079][14571:14571] CHIP:DMG: InvokeRequests = - [1667211279.827160][14571:14571] CHIP:DMG: [ - [1667211279.827223][14571:14571] CHIP:DMG: CommandDataIB = - [1667211279.827303][14571:14571] CHIP:DMG: { - [1667211279.827377][14571:14571] CHIP:DMG: CommandPathIB = - [1667211279.827461][14571:14571] CHIP:DMG: { - [1667211279.827544][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211279.827633][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211279.827720][14571:14571] CHIP:DMG: CommandId = 0x3, - [1667211279.827800][14571:14571] CHIP:DMG: }, - [1667211279.827886][14571:14571] CHIP:DMG: - [1667211279.827962][14571:14571] CHIP:DMG: CommandFields = - [1667211279.828044][14571:14571] CHIP:DMG: { - [1667211279.828130][14571:14571] CHIP:DMG: 0x0 = 60, - [1667211279.828215][14571:14571] CHIP:DMG: }, - [1667211279.828294][14571:14571] CHIP:DMG: }, - [1667211279.828378][14571:14571] CHIP:DMG: - [1667211279.828447][14571:14571] CHIP:DMG: ], - [1667211279.828524][14571:14571] CHIP:DMG: - [1667211279.828585][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211279.828653][14571:14571] CHIP:DMG: }, - [1667211279.828802][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=o - [1667211279.828886][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211279.828956][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0003 - [1667211279.829035][14571:14571] CHIP:ZCL: Received command: UnlockWithTimeout - [1667211279.829134][14571:14571] CHIP:ZCL: Door Lock App: PIN code is not specified [endpointId=1] - [1667211279.829194][14571:14571] CHIP:ZCL: Door Lock App: setting door lock state to "Unlocked" [endpointId=1] - [1667211279.829602][14571:14571] CHIP:DL: writing settings to file (/tmp/chip_kvs-5rj3XN) - [1667211279.831590][14571:14571] CHIP:DL: renamed tmp file to file (/tmp/chip_kvs) - [1667211279.831771][14571:14571] CHIP:DMG: Endpoint 1, Cluster 0x0000_0101 update version to b353ec54 - [1667211279.831842][14571:14571] CHIP:ZCL: Door Lock attribute changed - [1667211279.831933][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211279.832225][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211279.832314][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211279.832471][14571:14571] CHIP:EVL: LogEvent event number: 0x0000000000000007 priority: 2, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x2 Sys timestamp: 0x000000000121C991 - [1667211279.832617][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211279.833224][14571:14571] CHIP:EM: <<< [E:43708r M:210923984 (Ack:79558162)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211279.833341][14571:14571] CHIP:IN: (S) Sending msg 210923984 on secure session with LSID: 42468 - [1667211279.834070][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:41489 | 210923984 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 34959 / Exchange = 43708] - [1667211279.834176][14571:14571] CHIP:DMG: Header Flags = - [1667211279.834234][14571:14571] CHIP:DMG: { - [1667211279.834323][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211279.834379][14571:14571] CHIP:DMG: { - [1667211279.834440][14571:14571] CHIP:DMG: AckMsg = 79558162 - [1667211279.834555][14571:14571] CHIP:DMG: NeedsAck = true - [1667211279.834612][14571:14571] CHIP:DMG: } - [1667211279.834687][14571:14571] CHIP:DMG: } - [1667211279.834742][14571:14571] CHIP:DMG: - [1667211279.834815][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211279.834871][14571:14571] CHIP:DMG: { - [1667211279.834926][14571:14571] CHIP:DMG: data = 008f8800d071920c8a5f99c962223f65c7ec32c0cdd27af5eca72ea2be963afe9c38803d90edf2bba9f03e364f3f482a9e4e9497dedaf876c9ae2f42c6264afa0f2a5137 - [1667211279.834986][14571:14571] CHIP:DMG: buffer_ptr = 187651867773696 - [1667211279.835040][14571:14571] CHIP:DMG: } - [1667211279.835092][14571:14571] CHIP:DMG: - [1667211279.835168][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211279.835224][14571:14571] CHIP:DMG: { - [1667211279.835279][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402031835012400001818181824ff0118 - [1667211279.835334][14571:14571] CHIP:DMG: } - [1667211279.835386][14571:14571] CHIP:DMG: - [1667211279.835529][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211279.835593][14571:14571] CHIP:DMG: { - [1667211279.835653][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211279.835716][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211279.835793][14571:14571] CHIP:DMG: [ - [1667211279.835856][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211279.835950][14571:14571] CHIP:DMG: { - [1667211279.836017][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211279.836100][14571:14571] CHIP:DMG: { - [1667211279.836178][14571:14571] CHIP:DMG: CommandPathIB = - [1667211279.836266][14571:14571] CHIP:DMG: { - [1667211279.836354][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211279.836446][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211279.836536][14571:14571] CHIP:DMG: CommandId = 0x3, - [1667211279.836622][14571:14571] CHIP:DMG: }, - [1667211279.836718][14571:14571] CHIP:DMG: - [1667211279.836799][14571:14571] CHIP:DMG: StatusIB = - [1667211279.836886][14571:14571] CHIP:DMG: { - [1667211279.836973][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211279.837058][14571:14571] CHIP:DMG: }, - [1667211279.837144][14571:14571] CHIP:DMG: - [1667211279.837221][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock unlock-with-timeout 60 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Unlock with Timeout command with SUCCESS response on TH(lock-app) log: + + [1685673101.154705][2596:2598] CHIP:DMG: InvokeResponseMessage = + [1685673101.154760][2596:2598] CHIP:DMG: { + [1685673101.154813][2596:2598] CHIP:DMG: suppressResponse = false, + [1685673101.154869][2596:2598] CHIP:DMG: InvokeResponseIBs = + [1685673101.154941][2596:2598] CHIP:DMG: [ + [1685673101.154998][2596:2598] CHIP:DMG: InvokeResponseIB = + [1685673101.155074][2596:2598] CHIP:DMG: { + [1685673101.155135][2596:2598] CHIP:DMG: CommandStatusIB = + [1685673101.155206][2596:2598] CHIP:DMG: { + [1685673101.155273][2596:2598] CHIP:DMG: CommandPathIB = + [1685673101.155349][2596:2598] CHIP:DMG: { + [1685673101.155426][2596:2598] CHIP:DMG: EndpointId = 0x1, + [1685673101.155501][2596:2598] CHIP:DMG: ClusterId = 0x101, + [1685673101.155586][2596:2598] CHIP:DMG: CommandId = 0x3, + [1685673101.155660][2596:2598] CHIP:DMG: }, + [1685673101.155743][2596:2598] CHIP:DMG: + [1685673101.155812][2596:2598] CHIP:DMG: StatusIB = + [1685673101.155886][2596:2598] CHIP:DMG: { + [1685673101.155965][2596:2598] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673101.156041][2596:2598] CHIP:DMG: }, + [1685673101.156115][2596:2598] CHIP:DMG: + [1685673101.156183][2596:2598] CHIP:DMG: }, + [1685673101.156259][2596:2598] CHIP:DMG: + [1685673101.156321][2596:2598] CHIP:DMG: }, + [1685673101.156392][2596:2598] CHIP:DMG: + [1685673101.156447][2596:2598] CHIP:DMG: ], + [1685673101.156517][2596:2598] CHIP:DMG: + [1685673101.156573][2596:2598] CHIP:DMG: InteractionModelRevision = 1 + [1685673101.156629][2596:2598] CHIP:DMG: }, disabled: true - - label: "DUT sends Set Week Day Schedule command to TH." + - label: "Step 4: DUT sends Set Week Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C0b.Tx verification: | - ./chip-tool doorlock set-user 0 1 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Set user command response" on TH(lock-app): - - [1667211313.632817][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeb6ce0 exchange 3349r - [1667211313.632935][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211313.632999][14571:14571] CHIP:DMG: { - [1667211313.633050][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211313.633118][14571:14571] CHIP:DMG: timedRequest = true, - [1667211313.633181][14571:14571] CHIP:DMG: InvokeRequests = - [1667211313.633266][14571:14571] CHIP:DMG: [ - [1667211313.633330][14571:14571] CHIP:DMG: CommandDataIB = - [1667211313.633416][14571:14571] CHIP:DMG: { - [1667211313.633493][14571:14571] CHIP:DMG: CommandPathIB = - [1667211313.633569][14571:14571] CHIP:DMG: { - [1667211313.633652][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211313.633742][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211313.633827][14571:14571] CHIP:DMG: CommandId = 0x1a, - [1667211313.633911][14571:14571] CHIP:DMG: }, - [1667211313.633996][14571:14571] CHIP:DMG: - [1667211313.634072][14571:14571] CHIP:DMG: CommandFields = - [1667211313.634146][14571:14571] CHIP:DMG: { - [1667211313.634223][14571:14571] CHIP:DMG: 0x0 = 0, - [1667211313.634310][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211313.634395][14571:14571] CHIP:DMG: 0x2 = "xxx" (3 chars), - [1667211313.634642][14571:14571] CHIP:DMG: 0x3 = 6452, - [1667211313.634737][14571:14571] CHIP:DMG: 0x4 = 1, - [1667211313.634825][14571:14571] CHIP:DMG: 0x5 = 0, - [1667211313.634912][14571:14571] CHIP:DMG: 0x6 = 0, - [1667211313.634999][14571:14571] CHIP:DMG: }, - [1667211313.635076][14571:14571] CHIP:DMG: }, - [1667211313.635154][14571:14571] CHIP:DMG: - [1667211313.635214][14571:14571] CHIP:DMG: ], - [1667211313.635308][14571:14571] CHIP:DMG: - [1667211313.635370][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211313.635438][14571:14571] CHIP:DMG: }, - [1667211313.635604][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211313.635687][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211313.635757][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001A - [1667211313.635871][14571:14571] CHIP:ZCL: [SetUser] Incoming command [endpointId=1,userIndex=1] - [1667211313.635973][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211313.636129][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=0] - [1667211313.636192][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::SetUser [endpoint=1,userIndex=1,creator=1,modifier=1,userName="xxx",uniqueId=1934,userStatus=1,userType=0,credentialRule=0,credentials=(nil),totalCredentials=0] - [1667211313.636259][14571:14571] CHIP:ZCL: Successfully set the user [mEndpointId=1,index=1,adjustedIndex=0] - [1667211313.636314][14571:14571] CHIP:ZCL: [createUser] User created [endpointId=1,creatorFabricId=1,userIndex=1,userName="xxx",userUniqueId=0x1934,userStatus=1,userType=0,credentialRule=0,totalCredentials=0] - [1667211313.636472][14571:14571] CHIP:EVL: LogEvent event number: 0x0000000000000008 priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x0000000001224D9D - [1667211313.636546][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=8,dataType=2,operation=0,nodeId=112233,fabricIndex=1] - [1667211313.636635][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211313.636707][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211313.636773][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211313.636882][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211313.637440][14571:14571] CHIP:EM: <<< [E:3349r M:159426207 (Ack:21932646)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211313.637557][14571:14571] CHIP:IN: (S) Sending msg 159426207 on secure session with LSID: 42469 - [1667211313.638273][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:57086 | 159426207 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 59690 / Exchange = 3349] - [1667211313.638380][14571:14571] CHIP:DMG: Header Flags = - [1667211313.638438][14571:14571] CHIP:DMG: { - [1667211313.638582][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211313.638641][14571:14571] CHIP:DMG: { - [1667211313.638702][14571:14571] CHIP:DMG: AckMsg = 21932646 - [1667211313.638758][14571:14571] CHIP:DMG: NeedsAck = true - [1667211313.638813][14571:14571] CHIP:DMG: } - [1667211313.638886][14571:14571] CHIP:DMG: } - [1667211313.638941][14571:14571] CHIP:DMG: - [1667211313.639012][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211313.639068][14571:14571] CHIP:DMG: { - [1667211313.639122][14571:14571] CHIP:DMG: data = 002ae9009fa6800987cb170dddacb6284a68a6ee3dc78cfd2c746543af8c3d6fd34e7d4c464410f485ad79bee8a51210d97206d7a7df976224d60b27dff86c68c61c54fa - [1667211313.639182][14571:14571] CHIP:DMG: buffer_ptr = 187651867779072 - [1667211313.639237][14571:14571] CHIP:DMG: } - [1667211313.639289][14571:14571] CHIP:DMG: - [1667211313.639364][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211313.639423][14571:14571] CHIP:DMG: { - [1667211313.639477][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124021a1835012400001818181824ff0118 - [1667211313.639533][14571:14571] CHIP:DMG: } - [1667211313.639586][14571:14571] CHIP:DMG: - [1667211313.639729][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211313.639793][14571:14571] CHIP:DMG: { - [1667211313.639852][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211313.639916][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211313.639993][14571:14571] CHIP:DMG: [ - [1667211313.640056][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211313.640152][14571:14571] CHIP:DMG: { - [1667211313.640229][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211313.640297][14571:14571] CHIP:DMG: { - [1667211313.640373][14571:14571] CHIP:DMG: CommandPathIB = - [1667211313.640461][14571:14571] CHIP:DMG: { - [1667211313.640550][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211313.640642][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211313.640731][14571:14571] CHIP:DMG: CommandId = 0x1a, - [1667211313.640817][14571:14571] CHIP:DMG: }, - [1667211313.640912][14571:14571] CHIP:DMG: - [1667211313.640992][14571:14571] CHIP:DMG: StatusIB = - [1667211313.641079][14571:14571] CHIP:DMG: { - [1667211313.641166][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211313.641242][14571:14571] CHIP:DMG: }, - [1667211313.641325][14571:14571] CHIP:DMG: - [1667211313.641403][14571:14571] CHIP:DMG: }, - [1667211313.641490][14571:14571] CHIP:DMG: - - - ./chip-tool doorlock set-week-day-schedule 1 1 2 15 45 16 55 1 1 - - Verify the " Set Week Day Schedule command response" on TH(lock-app): - - [1667211357.823542][14571:14571] CHIP:EM: Handling via exchange: 24164r, Delegate: 0xaaaae921d988 - [1667211357.823695][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211357.823762][14571:14571] CHIP:DMG: { - [1667211357.823820][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211357.823905][14571:14571] CHIP:DMG: timedRequest = false, - [1667211357.823974][14571:14571] CHIP:DMG: InvokeRequests = - [1667211357.824069][14571:14571] CHIP:DMG: [ - [1667211357.824132][14571:14571] CHIP:DMG: CommandDataIB = - [1667211357.824212][14571:14571] CHIP:DMG: { - [1667211357.824287][14571:14571] CHIP:DMG: CommandPathIB = - [1667211357.824371][14571:14571] CHIP:DMG: { - [1667211357.824456][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211357.824543][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211357.824630][14571:14571] CHIP:DMG: CommandId = 0xb, - [1667211357.824711][14571:14571] CHIP:DMG: }, - [1667211357.824797][14571:14571] CHIP:DMG: - [1667211357.824873][14571:14571] CHIP:DMG: CommandFields = - [1667211357.824954][14571:14571] CHIP:DMG: { - [1667211357.825039][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211357.825128][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211357.825215][14571:14571] CHIP:DMG: 0x2 = 2, - [1667211357.825304][14571:14571] CHIP:DMG: 0x3 = 15, - [1667211357.825391][14571:14571] CHIP:DMG: 0x4 = 45, - [1667211357.825478][14571:14571] CHIP:DMG: 0x5 = 16, - [1667211357.825565][14571:14571] CHIP:DMG: 0x6 = 55, - [1667211357.825650][14571:14571] CHIP:DMG: }, - [1667211357.825727][14571:14571] CHIP:DMG: }, - [1667211357.825817][14571:14571] CHIP:DMG: - [1667211357.825879][14571:14571] CHIP:DMG: ], - [1667211357.825961][14571:14571] CHIP:DMG: - [1667211357.826022][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211357.826091][14571:14571] CHIP:DMG: }, - [1667211357.826251][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211357.826335][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211357.826406][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_000B - [1667211357.826651][14571:14571] CHIP:ZCL: [SetWeekDaySchedule] Incoming command [endpointId=1] - [1667211357.826730][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211357.826783][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211357.826841][14571:14571] CHIP:ZCL: [SetWeekDaySchedule] Successfully created new schedule [endpointId=1,weekDayIndex=1,userIndex=1,daysMask=2,startTime="15:45",endTime="16:55"] - [1667211357.827112][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211357.827233][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000A priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x000000000122FA3C - [1667211357.827306][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=10,dataType=3,operation=0,nodeId=112233,fabricIndex=1] - [1667211357.827397][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211357.827469][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211357.827535][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211357.827646][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211357.828220][14571:14571] CHIP:EM: <<< [E:24164r M:225928839 (Ack:138362832)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211357.828335][14571:14571] CHIP:IN: (S) Sending msg 225928839 on secure session with LSID: 42470 - [1667211357.829055][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:60770 | 225928839 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 48632 / Exchange = 24164] - [1667211357.829162][14571:14571] CHIP:DMG: Header Flags = - [1667211357.829220][14571:14571] CHIP:DMG: { - [1667211357.829308][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211357.829365][14571:14571] CHIP:DMG: { - [1667211357.829426][14571:14571] CHIP:DMG: AckMsg = 138362832 - [1667211357.829481][14571:14571] CHIP:DMG: NeedsAck = true - [1667211357.829537][14571:14571] CHIP:DMG: } - [1667211357.829610][14571:14571] CHIP:DMG: } - [1667211357.829665][14571:14571] CHIP:DMG: - [1667211357.829735][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211357.829790][14571:14571] CHIP:DMG: { - [1667211357.829844][14571:14571] CHIP:DMG: data = 00f8bd008766770d5ff5b138aa7529b4c8c5d340bbf8e11c66b2c88685a99aafcda0992d87f56bac0dfd6e92f298871076d20895dec2f6a067cc6ed010f33bec9e8b99c7 - [1667211357.829903][14571:14571] CHIP:DMG: buffer_ptr = 187651867779584 - [1667211357.829957][14571:14571] CHIP:DMG: } - [1667211357.830009][14571:14571] CHIP:DMG: - [1667211357.830083][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211357.830139][14571:14571] CHIP:DMG: { - [1667211357.830193][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124020b1835012400001818181824ff0118 - [1667211357.830249][14571:14571] CHIP:DMG: } - [1667211357.830303][14571:14571] CHIP:DMG: - [1667211357.830442][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211357.830578][14571:14571] CHIP:DMG: { - [1667211357.830639][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211357.830701][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211357.830779][14571:14571] CHIP:DMG: [ - [1667211357.830843][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211357.830936][14571:14571] CHIP:DMG: { - [1667211357.831011][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211357.831095][14571:14571] CHIP:DMG: { - [1667211357.831173][14571:14571] CHIP:DMG: CommandPathIB = - [1667211357.831262][14571:14571] CHIP:DMG: { - [1667211357.831351][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211357.831442][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211357.831531][14571:14571] CHIP:DMG: CommandId = 0xb, - [1667211357.831617][14571:14571] CHIP:DMG: }, - [1667211357.831713][14571:14571] CHIP:DMG: - [1667211357.831792][14571:14571] CHIP:DMG: StatusIB = - [1667211357.831879][14571:14571] CHIP:DMG: { - [1667211357.831966][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211357.832052][14571:14571] CHIP:DMG: }, - [1667211357.832139][14571:14571] CHIP:DMG: + ./chip-tool doorlock set-user 0 1 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Set user command with SUCCESS response on TH(lock-app) log: + + [1685673117.936503][2600:2602] CHIP:DMG: InvokeResponseMessage = + [1685673117.936560][2600:2602] CHIP:DMG: { + [1685673117.936615][2600:2602] CHIP:DMG: suppressResponse = false, + [1685673117.936672][2600:2602] CHIP:DMG: InvokeResponseIBs = + [1685673117.936747][2600:2602] CHIP:DMG: [ + [1685673117.936803][2600:2602] CHIP:DMG: InvokeResponseIB = + [1685673117.936880][2600:2602] CHIP:DMG: { + [1685673117.936941][2600:2602] CHIP:DMG: CommandStatusIB = + [1685673117.937029][2600:2602] CHIP:DMG: { + [1685673117.937106][2600:2602] CHIP:DMG: CommandPathIB = + [1685673117.937199][2600:2602] CHIP:DMG: { + [1685673117.937292][2600:2602] CHIP:DMG: EndpointId = 0x1, + [1685673117.937389][2600:2602] CHIP:DMG: ClusterId = 0x101, + [1685673117.937486][2600:2602] CHIP:DMG: CommandId = 0x1a, + [1685673117.937577][2600:2602] CHIP:DMG: }, + [1685673117.937680][2600:2602] CHIP:DMG: + [1685673117.937755][2600:2602] CHIP:DMG: StatusIB = + [1685673117.938008][2600:2602] CHIP:DMG: { + [1685673117.938101][2600:2602] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673117.938194][2600:2602] CHIP:DMG: }, + [1685673117.938286][2600:2602] CHIP:DMG: + [1685673117.938368][2600:2602] CHIP:DMG: }, + [1685673117.938462][2600:2602] CHIP:DMG: + [1685673117.938530][2600:2602] CHIP:DMG: }, + [1685673117.938610][2600:2602] CHIP:DMG: + [1685673117.938667][2600:2602] CHIP:DMG: ], + [1685673117.938737][2600:2602] CHIP:DMG: + [1685673117.938795][2600:2602] CHIP:DMG: InteractionModelRevision = 1 + [1685673117.938850][2600:2602] CHIP:DMG: }, + + + ./chip-tool doorlock set-week-day-schedule 1 1 2 15 45 16 55 1 1 --trace_decode 1 + + Verify TH receives Set Week Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673143.421323][2604:2606] CHIP:DMG: InvokeResponseMessage = + [1685673143.421380][2604:2606] CHIP:DMG: { + [1685673143.421437][2604:2606] CHIP:DMG: suppressResponse = false, + [1685673143.421495][2604:2606] CHIP:DMG: InvokeResponseIBs = + [1685673143.421569][2604:2606] CHIP:DMG: [ + [1685673143.421628][2604:2606] CHIP:DMG: InvokeResponseIB = + [1685673143.421705][2604:2606] CHIP:DMG: { + [1685673143.421893][2604:2606] CHIP:DMG: CommandStatusIB = + [1685673143.421975][2604:2606] CHIP:DMG: { + [1685673143.422043][2604:2606] CHIP:DMG: CommandPathIB = + [1685673143.422121][2604:2606] CHIP:DMG: { + [1685673143.422197][2604:2606] CHIP:DMG: EndpointId = 0x1, + [1685673143.422277][2604:2606] CHIP:DMG: ClusterId = 0x101, + [1685673143.422357][2604:2606] CHIP:DMG: CommandId = 0xb, + [1685673143.422432][2604:2606] CHIP:DMG: }, + [1685673143.422517][2604:2606] CHIP:DMG: + [1685673143.422586][2604:2606] CHIP:DMG: StatusIB = + [1685673143.422660][2604:2606] CHIP:DMG: { + [1685673143.422737][2604:2606] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673143.422812][2604:2606] CHIP:DMG: }, + [1685673143.422887][2604:2606] CHIP:DMG: + [1685673143.422954][2604:2606] CHIP:DMG: }, + [1685673143.423030][2604:2606] CHIP:DMG: + [1685673143.423092][2604:2606] CHIP:DMG: }, + [1685673143.423162][2604:2606] CHIP:DMG: + [1685673143.423218][2604:2606] CHIP:DMG: ], + [1685673143.423289][2604:2606] CHIP:DMG: + [1685673143.423345][2604:2606] CHIP:DMG: InteractionModelRevision = 1 + [1685673143.423400][2604:2606] CHIP:DMG: }, disabled: true - - label: "DUT sends Get Week Day Schedule command to TH." + - label: "Step 5: DUT sends Get Week Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C0c.Tx verification: | - ./chip-tool doorlock get-week-day-schedule 1 1 1 1 - Verify the " Get Week Day Schedule command response" on TH(lock-app): - - [1667211404.121594][14571:14571] CHIP:EM: Handling via exchange: 10434r, Delegate: 0xaaaae921d988 - [1667211404.121734][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211404.121802][14571:14571] CHIP:DMG: { - [1667211404.121860][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211404.121927][14571:14571] CHIP:DMG: timedRequest = false, - [1667211404.121989][14571:14571] CHIP:DMG: InvokeRequests = - [1667211404.122068][14571:14571] CHIP:DMG: [ - [1667211404.122130][14571:14571] CHIP:DMG: CommandDataIB = - [1667211404.122216][14571:14571] CHIP:DMG: { - [1667211404.122282][14571:14571] CHIP:DMG: CommandPathIB = - [1667211404.122364][14571:14571] CHIP:DMG: { - [1667211404.122454][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211404.122581][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211404.122664][14571:14571] CHIP:DMG: CommandId = 0xc, - [1667211404.122744][14571:14571] CHIP:DMG: }, - [1667211404.122829][14571:14571] CHIP:DMG: - [1667211404.122902][14571:14571] CHIP:DMG: CommandFields = - [1667211404.122988][14571:14571] CHIP:DMG: { - [1667211404.123081][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211404.123166][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211404.123258][14571:14571] CHIP:DMG: }, - [1667211404.123334][14571:14571] CHIP:DMG: }, - [1667211404.123571][14571:14571] CHIP:DMG: - [1667211404.123636][14571:14571] CHIP:DMG: ], - [1667211404.123713][14571:14571] CHIP:DMG: - [1667211404.123775][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211404.123835][14571:14571] CHIP:DMG: }, - [1667211404.123983][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211404.124063][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211404.124133][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_000C - [1667211404.124228][14571:14571] CHIP:ZCL: [GetWeekDaySchedule] Incoming command [endpointId=1] - [1667211404.124301][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211404.124358][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211404.124458][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211404.124531][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211404.124606][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211404.124702][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211404.125221][14571:14571] CHIP:EM: <<< [E:10434r M:192211089 (Ack:49437871)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211404.125323][14571:14571] CHIP:IN: (S) Sending msg 192211089 on secure session with LSID: 42471 - [1667211404.125996][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:36739 | 192211089 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 33523 / Exchange = 10434] - [1667211404.126092][14571:14571] CHIP:DMG: Header Flags = - [1667211404.126150][14571:14571] CHIP:DMG: { - [1667211404.126236][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211404.126292][14571:14571] CHIP:DMG: { - [1667211404.126351][14571:14571] CHIP:DMG: AckMsg = 49437871 - [1667211404.126408][14571:14571] CHIP:DMG: NeedsAck = true - [1667211404.126502][14571:14571] CHIP:DMG: } - [1667211404.126579][14571:14571] CHIP:DMG: } - [1667211404.126634][14571:14571] CHIP:DMG: - [1667211404.126706][14571:14571] CHIP:DMG: Encrypted Payload (89 bytes) = - [1667211404.126763][14571:14571] CHIP:DMG: { - [1667211404.126817][14571:14571] CHIP:DMG: data = 00f3820091e8740b94f592d6a017afb3c95ba9c18b80cd20617f682c6fe32dc72a5322ffb153f012f26b3a9f3242b86b8ab628cb132daabfb95dccb48f51e3f41cd486658d56750a8e9fc74d74b63e1b824e31046265e0e2ec - [1667211404.126875][14571:14571] CHIP:DMG: buffer_ptr = 187651867783776 - [1667211404.126928][14571:14571] CHIP:DMG: } - [1667211404.126980][14571:14571] CHIP:DMG: - [1667211404.127053][14571:14571] CHIP:DMG: Decrypted Payload (55 bytes) = - [1667211404.127109][14571:14571] CHIP:DMG: { - [1667211404.127163][14571:14571] CHIP:DMG: data = 152800360115350037002400012501010124020c18350124000124010124020024030224040f24052d2406102407371818181824ff0118 - [1667211404.127218][14571:14571] CHIP:DMG: } - [1667211404.127269][14571:14571] CHIP:DMG: - [1667211404.127427][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211404.127491][14571:14571] CHIP:DMG: { - [1667211404.127550][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211404.127617][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211404.127700][14571:14571] CHIP:DMG: [ - [1667211404.127762][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211404.127856][14571:14571] CHIP:DMG: { - [1667211404.127935][14571:14571] CHIP:DMG: CommandDataIB = - [1667211404.128016][14571:14571] CHIP:DMG: { - [1667211404.128100][14571:14571] CHIP:DMG: CommandPathIB = - [1667211404.128187][14571:14571] CHIP:DMG: { - [1667211404.128282][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211404.128373][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211404.128469][14571:14571] CHIP:DMG: CommandId = 0xc, - [1667211404.128573][14571:14571] CHIP:DMG: }, - [1667211404.128670][14571:14571] CHIP:DMG: - [1667211404.128748][14571:14571] CHIP:DMG: CommandFields = - [1667211404.128831][14571:14571] CHIP:DMG: { - [1667211404.128919][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211404.129011][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211404.129110][14571:14571] CHIP:DMG: 0x2 = 0, - [1667211404.129203][14571:14571] CHIP:DMG: 0x3 = 2, - [1667211404.129294][14571:14571] CHIP:DMG: 0x4 = 15, - [1667211404.129385][14571:14571] CHIP:DMG: 0x5 = 45, - [1667211404.129468][14571:14571] CHIP:DMG: 0x6 = 16, - [1667211404.129557][14571:14571] CHIP:DMG: 0x7 = 55, - [1667211404.129645][14571:14571] CHIP:DMG: }, - [1667211404.129723][14571:14571] CHIP:DMG: }, - [1667211404.129816][14571:14571] CHIP:DMG: + ./chip-tool doorlock get-week-day-schedule 1 1 1 1 --trace_decode 1 + + Verify TH receives Get Week Day Schedule command response on TH(lock-app) log: + + [1685673169.698639][2609:2611] CHIP:DMG: InvokeResponseMessage = + [1685673169.698694][2609:2611] CHIP:DMG: { + [1685673169.698748][2609:2611] CHIP:DMG: suppressResponse = false, + [1685673169.698804][2609:2611] CHIP:DMG: InvokeResponseIBs = + [1685673169.698882][2609:2611] CHIP:DMG: [ + [1685673169.698940][2609:2611] CHIP:DMG: InvokeResponseIB = + [1685673169.699023][2609:2611] CHIP:DMG: { + [1685673169.699083][2609:2611] CHIP:DMG: CommandDataIB = + [1685673169.699151][2609:2611] CHIP:DMG: { + [1685673169.699211][2609:2611] CHIP:DMG: CommandPathIB = + [1685673169.699288][2609:2611] CHIP:DMG: { + [1685673169.699363][2609:2611] CHIP:DMG: EndpointId = 0x1, + [1685673169.699443][2609:2611] CHIP:DMG: ClusterId = 0x101, + [1685673169.699521][2609:2611] CHIP:DMG: CommandId = 0xc, + [1685673169.699596][2609:2611] CHIP:DMG: }, + [1685673169.699787][2609:2611] CHIP:DMG: + [1685673169.699917][2609:2611] CHIP:DMG: CommandFields = + [1685673169.700000][2609:2611] CHIP:DMG: { + [1685673169.700080][2609:2611] CHIP:DMG: 0x0 = 1, + [1685673169.700162][2609:2611] CHIP:DMG: 0x1 = 1, + [1685673169.700243][2609:2611] CHIP:DMG: 0x2 = 0, + [1685673169.700324][2609:2611] CHIP:DMG: 0x3 = 2, + [1685673169.700451][2609:2611] CHIP:DMG: 0x4 = 15, + [1685673169.700535][2609:2611] CHIP:DMG: 0x5 = 45, + [1685673169.700616][2609:2611] CHIP:DMG: 0x6 = 16, + [1685673169.700697][2609:2611] CHIP:DMG: 0x7 = 55, + [1685673169.700835][2609:2611] CHIP:DMG: }, + [1685673169.700908][2609:2611] CHIP:DMG: }, + [1685673169.700991][2609:2611] CHIP:DMG: + [1685673169.701053][2609:2611] CHIP:DMG: }, + [1685673169.701130][2609:2611] CHIP:DMG: + [1685673169.701186][2609:2611] CHIP:DMG: ], + [1685673169.701265][2609:2611] CHIP:DMG: + [1685673169.701320][2609:2611] CHIP:DMG: InteractionModelRevision = 1 + [1685673169.701375][2609:2611] CHIP:DMG: }, disabled: true - - label: "DUT sends Clear Week Day Schedule command to TH." + - label: "Step 6: DUT sends Clear Week Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C0d.Tx verification: | - ./chip-tool doorlock clear-week-day-schedule 1 1 1 1 - - Verify the " Clear Week Day Schedule command response" on TH(lock-app): - - [1667211448.935869][14571:14571] CHIP:EM: Handling via exchange: 2355r, Delegate: 0xaaaae921d988 - [1667211448.936017][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211448.936083][14571:14571] CHIP:DMG: { - [1667211448.936142][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211448.936210][14571:14571] CHIP:DMG: timedRequest = false, - [1667211448.936272][14571:14571] CHIP:DMG: InvokeRequests = - [1667211448.936350][14571:14571] CHIP:DMG: [ - [1667211448.936413][14571:14571] CHIP:DMG: CommandDataIB = - [1667211448.936498][14571:14571] CHIP:DMG: { - [1667211448.936564][14571:14571] CHIP:DMG: CommandPathIB = - [1667211448.936750][14571:14571] CHIP:DMG: { - [1667211448.936837][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211448.936923][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211448.937009][14571:14571] CHIP:DMG: CommandId = 0xd, - [1667211448.937088][14571:14571] CHIP:DMG: }, - [1667211448.937180][14571:14571] CHIP:DMG: - [1667211448.937252][14571:14571] CHIP:DMG: CommandFields = - [1667211448.937331][14571:14571] CHIP:DMG: { - [1667211448.937414][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211448.937501][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211448.937594][14571:14571] CHIP:DMG: }, - [1667211448.937677][14571:14571] CHIP:DMG: }, - [1667211448.937841][14571:14571] CHIP:DMG: - [1667211448.937903][14571:14571] CHIP:DMG: ], - [1667211448.937980][14571:14571] CHIP:DMG: - [1667211448.938041][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211448.938167][14571:14571] CHIP:DMG: }, - [1667211448.938320][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211448.938402][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211448.938515][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_000D - [1667211448.938615][14571:14571] CHIP:ZCL: [ClearWeekDaySchedule] Incoming command [endpointId=1] - [1667211448.938691][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211448.938751][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211448.938813][14571:14571] CHIP:ZCL: [ClearWeekDaySchedule] Clearing a single schedule [endpointId=1,weekDayIndex=1,userIndex=1] - [1667211448.939061][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211448.939291][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211448.939399][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000B priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x0000000001245E24 - [1667211448.939470][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=11,dataType=3,operation=1,nodeId=112233,fabricIndex=1] - [1667211448.939555][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211448.939624][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211448.939698][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211448.939809][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211448.940482][14571:14571] CHIP:EM: <<< [E:2355r M:241885754 (Ack:31150769)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211448.940588][14571:14571] CHIP:IN: (S) Sending msg 241885754 on secure session with LSID: 42472 - [1667211448.941253][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:58359 | 241885754 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 11240 / Exchange = 2355] - [1667211448.941350][14571:14571] CHIP:DMG: Header Flags = - [1667211448.941407][14571:14571] CHIP:DMG: { - [1667211448.941493][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211448.941549][14571:14571] CHIP:DMG: { - [1667211448.941609][14571:14571] CHIP:DMG: AckMsg = 31150769 - [1667211448.941664][14571:14571] CHIP:DMG: NeedsAck = true - [1667211448.941723][14571:14571] CHIP:DMG: } - [1667211448.941795][14571:14571] CHIP:DMG: } - [1667211448.941850][14571:14571] CHIP:DMG: - [1667211448.941920][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211448.941976][14571:14571] CHIP:DMG: { - [1667211448.942030][14571:14571] CHIP:DMG: data = 00e82b003ae26a0e4e41b6938b7c3007a2f5809001a017eef891b1ca7c81e5972d8921a83124f8251ba290a524e27d796f33a69b7f792361c98e9cabfb6cab5ff5f3b243 - [1667211448.942089][14571:14571] CHIP:DMG: buffer_ptr = 187651867784272 - [1667211448.942142][14571:14571] CHIP:DMG: } - [1667211448.942194][14571:14571] CHIP:DMG: - [1667211448.942268][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211448.942326][14571:14571] CHIP:DMG: { - [1667211448.942372][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124020d1835012400001818181824ff0118 - [1667211448.942431][14571:14571] CHIP:DMG: } - [1667211448.942528][14571:14571] CHIP:DMG: - [1667211448.942669][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211448.942733][14571:14571] CHIP:DMG: { - [1667211448.942792][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211448.942854][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211448.942932][14571:14571] CHIP:DMG: [ - [1667211448.942994][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211448.943085][14571:14571] CHIP:DMG: { - [1667211448.943157][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211448.943245][14571:14571] CHIP:DMG: { - [1667211448.943328][14571:14571] CHIP:DMG: CommandPathIB = - [1667211448.943414][14571:14571] CHIP:DMG: { - [1667211448.943501][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211448.943600][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211448.943696][14571:14571] CHIP:DMG: CommandId = 0xd, - [1667211448.943781][14571:14571] CHIP:DMG: }, - [1667211448.944016][14571:14571] CHIP:DMG: - [1667211448.944112][14571:14571] CHIP:DMG: StatusIB = - [1667211448.944198][14571:14571] CHIP:DMG: { - [1667211448.944281][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211448.944373][14571:14571] CHIP:DMG: }, - [1667211448.944618][14571:14571] CHIP:DMG: - [1667211448.944700][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock clear-week-day-schedule 1 1 1 1 --trace_decode 1 + + Verify TH receives Clear Week Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673196.080189][2614:2616] CHIP:DMG: InvokeResponseMessage = + [1685673196.080247][2614:2616] CHIP:DMG: { + [1685673196.080303][2614:2616] CHIP:DMG: suppressResponse = false, + [1685673196.080383][2614:2616] CHIP:DMG: InvokeResponseIBs = + [1685673196.080455][2614:2616] CHIP:DMG: [ + [1685673196.080533][2614:2616] CHIP:DMG: InvokeResponseIB = + [1685673196.080616][2614:2616] CHIP:DMG: { + [1685673196.080696][2614:2616] CHIP:DMG: CommandStatusIB = + [1685673196.080768][2614:2616] CHIP:DMG: { + [1685673196.080836][2614:2616] CHIP:DMG: CommandPathIB = + [1685673196.080933][2614:2616] CHIP:DMG: { + [1685673196.081030][2614:2616] CHIP:DMG: EndpointId = 0x1, + [1685673196.081112][2614:2616] CHIP:DMG: ClusterId = 0x101, + [1685673196.081213][2614:2616] CHIP:DMG: CommandId = 0xd, + [1685673196.081284][2614:2616] CHIP:DMG: }, + [1685673196.081362][2614:2616] CHIP:DMG: + [1685673196.081448][2614:2616] CHIP:DMG: StatusIB = + [1685673196.081519][2614:2616] CHIP:DMG: { + [1685673196.081616][2614:2616] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673196.081692][2614:2616] CHIP:DMG: }, + [1685673196.081822][2614:2616] CHIP:DMG: + [1685673196.081891][2614:2616] CHIP:DMG: }, + [1685673196.081991][2614:2616] CHIP:DMG: + [1685673196.082053][2614:2616] CHIP:DMG: }, + [1685673196.082125][2614:2616] CHIP:DMG: + [1685673196.082202][2614:2616] CHIP:DMG: ], + [1685673196.082276][2614:2616] CHIP:DMG: + [1685673196.082331][2614:2616] CHIP:DMG: InteractionModelRevision = 1 + [1685673196.082409][2614:2616] CHIP:DMG: }, disabled: true - - label: "DUT sends Set Year Day Schedule command to TH." + - label: "Step 7: DUT sends Set Year Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C0e.Tx verification: | - ./chip-tool doorlock set-year-day-schedule 1 1 1080 2100 1 1 - - Verify the " Set Year Day Schedule command response" on TH(lock-app): - - [1667211494.487800][14571:14571] CHIP:EM: Handling via exchange: 37849r, Delegate: 0xaaaae921d988 - [1667211494.487943][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211494.488009][14571:14571] CHIP:DMG: { - [1667211494.488068][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211494.488136][14571:14571] CHIP:DMG: timedRequest = false, - [1667211494.488189][14571:14571] CHIP:DMG: InvokeRequests = - [1667211494.488261][14571:14571] CHIP:DMG: [ - [1667211494.488322][14571:14571] CHIP:DMG: CommandDataIB = - [1667211494.488392][14571:14571] CHIP:DMG: { - [1667211494.488449][14571:14571] CHIP:DMG: CommandPathIB = - [1667211494.488530][14571:14571] CHIP:DMG: { - [1667211494.488610][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211494.488697][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211494.488789][14571:14571] CHIP:DMG: CommandId = 0xe, - [1667211494.488866][14571:14571] CHIP:DMG: }, - [1667211494.488935][14571:14571] CHIP:DMG: - [1667211494.488997][14571:14571] CHIP:DMG: CommandFields = - [1667211494.489073][14571:14571] CHIP:DMG: { - [1667211494.489164][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211494.489258][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211494.489346][14571:14571] CHIP:DMG: 0x2 = 1080, - [1667211494.489432][14571:14571] CHIP:DMG: 0x3 = 2100, - [1667211494.489515][14571:14571] CHIP:DMG: }, - [1667211494.489598][14571:14571] CHIP:DMG: }, - [1667211494.489677][14571:14571] CHIP:DMG: - [1667211494.489738][14571:14571] CHIP:DMG: ], - [1667211494.489817][14571:14571] CHIP:DMG: - [1667211494.489878][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211494.489938][14571:14571] CHIP:DMG: }, - [1667211494.490087][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211494.490168][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211494.490238][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_000E - [1667211494.490337][14571:14571] CHIP:ZCL: [SetYearDaySchedule] incoming command [endpointId=1] - [1667211494.490416][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211494.490513][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211494.490582][14571:14571] CHIP:ZCL: [SetYearDaySchedule] Successfully created new schedule [endpointId=1,yearDayIndex=1,userIndex=1,localStartTime=1080,endTime=2100] - [1667211494.490876][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211494.491000][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000C priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x0000000001251014 - [1667211494.491071][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=12,dataType=4,operation=0,nodeId=112233,fabricIndex=1] - [1667211494.491154][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211494.491225][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211494.491290][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211494.491391][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211494.491904][14571:14571] CHIP:EM: <<< [E:37849r M:205769530 (Ack:228092562)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211494.492002][14571:14571] CHIP:IN: (S) Sending msg 205769530 on secure session with LSID: 42473 - [1667211494.492676][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:57633 | 205769530 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 15669 / Exchange = 37849] - [1667211494.492774][14571:14571] CHIP:DMG: Header Flags = - [1667211494.492832][14571:14571] CHIP:DMG: { - [1667211494.492916][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211494.492973][14571:14571] CHIP:DMG: { - [1667211494.493034][14571:14571] CHIP:DMG: AckMsg = 228092562 - [1667211494.493089][14571:14571] CHIP:DMG: NeedsAck = true - [1667211494.493143][14571:14571] CHIP:DMG: } - [1667211494.493214][14571:14571] CHIP:DMG: } - [1667211494.493269][14571:14571] CHIP:DMG: - [1667211494.493338][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211494.493393][14571:14571] CHIP:DMG: { - [1667211494.493448][14571:14571] CHIP:DMG: data = 00353d003acb430cb14a36e0ff7070b026ff6e1c3237f6e9cec16bfa84f63d663fb6d14836cb4286655ff33661c8f2e1ccc8854598d894d8af2ac8bcd5d17a636f898b0a - [1667211494.493507][14571:14571] CHIP:DMG: buffer_ptr = 187651867778912 - [1667211494.493561][14571:14571] CHIP:DMG: } - [1667211494.493613][14571:14571] CHIP:DMG: - [1667211494.493687][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211494.493743][14571:14571] CHIP:DMG: { - [1667211494.493797][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124020e1835012400001818181824ff0118 - [1667211494.493853][14571:14571] CHIP:DMG: } - [1667211494.493905][14571:14571] CHIP:DMG: - [1667211494.494038][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211494.494100][14571:14571] CHIP:DMG: { - [1667211494.494159][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211494.494228][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211494.494305][14571:14571] CHIP:DMG: [ - [1667211494.494368][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211494.494495][14571:14571] CHIP:DMG: { - [1667211494.494576][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211494.494652][14571:14571] CHIP:DMG: { - [1667211494.494739][14571:14571] CHIP:DMG: CommandPathIB = - [1667211494.494825][14571:14571] CHIP:DMG: { - [1667211494.494904][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211494.494993][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211494.495090][14571:14571] CHIP:DMG: CommandId = 0xe, - [1667211494.495183][14571:14571] CHIP:DMG: }, - [1667211494.495285][14571:14571] CHIP:DMG: - [1667211494.495363][14571:14571] CHIP:DMG: StatusIB = - [1667211494.495456][14571:14571] CHIP:DMG: { - [1667211494.495538][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211494.495620][14571:14571] CHIP:DMG: }, - [1667211494.495712][14571:14571] CHIP:DMG: + ./chip-tool doorlock set-year-day-schedule 1 1 1080 2100 1 1 --trace_decode 1 + + Verify TH receives Set Year Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673212.614964][2617:2619] CHIP:DMG: InvokeResponseMessage = + [1685673212.615020][2617:2619] CHIP:DMG: { + [1685673212.615096][2617:2619] CHIP:DMG: suppressResponse = false, + [1685673212.615154][2617:2619] CHIP:DMG: InvokeResponseIBs = + [1685673212.615227][2617:2619] CHIP:DMG: [ + [1685673212.615306][2617:2619] CHIP:DMG: InvokeResponseIB = + [1685673212.615385][2617:2619] CHIP:DMG: { + [1685673212.615466][2617:2619] CHIP:DMG: CommandStatusIB = + [1685673212.615544][2617:2619] CHIP:DMG: { + [1685673212.615611][2617:2619] CHIP:DMG: CommandPathIB = + [1685673212.615707][2617:2619] CHIP:DMG: { + [1685673212.615784][2617:2619] CHIP:DMG: EndpointId = 0x1, + [1685673212.615884][2617:2619] CHIP:DMG: ClusterId = 0x101, + [1685673212.615962][2617:2619] CHIP:DMG: CommandId = 0xe, + [1685673212.616061][2617:2619] CHIP:DMG: }, + [1685673212.616147][2617:2619] CHIP:DMG: + [1685673212.616237][2617:2619] CHIP:DMG: StatusIB = + [1685673212.616314][2617:2619] CHIP:DMG: { + [1685673212.616411][2617:2619] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673212.616487][2617:2619] CHIP:DMG: }, + [1685673212.616583][2617:2619] CHIP:DMG: + [1685673212.616651][2617:2619] CHIP:DMG: }, + [1685673212.616747][2617:2619] CHIP:DMG: + [1685673212.616809][2617:2619] CHIP:DMG: }, + [1685673212.616902][2617:2619] CHIP:DMG: + [1685673212.616959][2617:2619] CHIP:DMG: ], + [1685673212.617030][2617:2619] CHIP:DMG: + [1685673212.617109][2617:2619] CHIP:DMG: InteractionModelRevision = 1 + [1685673212.617164][2617:2619] CHIP:DMG: }, disabled: true - - label: "DUT sends Get Year Day Schedule command to TH." + - label: "Step 8: DUT sends Get Year Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C0f.Tx verification: | - ./chip-tool doorlock get-year-day-schedule 1 1 1 1 - Verify the " Get Year Day Schedule command response" on TH(lock-app): - - [1667211532.778850][14571:14571] CHIP:EM: Handling via exchange: 12120r, Delegate: 0xaaaae921d988 - [1667211532.778992][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211532.779059][14571:14571] CHIP:DMG: { - [1667211532.779118][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211532.779186][14571:14571] CHIP:DMG: timedRequest = false, - [1667211532.779248][14571:14571] CHIP:DMG: InvokeRequests = - [1667211532.779327][14571:14571] CHIP:DMG: [ - [1667211532.779389][14571:14571] CHIP:DMG: CommandDataIB = - [1667211532.779525][14571:14571] CHIP:DMG: { - [1667211532.779598][14571:14571] CHIP:DMG: CommandPathIB = - [1667211532.779686][14571:14571] CHIP:DMG: { - [1667211532.779777][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211532.779863][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211532.779948][14571:14571] CHIP:DMG: CommandId = 0xf, - [1667211532.780034][14571:14571] CHIP:DMG: }, - [1667211532.780125][14571:14571] CHIP:DMG: - [1667211532.780198][14571:14571] CHIP:DMG: CommandFields = - [1667211532.780283][14571:14571] CHIP:DMG: { - [1667211532.780376][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211532.780461][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211532.780544][14571:14571] CHIP:DMG: }, - [1667211532.780620][14571:14571] CHIP:DMG: }, - [1667211532.780703][14571:14571] CHIP:DMG: - [1667211532.780765][14571:14571] CHIP:DMG: ], - [1667211532.780842][14571:14571] CHIP:DMG: - [1667211532.780903][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211532.780962][14571:14571] CHIP:DMG: }, - [1667211532.781108][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211532.781189][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211532.781265][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_000F - [1667211532.781359][14571:14571] CHIP:ZCL: [GetYearDaySchedule] incoming command [endpointId=1] - [1667211532.781431][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211532.781489][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211532.781586][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211532.781661][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211532.781733][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211532.781829][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211532.782341][14571:14571] CHIP:EM: <<< [E:12120r M:78099733 (Ack:62886083)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211532.782443][14571:14571] CHIP:IN: (S) Sending msg 78099733 on secure session with LSID: 42474 - [1667211532.783159][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:41963 | 78099733 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 7919 / Exchange = 12120] - [1667211532.783254][14571:14571] CHIP:DMG: Header Flags = - [1667211532.783313][14571:14571] CHIP:DMG: { - [1667211532.783398][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211532.783454][14571:14571] CHIP:DMG: { - [1667211532.783515][14571:14571] CHIP:DMG: AckMsg = 62886083 - [1667211532.783572][14571:14571] CHIP:DMG: NeedsAck = true - [1667211532.783627][14571:14571] CHIP:DMG: } - [1667211532.783699][14571:14571] CHIP:DMG: } - [1667211532.783754][14571:14571] CHIP:DMG: - [1667211532.783823][14571:14571] CHIP:DMG: Encrypted Payload (82 bytes) = - [1667211532.783880][14571:14571] CHIP:DMG: { - [1667211532.783935][14571:14571] CHIP:DMG: data = 00ef1e0015b5a704a740caf3d715e054ad0c711f8ae6048edfd44f4d07ca6ea35087aaf2af1719aaea0486393fd0e60d92f71bfac1c65bb64be4354999c51270bb8c2892b2c0155d9035c6be369c4553fb51 - [1667211532.783993][14571:14571] CHIP:DMG: buffer_ptr = 187651867784928 - [1667211532.784047][14571:14571] CHIP:DMG: } - [1667211532.784099][14571:14571] CHIP:DMG: - [1667211532.784174][14571:14571] CHIP:DMG: Decrypted Payload (48 bytes) = - [1667211532.784232][14571:14571] CHIP:DMG: { - [1667211532.784286][14571:14571] CHIP:DMG: data = 152800360115350037002400012501010124020f18350124000124010124020025033804250434081818181824ff0118 - [1667211532.784341][14571:14571] CHIP:DMG: } - [1667211532.784393][14571:14571] CHIP:DMG: - [1667211532.784545][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211532.784609][14571:14571] CHIP:DMG: { - [1667211532.784668][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211532.784731][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211532.784812][14571:14571] CHIP:DMG: [ - [1667211532.784874][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211532.784972][14571:14571] CHIP:DMG: { - [1667211532.785044][14571:14571] CHIP:DMG: CommandDataIB = - [1667211532.785125][14571:14571] CHIP:DMG: { - [1667211532.785209][14571:14571] CHIP:DMG: CommandPathIB = - [1667211532.785293][14571:14571] CHIP:DMG: { - [1667211532.785389][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211532.785479][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211532.785567][14571:14571] CHIP:DMG: CommandId = 0xf, - [1667211532.785652][14571:14571] CHIP:DMG: }, - [1667211532.785748][14571:14571] CHIP:DMG: - [1667211532.785826][14571:14571] CHIP:DMG: CommandFields = - [1667211532.785909][14571:14571] CHIP:DMG: { - [1667211532.785998][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211532.786091][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211532.786192][14571:14571] CHIP:DMG: 0x2 = 0, - [1667211532.786286][14571:14571] CHIP:DMG: 0x3 = 1080, - [1667211532.786377][14571:14571] CHIP:DMG: 0x4 = 2100, - [1667211532.786510][14571:14571] CHIP:DMG: }, - [1667211532.786604][14571:14571] CHIP:DMG: }, - [1667211532.786694][14571:14571] CHIP:DMG: - [1667211532.786763][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock get-year-day-schedule 1 1 1 1 --trace_decode 1 + + Verify TH receives Get Year Day Schedule command response on TH(lock-app) log: + + [1685673233.319349][2622:2624] CHIP:DMG: InvokeResponseMessage = + [1685673233.319404][2622:2624] CHIP:DMG: { + [1685673233.319458][2622:2624] CHIP:DMG: suppressResponse = false, + [1685673233.319515][2622:2624] CHIP:DMG: InvokeResponseIBs = + [1685673233.319592][2622:2624] CHIP:DMG: [ + [1685673233.319648][2622:2624] CHIP:DMG: InvokeResponseIB = + [1685673233.319732][2622:2624] CHIP:DMG: { + [1685673233.319792][2622:2624] CHIP:DMG: CommandDataIB = + [1685673233.319863][2622:2624] CHIP:DMG: { + [1685673233.319987][2622:2624] CHIP:DMG: CommandPathIB = + [1685673233.320066][2622:2624] CHIP:DMG: { + [1685673233.320144][2622:2624] CHIP:DMG: EndpointId = 0x1, + [1685673233.320223][2622:2624] CHIP:DMG: ClusterId = 0x101, + [1685673233.320303][2622:2624] CHIP:DMG: CommandId = 0xf, + [1685673233.320379][2622:2624] CHIP:DMG: }, + [1685673233.320458][2622:2624] CHIP:DMG: + [1685673233.320524][2622:2624] CHIP:DMG: CommandFields = + [1685673233.320598][2622:2624] CHIP:DMG: { + [1685673233.320678][2622:2624] CHIP:DMG: 0x0 = 1, + [1685673233.320758][2622:2624] CHIP:DMG: 0x1 = 1, + [1685673233.320840][2622:2624] CHIP:DMG: 0x2 = 0, + [1685673233.320992][2622:2624] CHIP:DMG: 0x3 = 1080, + [1685673233.321075][2622:2624] CHIP:DMG: 0x4 = 2100, + [1685673233.321155][2622:2624] CHIP:DMG: }, + [1685673233.321226][2622:2624] CHIP:DMG: }, + [1685673233.321310][2622:2624] CHIP:DMG: + [1685673233.321372][2622:2624] CHIP:DMG: }, + [1685673233.321450][2622:2624] CHIP:DMG: + [1685673233.321506][2622:2624] CHIP:DMG: ], + [1685673233.321581][2622:2624] CHIP:DMG: + [1685673233.321637][2622:2624] CHIP:DMG: InteractionModelRevision = 1 + [1685673233.321691][2622:2624] CHIP:DMG: }, disabled: true - - label: "DUT sends Clear Year Day Schedule command to TH." + - label: "Step 9: DUT sends Clear Year Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C10.Tx verification: | - ./chip-tool doorlock clear-year-day-schedule 1 1 1 1 - - Verify the " Clear Year Day Schedule command response" on TH(lock-app): - - [1667211637.529809][14571:14571] CHIP:EM: Handling via exchange: 14980r, Delegate: 0xaaaae921d988 - [1667211637.529968][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211637.530038][14571:14571] CHIP:DMG: { - [1667211637.530096][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211637.530165][14571:14571] CHIP:DMG: timedRequest = false, - [1667211637.530227][14571:14571] CHIP:DMG: InvokeRequests = - [1667211637.530398][14571:14571] CHIP:DMG: [ - [1667211637.530528][14571:14571] CHIP:DMG: CommandDataIB = - [1667211637.530621][14571:14571] CHIP:DMG: { - [1667211637.530696][14571:14571] CHIP:DMG: CommandPathIB = - [1667211637.530792][14571:14571] CHIP:DMG: { - [1667211637.530951][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211637.531047][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211637.531134][14571:14571] CHIP:DMG: CommandId = 0x10, - [1667211637.531215][14571:14571] CHIP:DMG: }, - [1667211637.531301][14571:14571] CHIP:DMG: - [1667211637.531376][14571:14571] CHIP:DMG: CommandFields = - [1667211637.531528][14571:14571] CHIP:DMG: { - [1667211637.531619][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211637.531707][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211637.531792][14571:14571] CHIP:DMG: }, - [1667211637.531869][14571:14571] CHIP:DMG: }, - [1667211637.531949][14571:14571] CHIP:DMG: - [1667211637.532076][14571:14571] CHIP:DMG: ], - [1667211637.532159][14571:14571] CHIP:DMG: - [1667211637.532221][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211637.532281][14571:14571] CHIP:DMG: }, - [1667211637.532432][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211637.532562][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211637.532641][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0010 - [1667211637.532740][14571:14571] CHIP:ZCL: [ClearYearDaySchedule] incoming command [endpointId=1] - [1667211637.532817][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667211637.532876][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211637.532938][14571:14571] CHIP:ZCL: [ClearYearDaySchedule] Clearing a single schedule [endpointId=1,yearDayIndex=1,userIndex=1] - [1667211637.533279][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211637.533510][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000D priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x0000000001273ED6 - [1667211637.533661][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=13,dataType=4,operation=1,nodeId=112233,fabricIndex=1] - [1667211637.533753][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211637.533825][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211637.533892][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211637.533992][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211637.534698][14571:14571] CHIP:EM: <<< [E:14980r M:243667336 (Ack:259604243)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211637.534818][14571:14571] CHIP:IN: (S) Sending msg 243667336 on secure session with LSID: 42475 - [1667211637.535724][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:45874 | 243667336 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 15557 / Exchange = 14980] - [1667211637.535838][14571:14571] CHIP:DMG: Header Flags = - [1667211637.535897][14571:14571] CHIP:DMG: { - [1667211637.535983][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211637.536039][14571:14571] CHIP:DMG: { - [1667211637.536099][14571:14571] CHIP:DMG: AckMsg = 259604243 - [1667211637.536214][14571:14571] CHIP:DMG: NeedsAck = true - [1667211637.536273][14571:14571] CHIP:DMG: } - [1667211637.536348][14571:14571] CHIP:DMG: } - [1667211637.536406][14571:14571] CHIP:DMG: - [1667211637.536478][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211637.536535][14571:14571] CHIP:DMG: { - [1667211637.536589][14571:14571] CHIP:DMG: data = 00c53c008811860eeaa7346eeaa0aa0f7aa2a8413b649ff90e7ceac0f5d73885c8ab946add1219da5c9b741175be6378f64be5dc820dc6717077dcea2505686ba36ec858 - [1667211637.536649][14571:14571] CHIP:DMG: buffer_ptr = 187651867781552 - [1667211637.536704][14571:14571] CHIP:DMG: } - [1667211637.536756][14571:14571] CHIP:DMG: - [1667211637.536832][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211637.536889][14571:14571] CHIP:DMG: { - [1667211637.536944][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402101835012400001818181824ff0118 - [1667211637.537000][14571:14571] CHIP:DMG: } - [1667211637.537053][14571:14571] CHIP:DMG: - [1667211637.537195][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211637.537261][14571:14571] CHIP:DMG: { - [1667211637.537321][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211637.537387][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211637.537476][14571:14571] CHIP:DMG: [ - [1667211637.537548][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211637.537640][14571:14571] CHIP:DMG: { - [1667211637.537717][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211637.537800][14571:14571] CHIP:DMG: { - [1667211637.537879][14571:14571] CHIP:DMG: CommandPathIB = - [1667211637.537966][14571:14571] CHIP:DMG: { - [1667211637.538116][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211637.538255][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211637.538353][14571:14571] CHIP:DMG: CommandId = 0x10, - [1667211637.538439][14571:14571] CHIP:DMG: }, - [1667211637.538573][14571:14571] CHIP:DMG: - [1667211637.538655][14571:14571] CHIP:DMG: StatusIB = - [1667211637.538745][14571:14571] CHIP:DMG: { - [1667211637.538833][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211637.539003][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock clear-year-day-schedule 1 1 1 1 --trace_decode 1 + + Verify TH receives Clear Year Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673250.141106][2626:2628] CHIP:DMG: InvokeResponseMessage = + [1685673250.141162][2626:2628] CHIP:DMG: { + [1685673250.141215][2626:2628] CHIP:DMG: suppressResponse = false, + [1685673250.141271][2626:2628] CHIP:DMG: InvokeResponseIBs = + [1685673250.141342][2626:2628] CHIP:DMG: [ + [1685673250.141399][2626:2628] CHIP:DMG: InvokeResponseIB = + [1685673250.141479][2626:2628] CHIP:DMG: { + [1685673250.141539][2626:2628] CHIP:DMG: CommandStatusIB = + [1685673250.141608][2626:2628] CHIP:DMG: { + [1685673250.141672][2626:2628] CHIP:DMG: CommandPathIB = + [1685673250.141746][2626:2628] CHIP:DMG: { + [1685673250.141871][2626:2628] CHIP:DMG: EndpointId = 0x1, + [1685673250.141952][2626:2628] CHIP:DMG: ClusterId = 0x101, + [1685673250.142031][2626:2628] CHIP:DMG: CommandId = 0x10, + [1685673250.142104][2626:2628] CHIP:DMG: }, + [1685673250.142189][2626:2628] CHIP:DMG: + [1685673250.142254][2626:2628] CHIP:DMG: StatusIB = + [1685673250.142325][2626:2628] CHIP:DMG: { + [1685673250.142402][2626:2628] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673250.142567][2626:2628] CHIP:DMG: }, + [1685673250.142648][2626:2628] CHIP:DMG: + [1685673250.142716][2626:2628] CHIP:DMG: }, + [1685673250.142794][2626:2628] CHIP:DMG: + [1685673250.142853][2626:2628] CHIP:DMG: }, + [1685673250.142924][2626:2628] CHIP:DMG: + [1685673250.143047][2626:2628] CHIP:DMG: ], + [1685673250.143123][2626:2628] CHIP:DMG: + [1685673250.143179][2626:2628] CHIP:DMG: InteractionModelRevision = 1 + [1685673250.143233][2626:2628] CHIP:DMG: }, disabled: true - - label: "DUT sends Set Holiday Day Schedule command to TH." + - label: "Step 10: DUT sends Set Holiday Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C11.Tx verification: | - ./chip-tool doorlock set-holiday-schedule 1 20 30 0 1 1 - - Verify the " Set Holiday Day Schedule command response" on TH(lock-app): - - [1667211707.423203][14571:14571] CHIP:EM: Handling via exchange: 6587r, Delegate: 0xaaaae921d988 - [1667211707.423354][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211707.423425][14571:14571] CHIP:DMG: { - [1667211707.423483][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211707.423552][14571:14571] CHIP:DMG: timedRequest = false, - [1667211707.423614][14571:14571] CHIP:DMG: InvokeRequests = - [1667211707.423697][14571:14571] CHIP:DMG: [ - [1667211707.423760][14571:14571] CHIP:DMG: CommandDataIB = - [1667211707.423830][14571:14571] CHIP:DMG: { - [1667211707.423906][14571:14571] CHIP:DMG: CommandPathIB = - [1667211707.424000][14571:14571] CHIP:DMG: { - [1667211707.424084][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211707.424181][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211707.424276][14571:14571] CHIP:DMG: CommandId = 0x11, - [1667211707.424366][14571:14571] CHIP:DMG: }, - [1667211707.424451][14571:14571] CHIP:DMG: - [1667211707.424526][14571:14571] CHIP:DMG: CommandFields = - [1667211707.424599][14571:14571] CHIP:DMG: { - [1667211707.424683][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211707.424779][14571:14571] CHIP:DMG: 0x1 = 20, - [1667211707.424875][14571:14571] CHIP:DMG: 0x2 = 30, - [1667211707.424972][14571:14571] CHIP:DMG: 0x3 = 0, - [1667211707.425066][14571:14571] CHIP:DMG: }, - [1667211707.425141][14571:14571] CHIP:DMG: }, - [1667211707.425223][14571:14571] CHIP:DMG: - [1667211707.425284][14571:14571] CHIP:DMG: ], - [1667211707.425363][14571:14571] CHIP:DMG: - [1667211707.425426][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211707.425486][14571:14571] CHIP:DMG: }, - [1667211707.425638][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211707.425724][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211707.425795][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0011 - [1667211707.425896][14571:14571] CHIP:ZCL: [SetHolidaySchedule] incoming command [endpointId=1] - [1667211707.425968][14571:14571] CHIP:ZCL: [SetHolidaySchedule] Successfully created new schedule [endpointId=1,scheduleIndex=1,localStartTime=20,endTime=30,operatingMode=0] - [1667211707.426063][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211707.426140][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211707.426206][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211707.426312][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211707.427029][14571:14571] CHIP:EM: <<< [E:6587r M:141871130 (Ack:46197054)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211707.427151][14571:14571] CHIP:IN: (S) Sending msg 141871130 on secure session with LSID: 42476 - [1667211707.427859][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:56745 | 141871130 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 52494 / Exchange = 6587] - [1667211707.427970][14571:14571] CHIP:DMG: Header Flags = - [1667211707.428028][14571:14571] CHIP:DMG: { - [1667211707.428117][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211707.428175][14571:14571] CHIP:DMG: { - [1667211707.428236][14571:14571] CHIP:DMG: AckMsg = 46197054 - [1667211707.428293][14571:14571] CHIP:DMG: NeedsAck = true - [1667211707.428349][14571:14571] CHIP:DMG: } - [1667211707.428422][14571:14571] CHIP:DMG: } - [1667211707.428477][14571:14571] CHIP:DMG: - [1667211707.428549][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211707.428604][14571:14571] CHIP:DMG: { - [1667211707.428659][14571:14571] CHIP:DMG: data = 000ecd001ac8740883876a39fafcb7515825dc9e257cdbf2fd9ef315a8fd79948656d91add494ec43467039794fce340459a130d6b898f4739f604877bca68a1fa18ba5b - [1667211707.428719][14571:14571] CHIP:DMG: buffer_ptr = 187651867783392 - [1667211707.428773][14571:14571] CHIP:DMG: } - [1667211707.428825][14571:14571] CHIP:DMG: - [1667211707.428902][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211707.428959][14571:14571] CHIP:DMG: { - [1667211707.429013][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402111835012400001818181824ff0118 - [1667211707.429069][14571:14571] CHIP:DMG: } - [1667211707.429121][14571:14571] CHIP:DMG: - [1667211707.429270][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211707.429336][14571:14571] CHIP:DMG: { - [1667211707.429396][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211707.429466][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211707.429545][14571:14571] CHIP:DMG: [ - [1667211707.429616][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211707.429708][14571:14571] CHIP:DMG: { - [1667211707.429784][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211707.429867][14571:14571] CHIP:DMG: { - [1667211707.429946][14571:14571] CHIP:DMG: CommandPathIB = - [1667211707.430032][14571:14571] CHIP:DMG: { - [1667211707.430112][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211707.430203][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211707.430294][14571:14571] CHIP:DMG: CommandId = 0x11, - [1667211707.430380][14571:14571] CHIP:DMG: }, - [1667211707.430525][14571:14571] CHIP:DMG: - [1667211707.430593][14571:14571] CHIP:DMG: StatusIB = - [1667211707.430682][14571:14571] CHIP:DMG: { - [1667211707.430761][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211707.430845][14571:14571] CHIP:DMG: }, - [1667211707.430932][14571:14571] CHIP:DMG: - [1667211707.431010][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock set-holiday-schedule 1 20 30 0 1 1 --trace_decode 1 + + Verify TH receives Set Holiday Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673266.868536][2630:2632] CHIP:DMG: InvokeResponseMessage = + [1685673266.868592][2630:2632] CHIP:DMG: { + [1685673266.868645][2630:2632] CHIP:DMG: suppressResponse = false, + [1685673266.868772][2630:2632] CHIP:DMG: InvokeResponseIBs = + [1685673266.868851][2630:2632] CHIP:DMG: [ + [1685673266.868908][2630:2632] CHIP:DMG: InvokeResponseIB = + [1685673266.868985][2630:2632] CHIP:DMG: { + [1685673266.869181][2630:2632] CHIP:DMG: CommandStatusIB = + [1685673266.869255][2630:2632] CHIP:DMG: { + [1685673266.869323][2630:2632] CHIP:DMG: CommandPathIB = + [1685673266.869399][2630:2632] CHIP:DMG: { + [1685673266.869475][2630:2632] CHIP:DMG: EndpointId = 0x1, + [1685673266.869554][2630:2632] CHIP:DMG: ClusterId = 0x101, + [1685673266.869632][2630:2632] CHIP:DMG: CommandId = 0x11, + [1685673266.869708][2630:2632] CHIP:DMG: }, + [1685673266.869819][2630:2632] CHIP:DMG: + [1685673266.869887][2630:2632] CHIP:DMG: StatusIB = + [1685673266.869965][2630:2632] CHIP:DMG: { + [1685673266.870041][2630:2632] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673266.870115][2630:2632] CHIP:DMG: }, + [1685673266.870190][2630:2632] CHIP:DMG: + [1685673266.870256][2630:2632] CHIP:DMG: }, + [1685673266.870332][2630:2632] CHIP:DMG: + [1685673266.870392][2630:2632] CHIP:DMG: }, + [1685673266.870463][2630:2632] CHIP:DMG: + [1685673266.870518][2630:2632] CHIP:DMG: ], + [1685673266.870589][2630:2632] CHIP:DMG: + [1685673266.870644][2630:2632] CHIP:DMG: InteractionModelRevision = 1 + [1685673266.870698][2630:2632] CHIP:DMG: }, disabled: true - - label: "DUT sends Get Holiday Day Schedule command to TH." + - label: "Step 11: DUT sends Get Holiday Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C12.Tx verification: | - ./chip-tool doorlock get-holiday-schedule 1 1 1 - Verify the " Get Holiday Day Schedule command response" on TH(lock-app): - - [1667211742.709524][14571:14571] CHIP:EM: Handling via exchange: 38714r, Delegate: 0xaaaae921d988 - [1667211742.709668][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211742.709734][14571:14571] CHIP:DMG: { - [1667211742.709793][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211742.709860][14571:14571] CHIP:DMG: timedRequest = false, - [1667211742.709922][14571:14571] CHIP:DMG: InvokeRequests = - [1667211742.710001][14571:14571] CHIP:DMG: [ - [1667211742.710064][14571:14571] CHIP:DMG: CommandDataIB = - [1667211742.710152][14571:14571] CHIP:DMG: { - [1667211742.710219][14571:14571] CHIP:DMG: CommandPathIB = - [1667211742.710299][14571:14571] CHIP:DMG: { - [1667211742.710393][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211742.710535][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211742.710626][14571:14571] CHIP:DMG: CommandId = 0x12, - [1667211742.710708][14571:14571] CHIP:DMG: }, - [1667211742.710795][14571:14571] CHIP:DMG: - [1667211742.710870][14571:14571] CHIP:DMG: CommandFields = - [1667211742.710954][14571:14571] CHIP:DMG: { - [1667211742.711038][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211742.711123][14571:14571] CHIP:DMG: }, - [1667211742.711199][14571:14571] CHIP:DMG: }, - [1667211742.711282][14571:14571] CHIP:DMG: - [1667211742.711344][14571:14571] CHIP:DMG: ], - [1667211742.711420][14571:14571] CHIP:DMG: - [1667211742.711482][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211742.711550][14571:14571] CHIP:DMG: }, - [1667211742.711700][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211742.711786][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211742.711857][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0012 - [1667211742.711949][14571:14571] CHIP:ZCL: [GetHolidaySchedule] incoming command [endpointId=1,scheduleIndex=1] - [1667211742.712058][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211742.712136][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211742.712212][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211742.712313][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211742.712884][14571:14571] CHIP:EM: <<< [E:38714r M:217769022 (Ack:72006590)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211742.713000][14571:14571] CHIP:IN: (S) Sending msg 217769022 on secure session with LSID: 42477 - [1667211742.713730][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:42495 | 217769022 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 43164 / Exchange = 38714] - [1667211742.713839][14571:14571] CHIP:DMG: Header Flags = - [1667211742.713897][14571:14571] CHIP:DMG: { - [1667211742.713984][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211742.714041][14571:14571] CHIP:DMG: { - [1667211742.714100][14571:14571] CHIP:DMG: AckMsg = 72006590 - [1667211742.714156][14571:14571] CHIP:DMG: NeedsAck = true - [1667211742.714211][14571:14571] CHIP:DMG: } - [1667211742.714282][14571:14571] CHIP:DMG: } - [1667211742.714338][14571:14571] CHIP:DMG: - [1667211742.714408][14571:14571] CHIP:DMG: Encrypted Payload (80 bytes) = - [1667211742.714499][14571:14571] CHIP:DMG: { - [1667211742.714549][14571:14571] CHIP:DMG: data = 009ca8003ee4fa0c05b5050915a00e700c42ff1b08f8a62ab1db574b6ebbc1852a7ae3507f40755a233da2901f3ed7a2532594a9afc58d9fbab37ec8da7f61abdcc269bd3768f58e41ce129c784aa36b - [1667211742.714607][14571:14571] CHIP:DMG: buffer_ptr = 187651867787856 - [1667211742.714661][14571:14571] CHIP:DMG: } - [1667211742.714714][14571:14571] CHIP:DMG: - [1667211742.714794][14571:14571] CHIP:DMG: Decrypted Payload (46 bytes) = - [1667211742.714852][14571:14571] CHIP:DMG: { - [1667211742.714907][14571:14571] CHIP:DMG: data = 152800360115350037002400012501010124021218350124000124010024021424031e2404001818181824ff0118 - [1667211742.714963][14571:14571] CHIP:DMG: } - [1667211742.715014][14571:14571] CHIP:DMG: - [1667211742.715173][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211742.715240][14571:14571] CHIP:DMG: { - [1667211742.715300][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211742.715362][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211742.715443][14571:14571] CHIP:DMG: [ - [1667211742.715505][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211742.715603][14571:14571] CHIP:DMG: { - [1667211742.715671][14571:14571] CHIP:DMG: CommandDataIB = - [1667211742.715753][14571:14571] CHIP:DMG: { - [1667211742.715830][14571:14571] CHIP:DMG: CommandPathIB = - [1667211742.715917][14571:14571] CHIP:DMG: { - [1667211742.716005][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211742.716097][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211742.716187][14571:14571] CHIP:DMG: CommandId = 0x12, - [1667211742.716272][14571:14571] CHIP:DMG: }, - [1667211742.716361][14571:14571] CHIP:DMG: - [1667211742.716441][14571:14571] CHIP:DMG: CommandFields = - [1667211742.716526][14571:14571] CHIP:DMG: { - [1667211742.716615][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211742.716708][14571:14571] CHIP:DMG: 0x1 = 0, - [1667211742.716800][14571:14571] CHIP:DMG: 0x2 = 20, - [1667211742.716892][14571:14571] CHIP:DMG: 0x3 = 30, - [1667211742.716982][14571:14571] CHIP:DMG: 0x4 = 0, - [1667211742.717071][14571:14571] CHIP:DMG: }, - [1667211742.717152][14571:14571] CHIP:DMG: }, - [1667211742.717244][14571:14571] CHIP:DMG: - [1667211742.717318][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock get-holiday-schedule 1 1 1 --trace_decode 1 + + Verify TH receives Get Holiday Day Schedule command response on TH(lock-app) log: + + [1685673297.404334][2637:2639] CHIP:DMG: InvokeResponseMessage = + [1685673297.404389][2637:2639] CHIP:DMG: { + [1685673297.404442][2637:2639] CHIP:DMG: suppressResponse = false, + [1685673297.404499][2637:2639] CHIP:DMG: InvokeResponseIBs = + [1685673297.404575][2637:2639] CHIP:DMG: [ + [1685673297.404632][2637:2639] CHIP:DMG: InvokeResponseIB = + [1685673297.404716][2637:2639] CHIP:DMG: { + [1685673297.404776][2637:2639] CHIP:DMG: CommandDataIB = + [1685673297.404848][2637:2639] CHIP:DMG: { + [1685673297.404915][2637:2639] CHIP:DMG: CommandPathIB = + [1685673297.404997][2637:2639] CHIP:DMG: { + [1685673297.405075][2637:2639] CHIP:DMG: EndpointId = 0x1, + [1685673297.405155][2637:2639] CHIP:DMG: ClusterId = 0x101, + [1685673297.405233][2637:2639] CHIP:DMG: CommandId = 0x12, + [1685673297.405307][2637:2639] CHIP:DMG: }, + [1685673297.405385][2637:2639] CHIP:DMG: + [1685673297.405451][2637:2639] CHIP:DMG: CommandFields = + [1685673297.405524][2637:2639] CHIP:DMG: { + [1685673297.405602][2637:2639] CHIP:DMG: 0x0 = 1, + [1685673297.405683][2637:2639] CHIP:DMG: 0x1 = 0, + [1685673297.405803][2637:2639] CHIP:DMG: 0x2 = 20, + [1685673297.405889][2637:2639] CHIP:DMG: 0x3 = 30, + [1685673297.405970][2637:2639] CHIP:DMG: 0x4 = 0, + [1685673297.406051][2637:2639] CHIP:DMG: }, + [1685673297.406122][2637:2639] CHIP:DMG: }, + [1685673297.406202][2637:2639] CHIP:DMG: + [1685673297.406262][2637:2639] CHIP:DMG: }, + [1685673297.406336][2637:2639] CHIP:DMG: + [1685673297.406391][2637:2639] CHIP:DMG: ], + [1685673297.406467][2637:2639] CHIP:DMG: + [1685673297.406524][2637:2639] CHIP:DMG: InteractionModelRevision = 1 + [1685673297.406578][2637:2639] CHIP:DMG: }, disabled: true - - label: "DUT sends Clear Holiday Day Schedule command to TH." + - label: "Step 12: DUT sends Clear Holiday Day Schedule command to TH." PICS: DRLK.C.F04 && DRLK.C.C13.Tx verification: | - ./chip-tool doorlock clear-holiday-schedule 1 1 1 - - Verify the " Clear Holiday Day Schedule command response" on TH(lock-app): - - [1667211787.307489][14571:14571] CHIP:EM: Handling via exchange: 25611r, Delegate: 0xaaaae921d988 - [1667211787.307637][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211787.307705][14571:14571] CHIP:DMG: { - [1667211787.307764][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211787.307832][14571:14571] CHIP:DMG: timedRequest = false, - [1667211787.307894][14571:14571] CHIP:DMG: InvokeRequests = - [1667211787.307972][14571:14571] CHIP:DMG: [ - [1667211787.308035][14571:14571] CHIP:DMG: CommandDataIB = - [1667211787.308122][14571:14571] CHIP:DMG: { - [1667211787.308191][14571:14571] CHIP:DMG: CommandPathIB = - [1667211787.308268][14571:14571] CHIP:DMG: { - [1667211787.308344][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211787.308427][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211787.308506][14571:14571] CHIP:DMG: CommandId = 0x13, - [1667211787.308581][14571:14571] CHIP:DMG: }, - [1667211787.308659][14571:14571] CHIP:DMG: - [1667211787.308728][14571:14571] CHIP:DMG: CommandFields = - [1667211787.308802][14571:14571] CHIP:DMG: { - [1667211787.308880][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211787.308960][14571:14571] CHIP:DMG: }, - [1667211787.309029][14571:14571] CHIP:DMG: }, - [1667211787.309106][14571:14571] CHIP:DMG: - [1667211787.309168][14571:14571] CHIP:DMG: ], - [1667211787.309246][14571:14571] CHIP:DMG: - [1667211787.309307][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211787.309368][14571:14571] CHIP:DMG: }, - [1667211787.309516][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211787.309599][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211787.309669][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0013 - [1667211787.309763][14571:14571] CHIP:ZCL: [ClearHolidaySchedule] incoming command [endpointId=1,scheduleIndex=1] - [1667211787.309829][14571:14571] CHIP:ZCL: [ClearHolidaySchedule] Clearing a single schedule [endpointId=1,scheduleIndex=1] - [1667211787.309922][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211787.310000][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211787.310066][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211787.310163][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211787.310776][14571:14571] CHIP:EM: <<< [E:25611r M:114718972 (Ack:218140067)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211787.310903][14571:14571] CHIP:IN: (S) Sending msg 114718972 on secure session with LSID: 42478 - [1667211787.311632][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:35083 | 114718972 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 27711 / Exchange = 25611] - [1667211787.311742][14571:14571] CHIP:DMG: Header Flags = - [1667211787.311800][14571:14571] CHIP:DMG: { - [1667211787.311889][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211787.311946][14571:14571] CHIP:DMG: { - [1667211787.312006][14571:14571] CHIP:DMG: AckMsg = 218140067 - [1667211787.312062][14571:14571] CHIP:DMG: NeedsAck = true - [1667211787.312116][14571:14571] CHIP:DMG: } - [1667211787.312189][14571:14571] CHIP:DMG: } - [1667211787.312244][14571:14571] CHIP:DMG: - [1667211787.312316][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211787.312373][14571:14571] CHIP:DMG: { - [1667211787.312428][14571:14571] CHIP:DMG: data = 003f6c00fc78d606e3b655ee6709d33b35127a3996e9e1a569719a760c862827ac396295caa9b2fd9155c97ad96a37737f8fc1cb655df09ece1d56a290d3c7a1733985bf - [1667211787.312486][14571:14571] CHIP:DMG: buffer_ptr = 187651867785648 - [1667211787.312539][14571:14571] CHIP:DMG: } - [1667211787.312592][14571:14571] CHIP:DMG: - [1667211787.312667][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211787.312724][14571:14571] CHIP:DMG: { - [1667211787.312779][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402131835012400001818181824ff0118 - [1667211787.312834][14571:14571] CHIP:DMG: } - [1667211787.312886][14571:14571] CHIP:DMG: - [1667211787.313028][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211787.313094][14571:14571] CHIP:DMG: { - [1667211787.313153][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211787.313216][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211787.313295][14571:14571] CHIP:DMG: [ - [1667211787.313455][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211787.313555][14571:14571] CHIP:DMG: { - [1667211787.313631][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211787.313714][14571:14571] CHIP:DMG: { - [1667211787.313792][14571:14571] CHIP:DMG: CommandPathIB = - [1667211787.313879][14571:14571] CHIP:DMG: { - [1667211787.313968][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211787.314062][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211787.314147][14571:14571] CHIP:DMG: CommandId = 0x13, - [1667211787.314231][14571:14571] CHIP:DMG: }, - [1667211787.314327][14571:14571] CHIP:DMG: - [1667211787.314401][14571:14571] CHIP:DMG: StatusIB = - [1667211787.314525][14571:14571] CHIP:DMG: { - [1667211787.314617][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211787.314702][14571:14571] CHIP:DMG: }, - [1667211787.314790][14571:14571] CHIP:DMG: - [1667211787.314868][14571:14571] CHIP:DMG: }, - [1667211787.314958][14571:14571] CHIP:DMG: + ./chip-tool doorlock clear-holiday-schedule 1 1 1 --trace_decode 1 + + Verify TH receives Clear Holiday Day Schedule command with SUCCESS response on TH(lock-app) log: + + [1685673314.255117][2642:2644] CHIP:DMG: InvokeResponseMessage = + [1685673314.255174][2642:2644] CHIP:DMG: { + [1685673314.255230][2642:2644] CHIP:DMG: suppressResponse = false, + [1685673314.255286][2642:2644] CHIP:DMG: InvokeResponseIBs = + [1685673314.255360][2642:2644] CHIP:DMG: [ + [1685673314.255417][2642:2644] CHIP:DMG: InvokeResponseIB = + [1685673314.255494][2642:2644] CHIP:DMG: { + [1685673314.255553][2642:2644] CHIP:DMG: CommandStatusIB = + [1685673314.255625][2642:2644] CHIP:DMG: { + [1685673314.255690][2642:2644] CHIP:DMG: CommandPathIB = + [1685673314.255765][2642:2644] CHIP:DMG: { + [1685673314.255840][2642:2644] CHIP:DMG: EndpointId = 0x1, + [1685673314.255919][2642:2644] CHIP:DMG: ClusterId = 0x101, + [1685673314.255996][2642:2644] CHIP:DMG: CommandId = 0x13, + [1685673314.256071][2642:2644] CHIP:DMG: }, + [1685673314.256154][2642:2644] CHIP:DMG: + [1685673314.256219][2642:2644] CHIP:DMG: StatusIB = + [1685673314.256293][2642:2644] CHIP:DMG: { + [1685673314.256371][2642:2644] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673314.256446][2642:2644] CHIP:DMG: }, + [1685673314.256521][2642:2644] CHIP:DMG: + [1685673314.256589][2642:2644] CHIP:DMG: }, + [1685673314.256665][2642:2644] CHIP:DMG: + [1685673314.256724][2642:2644] CHIP:DMG: }, + [1685673314.256796][2642:2644] CHIP:DMG: + [1685673314.256851][2642:2644] CHIP:DMG: ], + [1685673314.256921][2642:2644] CHIP:DMG: + [1685673314.256976][2642:2644] CHIP:DMG: InteractionModelRevision = 1 + [1685673314.257030][2642:2644] CHIP:DMG: }, disabled: true - - label: "DUT sends Set USer command to TH." + - label: "Step 13: DUT sends Set USer command to TH." PICS: DRLK.C.F08 && DRLK.C.C1a.Tx verification: | - ./chip-tool doorlock set-user 0 2 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Set User Day Schedule command response" on TH(lock-app): - - - [1667211828.350127][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeb8800 exchange 25908r - [1667211828.350237][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211828.350300][14571:14571] CHIP:DMG: { - [1667211828.350359][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211828.350441][14571:14571] CHIP:DMG: timedRequest = true, - [1667211828.350539][14571:14571] CHIP:DMG: InvokeRequests = - [1667211828.350625][14571:14571] CHIP:DMG: [ - [1667211828.350688][14571:14571] CHIP:DMG: CommandDataIB = - [1667211828.350762][14571:14571] CHIP:DMG: { - [1667211828.350833][14571:14571] CHIP:DMG: CommandPathIB = - [1667211828.350923][14571:14571] CHIP:DMG: { - [1667211828.351013][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211828.351101][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211828.351184][14571:14571] CHIP:DMG: CommandId = 0x1a, - [1667211828.351263][14571:14571] CHIP:DMG: }, - [1667211828.351348][14571:14571] CHIP:DMG: - [1667211828.351420][14571:14571] CHIP:DMG: CommandFields = - [1667211828.351507][14571:14571] CHIP:DMG: { - [1667211828.351591][14571:14571] CHIP:DMG: 0x0 = 0, - [1667211828.351678][14571:14571] CHIP:DMG: 0x1 = 2, - [1667211828.351768][14571:14571] CHIP:DMG: 0x2 = "xxx" (3 chars), - [1667211828.351854][14571:14571] CHIP:DMG: 0x3 = 6452, - [1667211828.351937][14571:14571] CHIP:DMG: 0x4 = 1, - [1667211828.352030][14571:14571] CHIP:DMG: 0x5 = 0, - [1667211828.352110][14571:14571] CHIP:DMG: 0x6 = 0, - [1667211828.352200][14571:14571] CHIP:DMG: }, - [1667211828.352276][14571:14571] CHIP:DMG: }, - [1667211828.352365][14571:14571] CHIP:DMG: - [1667211828.352431][14571:14571] CHIP:DMG: ], - [1667211828.352513][14571:14571] CHIP:DMG: - [1667211828.352574][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211828.352639][14571:14571] CHIP:DMG: }, - [1667211828.352798][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211828.352880][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211828.352951][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001A - [1667211828.353062][14571:14571] CHIP:ZCL: [SetUser] Incoming command [endpointId=1,userIndex=2] - [1667211828.353158][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=2] - [1667211828.353217][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=1] - [1667211828.353274][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::SetUser [endpoint=1,userIndex=2,creator=1,modifier=1,userName="xxx",uniqueId=1934,userStatus=1,userType=0,credentialRule=0,credentials=(nil),totalCredentials=0] - [1667211828.353339][14571:14571] CHIP:ZCL: Successfully set the user [mEndpointId=1,index=2,adjustedIndex=1] - [1667211828.353394][14571:14571] CHIP:ZCL: [createUser] User created [endpointId=1,creatorFabricId=1,userIndex=2,userName="xxx",userUniqueId=0x1934,userStatus=1,userType=0,credentialRule=0,totalCredentials=0] - [1667211828.353658][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211828.353774][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000E priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x00000000012A283B - [1667211828.353846][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=14,dataType=2,operation=0,nodeId=112233,fabricIndex=1] - [1667211828.353927][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211828.353998][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211828.354064][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211828.354171][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211828.354752][14571:14571] CHIP:EM: <<< [E:25908r M:105981261 (Ack:215468925)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211828.354873][14571:14571] CHIP:IN: (S) Sending msg 105981261 on secure session with LSID: 42479 - [1667211828.355593][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be36%eth0]:52743 | 105981261 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 33094 / Exchange = 25908] - [1667211828.355693][14571:14571] CHIP:DMG: Header Flags = - [1667211828.355751][14571:14571] CHIP:DMG: { - [1667211828.355836][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211828.355892][14571:14571] CHIP:DMG: { - [1667211828.355952][14571:14571] CHIP:DMG: AckMsg = 215468925 - [1667211828.356008][14571:14571] CHIP:DMG: NeedsAck = true - [1667211828.356063][14571:14571] CHIP:DMG: } - [1667211828.356135][14571:14571] CHIP:DMG: } - [1667211828.356190][14571:14571] CHIP:DMG: - [1667211828.356259][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211828.356314][14571:14571] CHIP:DMG: { - [1667211828.356368][14571:14571] CHIP:DMG: data = 004681004d25510615e510adc14313c57546ef359826b0af979dc7b60feb4478daae99e22008da3fee31ac2373454c2f6faa68a567e122cad9469bb7dd72cfbad9470482 - [1667211828.356426][14571:14571] CHIP:DMG: buffer_ptr = 187651867783264 - [1667211828.356480][14571:14571] CHIP:DMG: } - [1667211828.356532][14571:14571] CHIP:DMG: - [1667211828.356606][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211828.356663][14571:14571] CHIP:DMG: { - [1667211828.356717][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124021a1835012400001818181824ff0118 - [1667211828.356773][14571:14571] CHIP:DMG: } - [1667211828.356824][14571:14571] CHIP:DMG: - [1667211828.356962][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211828.357025][14571:14571] CHIP:DMG: { - [1667211828.357084][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211828.357153][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211828.357231][14571:14571] CHIP:DMG: [ - [1667211828.357294][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211828.357381][14571:14571] CHIP:DMG: { - [1667211828.357453][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211828.357539][14571:14571] CHIP:DMG: { - [1667211828.357623][14571:14571] CHIP:DMG: CommandPathIB = - [1667211828.357709][14571:14571] CHIP:DMG: { - [1667211828.357803][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211828.357894][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211828.357990][14571:14571] CHIP:DMG: CommandId = 0x1a, - [1667211828.358085][14571:14571] CHIP:DMG: }, - [1667211828.358189][14571:14571] CHIP:DMG: - [1667211828.358268][14571:14571] CHIP:DMG: StatusIB = - [1667211828.358352][14571:14571] CHIP:DMG: { - [1667211828.358439][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211828.358631][14571:14571] CHIP:DMG: }, - [1667211828.358727][14571:14571] CHIP:DMG: + ./chip-tool doorlock set-user 0 2 xxx 6452 1 0 0 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Set User command with SUCCESS response on TH(lock-app) log: + + [1685673332.573601][2645:2647] CHIP:DMG: InvokeResponseMessage = + [1685673332.573656][2645:2647] CHIP:DMG: { + [1685673332.573709][2645:2647] CHIP:DMG: suppressResponse = false, + [1685673332.573902][2645:2647] CHIP:DMG: InvokeResponseIBs = + [1685673332.573982][2645:2647] CHIP:DMG: [ + [1685673332.574040][2645:2647] CHIP:DMG: InvokeResponseIB = + [1685673332.574116][2645:2647] CHIP:DMG: { + [1685673332.574175][2645:2647] CHIP:DMG: CommandStatusIB = + [1685673332.574245][2645:2647] CHIP:DMG: { + [1685673332.574312][2645:2647] CHIP:DMG: CommandPathIB = + [1685673332.574390][2645:2647] CHIP:DMG: { + [1685673332.574466][2645:2647] CHIP:DMG: EndpointId = 0x1, + [1685673332.574545][2645:2647] CHIP:DMG: ClusterId = 0x101, + [1685673332.574623][2645:2647] CHIP:DMG: CommandId = 0x1a, + [1685673332.574697][2645:2647] CHIP:DMG: }, + [1685673332.574780][2645:2647] CHIP:DMG: + [1685673332.574848][2645:2647] CHIP:DMG: StatusIB = + [1685673332.574922][2645:2647] CHIP:DMG: { + [1685673332.575013][2645:2647] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673332.575108][2645:2647] CHIP:DMG: }, + [1685673332.575202][2645:2647] CHIP:DMG: + [1685673332.575276][2645:2647] CHIP:DMG: }, + [1685673332.575357][2645:2647] CHIP:DMG: + [1685673332.575417][2645:2647] CHIP:DMG: }, + [1685673332.575488][2645:2647] CHIP:DMG: + [1685673332.575543][2645:2647] CHIP:DMG: ], + [1685673332.575612][2645:2647] CHIP:DMG: + [1685673332.575667][2645:2647] CHIP:DMG: InteractionModelRevision = 1 + [1685673332.575721][2645:2647] CHIP:DMG: }, disabled: true - - label: "DUT sends Get User to TH." + - label: "Step 14: DUT sends Get User to TH." PICS: DRLK.C.F08 && DRLK.C.C1b.Tx verification: | - ./chip-tool doorlock get-user 2 1 1 --timedInteractionTimeoutMs 1000 - Verify the " Get User Day Schedule command response" on TH(lock-app): - - [1667211856.554861][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1ae9bb50 exchange 30869r - [1667211856.554971][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211856.555035][14571:14571] CHIP:DMG: { - [1667211856.555093][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211856.555171][14571:14571] CHIP:DMG: timedRequest = true, - [1667211856.555234][14571:14571] CHIP:DMG: InvokeRequests = - [1667211856.555314][14571:14571] CHIP:DMG: [ - [1667211856.555377][14571:14571] CHIP:DMG: CommandDataIB = - [1667211856.555456][14571:14571] CHIP:DMG: { - [1667211856.555531][14571:14571] CHIP:DMG: CommandPathIB = - [1667211856.555606][14571:14571] CHIP:DMG: { - [1667211856.555695][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211856.555784][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211856.555871][14571:14571] CHIP:DMG: CommandId = 0x1b, - [1667211856.555951][14571:14571] CHIP:DMG: }, - [1667211856.556037][14571:14571] CHIP:DMG: - [1667211856.556106][14571:14571] CHIP:DMG: CommandFields = - [1667211856.556187][14571:14571] CHIP:DMG: { - [1667211856.556272][14571:14571] CHIP:DMG: 0x0 = 2, - [1667211856.556358][14571:14571] CHIP:DMG: }, - [1667211856.556437][14571:14571] CHIP:DMG: }, - [1667211856.556522][14571:14571] CHIP:DMG: - [1667211856.556584][14571:14571] CHIP:DMG: ], - [1667211856.556661][14571:14571] CHIP:DMG: - [1667211856.556723][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211856.556783][14571:14571] CHIP:DMG: }, - [1667211856.556929][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211856.557011][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211856.557083][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001B - [1667211856.557161][14571:14571] CHIP:ZCL: [GetUser] Incoming command [endpointId=1,userIndex=2] - [1667211856.557249][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=2] - [1667211856.557308][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=1,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211856.557400][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211856.557476][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211856.557534][14571:14571] CHIP:ZCL: Found user in storage: [userIndex=2,userName="xxx",userStatus=1,userType=0,credentialRule=0,createdBy=1,modifiedBy=1] - [1667211856.557608][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=3] - [1667211856.557665][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=2] - [1667211856.557721][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=4] - [1667211856.557774][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=3] - [1667211856.557828][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=5] - [1667211856.557881][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=4] - [1667211856.557934][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=6] - [1667211856.557985][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=5] - [1667211856.558037][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=7] - [1667211856.558089][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=6] - [1667211856.558143][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=8] - [1667211856.558195][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=7] - [1667211856.558248][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=9] - [1667211856.558301][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=8] - [1667211856.558354][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=10] - [1667211856.558406][14571:14571] CHIP:ZCL: Found unoccupied user [endpoint=1,adjustedIndex=9] - [1667211856.558546][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211856.558658][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211856.559227][14571:14571] CHIP:EM: <<< [E:30869r M:57070172 (Ack:158079364)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211856.559342][14571:14571] CHIP:IN: (S) Sending msg 57070172 on secure session with LSID: 42480 - [1667211856.560055][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:46701 | 57070172 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 3016 / Exchange = 30869] - [1667211856.560164][14571:14571] CHIP:DMG: Header Flags = - [1667211856.560222][14571:14571] CHIP:DMG: { - [1667211856.560310][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211856.560369][14571:14571] CHIP:DMG: { - [1667211856.560431][14571:14571] CHIP:DMG: AckMsg = 158079364 - [1667211856.560487][14571:14571] CHIP:DMG: NeedsAck = true - [1667211856.560544][14571:14571] CHIP:DMG: } - [1667211856.560619][14571:14571] CHIP:DMG: } - [1667211856.560674][14571:14571] CHIP:DMG: - [1667211856.560758][14571:14571] CHIP:DMG: Encrypted Payload (93 bytes) = - [1667211856.560815][14571:14571] CHIP:DMG: { - [1667211856.560869][14571:14571] CHIP:DMG: data = 00c80b005cd26603c97b80d9b20084d5c66a9563e7edbc8088506239e2d054d0d42ecf6068d4cf3ab8896e0ec67eed7a687e0ee9da1d048d2ec35e93052c81ff3303208dc05ea883c624523bb20f6ddf13dfb8d5343b0ff54848d666a2 - [1667211856.560929][14571:14571] CHIP:DMG: buffer_ptr = 187651867785440 - [1667211856.560982][14571:14571] CHIP:DMG: } - [1667211856.561034][14571:14571] CHIP:DMG: - [1667211856.561110][14571:14571] CHIP:DMG: Decrypted Payload (59 bytes) = - [1667211856.561167][14571:14571] CHIP:DMG: { - [1667211856.561221][14571:14571] CHIP:DMG: data = 152800360115350037002400012501010124021c1835012400022c0103787878250234192403012404002405002407012408011818181824ff0118 - [1667211856.561277][14571:14571] CHIP:DMG: } - [1667211856.561330][14571:14571] CHIP:DMG: - [1667211856.561503][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211856.561567][14571:14571] CHIP:DMG: { - [1667211856.561626][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211856.561688][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211856.561774][14571:14571] CHIP:DMG: [ - [1667211856.561836][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211856.561931][14571:14571] CHIP:DMG: { - [1667211856.562009][14571:14571] CHIP:DMG: CommandDataIB = - [1667211856.562087][14571:14571] CHIP:DMG: { - [1667211856.562166][14571:14571] CHIP:DMG: CommandPathIB = - [1667211856.562252][14571:14571] CHIP:DMG: { - [1667211856.562338][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211856.562436][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211856.562590][14571:14571] CHIP:DMG: CommandId = 0x1c, - [1667211856.562684][14571:14571] CHIP:DMG: }, - [1667211856.562779][14571:14571] CHIP:DMG: - [1667211856.562865][14571:14571] CHIP:DMG: CommandFields = - [1667211856.562950][14571:14571] CHIP:DMG: { - [1667211856.563040][14571:14571] CHIP:DMG: 0x0 = 2, - [1667211856.563142][14571:14571] CHIP:DMG: 0x1 = "xxx" (3 chars), - [1667211856.563242][14571:14571] CHIP:DMG: 0x2 = 6452, - [1667211856.563333][14571:14571] CHIP:DMG: 0x3 = 1, - [1667211856.563430][14571:14571] CHIP:DMG: 0x4 = 0, - [1667211856.563520][14571:14571] CHIP:DMG: 0x5 = 0, - [1667211856.563609][14571:14571] CHIP:DMG: 0x7 = 1, - [1667211856.563701][14571:14571] CHIP:DMG: 0x8 = 1, - [1667211856.563790][14571:14571] CHIP:DMG: }, - [1667211856.563870][14571:14571] CHIP:DMG: }, - [1667211856.563963][14571:14571] CHIP:DMG: + ./chip-tool doorlock get-user 2 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Get User command response on TH(lock-app) log: + + [1685673354.071762][2648:2650] CHIP:DMG: InvokeResponseMessage = + [1685673354.071817][2648:2650] CHIP:DMG: { + [1685673354.071870][2648:2650] CHIP:DMG: suppressResponse = false, + [1685673354.071926][2648:2650] CHIP:DMG: InvokeResponseIBs = + [1685673354.072011][2648:2650] CHIP:DMG: [ + [1685673354.072068][2648:2650] CHIP:DMG: InvokeResponseIB = + [1685673354.072156][2648:2650] CHIP:DMG: { + [1685673354.072216][2648:2650] CHIP:DMG: CommandDataIB = + [1685673354.072285][2648:2650] CHIP:DMG: { + [1685673354.072352][2648:2650] CHIP:DMG: CommandPathIB = + [1685673354.072428][2648:2650] CHIP:DMG: { + [1685673354.072502][2648:2650] CHIP:DMG: EndpointId = 0x1, + [1685673354.072582][2648:2650] CHIP:DMG: ClusterId = 0x101, + [1685673354.072658][2648:2650] CHIP:DMG: CommandId = 0x1c, + [1685673354.072733][2648:2650] CHIP:DMG: }, + [1685673354.072807][2648:2650] CHIP:DMG: + [1685673354.072875][2648:2650] CHIP:DMG: CommandFields = + [1685673354.072948][2648:2650] CHIP:DMG: { + [1685673354.073024][2648:2650] CHIP:DMG: 0x0 = 2, + [1685673354.073111][2648:2650] CHIP:DMG: 0x1 = "xxx" (3 chars), + [1685673354.073299][2648:2650] CHIP:DMG: 0x2 = 6452, + [1685673354.073384][2648:2650] CHIP:DMG: 0x3 = 1, + [1685673354.073465][2648:2650] CHIP:DMG: 0x4 = 0, + [1685673354.073546][2648:2650] CHIP:DMG: 0x5 = 0, + [1685673354.073667][2648:2650] CHIP:DMG: 0x6 = [ + [1685673354.073749][2648:2650] CHIP:DMG: + [1685673354.073959][2648:2650] CHIP:DMG: ], + [1685673354.074042][2648:2650] CHIP:DMG: 0x7 = 1, + [1685673354.074121][2648:2650] CHIP:DMG: 0x8 = 1, + [1685673354.074201][2648:2650] CHIP:DMG: 0x9 = NULL + [1685673354.074281][2648:2650] CHIP:DMG: }, + [1685673354.074350][2648:2650] CHIP:DMG: }, + [1685673354.074439][2648:2650] CHIP:DMG: + [1685673354.074501][2648:2650] CHIP:DMG: }, + [1685673354.074583][2648:2650] CHIP:DMG: + [1685673354.074638][2648:2650] CHIP:DMG: ], + [1685673354.074725][2648:2650] CHIP:DMG: + [1685673354.074781][2648:2650] CHIP:DMG: InteractionModelRevision = 1 + [1685673354.074836][2648:2650] CHIP:DMG: }, disabled: true - - label: "DUT sends Clear User command to TH.a" + - label: "Step 15: DUT sends Clear User command to TH.a" PICS: DRLK.C.F08 && DRLK.C.C1d.Tx verification: | - ./chip-tool doorlock clear-user 2 1 1 --timedInteractionTimeoutMs 1000 - Verify the " Clear User Day Schedule command response" on TH(lock-app): - - [1667211914.022424][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1ae937d0 exchange 2541r - [1667211914.022574][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211914.022640][14571:14571] CHIP:DMG: { - [1667211914.022701][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211914.022769][14571:14571] CHIP:DMG: timedRequest = true, - [1667211914.022830][14571:14571] CHIP:DMG: InvokeRequests = - [1667211914.022909][14571:14571] CHIP:DMG: [ - [1667211914.022972][14571:14571] CHIP:DMG: CommandDataIB = - [1667211914.023051][14571:14571] CHIP:DMG: { - [1667211914.023123][14571:14571] CHIP:DMG: CommandPathIB = - [1667211914.023212][14571:14571] CHIP:DMG: { - [1667211914.023301][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211914.023387][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211914.023471][14571:14571] CHIP:DMG: CommandId = 0x1d, - [1667211914.023552][14571:14571] CHIP:DMG: }, - [1667211914.023643][14571:14571] CHIP:DMG: - [1667211914.023725][14571:14571] CHIP:DMG: CommandFields = - [1667211914.023798][14571:14571] CHIP:DMG: { - [1667211914.023887][14571:14571] CHIP:DMG: 0x0 = 2, - [1667211914.023969][14571:14571] CHIP:DMG: }, - [1667211914.024045][14571:14571] CHIP:DMG: }, - [1667211914.024133][14571:14571] CHIP:DMG: - [1667211914.024197][14571:14571] CHIP:DMG: ], - [1667211914.024273][14571:14571] CHIP:DMG: - [1667211914.024336][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211914.024396][14571:14571] CHIP:DMG: }, - [1667211914.024543][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211914.024623][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211914.024692][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001D - [1667211914.024767][14571:14571] CHIP:ZCL: [ClearUser] Incoming command [endpointId=1,userIndex=2] - [1667211914.024859][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=2] - [1667211914.024919][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=1,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667211914.025008][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::SetUser [endpoint=1,userIndex=2,creator=0,modifier=0,userName="",uniqueId=0,userStatus=0,userType=0,credentialRule=0,credentials=(nil),totalCredentials=0] - [1667211914.025077][14571:14571] CHIP:ZCL: Successfully set the user [mEndpointId=1,index=2,adjustedIndex=1] - [1667211914.025333][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667211914.025452][14571:14571] CHIP:EVL: LogEvent event number: 0x000000000000000F priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x00000000012B76E2 - [1667211914.025523][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=15,dataType=2,operation=1,nodeId=112233,fabricIndex=1] - [1667211914.025602][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211914.025672][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211914.025738][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211914.025833][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211914.026342][14571:14571] CHIP:EM: <<< [E:2541r M:132123146 (Ack:195110449)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211914.026442][14571:14571] CHIP:IN: (S) Sending msg 132123146 on secure session with LSID: 42481 - [1667211914.027154][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:37935 | 132123146 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 3932 / Exchange = 2541] - [1667211914.027252][14571:14571] CHIP:DMG: Header Flags = - [1667211914.027310][14571:14571] CHIP:DMG: { - [1667211914.027396][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211914.027453][14571:14571] CHIP:DMG: { - [1667211914.027514][14571:14571] CHIP:DMG: AckMsg = 195110449 - [1667211914.027571][14571:14571] CHIP:DMG: NeedsAck = true - [1667211914.027630][14571:14571] CHIP:DMG: } - [1667211914.027703][14571:14571] CHIP:DMG: } - [1667211914.027758][14571:14571] CHIP:DMG: - [1667211914.027827][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667211914.027882][14571:14571] CHIP:DMG: { - [1667211914.027937][14571:14571] CHIP:DMG: data = 005c0f000a0ae0072979c079e7318fb3cacb9c7f6174ee6a8639887ed9268b986bbe34190fce886d617b329ac4eb469763fc0d702abbeecfed871d05398158f947605856 - [1667211914.027995][14571:14571] CHIP:DMG: buffer_ptr = 187651867787584 - [1667211914.028049][14571:14571] CHIP:DMG: } - [1667211914.028102][14571:14571] CHIP:DMG: - [1667211914.028177][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667211914.028234][14571:14571] CHIP:DMG: { - [1667211914.028287][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124021d1835012400001818181824ff0118 - [1667211914.028343][14571:14571] CHIP:DMG: } - [1667211914.028396][14571:14571] CHIP:DMG: - [1667211914.028530][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211914.028593][14571:14571] CHIP:DMG: { - [1667211914.028652][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211914.028714][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211914.028792][14571:14571] CHIP:DMG: [ - [1667211914.028855][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211914.028943][14571:14571] CHIP:DMG: { - [1667211914.029012][14571:14571] CHIP:DMG: CommandStatusIB = - [1667211914.029093][14571:14571] CHIP:DMG: { - [1667211914.029170][14571:14571] CHIP:DMG: CommandPathIB = - [1667211914.029261][14571:14571] CHIP:DMG: { - [1667211914.029349][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211914.029438][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211914.029535][14571:14571] CHIP:DMG: CommandId = 0x1d, - [1667211914.029626][14571:14571] CHIP:DMG: }, - [1667211914.029728][14571:14571] CHIP:DMG: - [1667211914.029807][14571:14571] CHIP:DMG: StatusIB = - [1667211914.029900][14571:14571] CHIP:DMG: { - [1667211914.029994][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667211914.030086][14571:14571] CHIP:DMG: }, - [1667211914.030180][14571:14571] CHIP:DMG: - [1667211914.030256][14571:14571] CHIP:DMG: }, - [1667211914.030344][14571:14571] CHIP:DMG: - [1667211914.030414][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock clear-user 2 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Clear User command with SUCCESS response on TH(lock-app) log: + + [1685673377.373571][2656:2658] CHIP:DMG: InvokeResponseMessage = + [1685673377.373626][2656:2658] CHIP:DMG: { + [1685673377.373680][2656:2658] CHIP:DMG: suppressResponse = false, + [1685673377.373736][2656:2658] CHIP:DMG: InvokeResponseIBs = + [1685673377.373862][2656:2658] CHIP:DMG: [ + [1685673377.373923][2656:2658] CHIP:DMG: InvokeResponseIB = + [1685673377.374005][2656:2658] CHIP:DMG: { + [1685673377.374066][2656:2658] CHIP:DMG: CommandStatusIB = + [1685673377.374135][2656:2658] CHIP:DMG: { + [1685673377.374204][2656:2658] CHIP:DMG: CommandPathIB = + [1685673377.374279][2656:2658] CHIP:DMG: { + [1685673377.374357][2656:2658] CHIP:DMG: EndpointId = 0x1, + [1685673377.374435][2656:2658] CHIP:DMG: ClusterId = 0x101, + [1685673377.374514][2656:2658] CHIP:DMG: CommandId = 0x1d, + [1685673377.374587][2656:2658] CHIP:DMG: }, + [1685673377.374669][2656:2658] CHIP:DMG: + [1685673377.374738][2656:2658] CHIP:DMG: StatusIB = + [1685673377.374813][2656:2658] CHIP:DMG: { + [1685673377.374889][2656:2658] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673377.374964][2656:2658] CHIP:DMG: }, + [1685673377.375039][2656:2658] CHIP:DMG: + [1685673377.375107][2656:2658] CHIP:DMG: }, + [1685673377.375182][2656:2658] CHIP:DMG: + [1685673377.375241][2656:2658] CHIP:DMG: }, + [1685673377.375313][2656:2658] CHIP:DMG: + [1685673377.375369][2656:2658] CHIP:DMG: ], + [1685673377.375437][2656:2658] CHIP:DMG: + [1685673377.375489][2656:2658] CHIP:DMG: InteractionModelRevision = 1 + [1685673377.375543][2656:2658] CHIP:DMG: }, disabled: true - - label: "DUT sends Set Credential command to TH.a" + - label: "Step 16: DUT sends Set Credential command to TH.a" PICS: DRLK.C.F08 && DRLK.C.C22.Tx verification: | - ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 1 }' 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " Set Credential command response" on TH(lock-app): - - [1667211985.379772][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1ae9bea0 exchange 61782r - [1667211985.379886][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667211985.379949][14571:14571] CHIP:DMG: { - [1667211985.380006][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211985.380080][14571:14571] CHIP:DMG: timedRequest = true, - [1667211985.380143][14571:14571] CHIP:DMG: InvokeRequests = - [1667211985.380227][14571:14571] CHIP:DMG: [ - [1667211985.380289][14571:14571] CHIP:DMG: CommandDataIB = - [1667211985.380358][14571:14571] CHIP:DMG: { - [1667211985.380429][14571:14571] CHIP:DMG: CommandPathIB = - [1667211985.380516][14571:14571] CHIP:DMG: { - [1667211985.380605][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211985.380693][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211985.380783][14571:14571] CHIP:DMG: CommandId = 0x22, - [1667211985.380863][14571:14571] CHIP:DMG: }, - [1667211985.380944][14571:14571] CHIP:DMG: - [1667211985.381016][14571:14571] CHIP:DMG: CommandFields = - [1667211985.381082][14571:14571] CHIP:DMG: { - [1667211985.381171][14571:14571] CHIP:DMG: 0x0 = 0, - [1667211985.381252][14571:14571] CHIP:DMG: 0x1 = - [1667211985.381335][14571:14571] CHIP:DMG: { - [1667211985.381421][14571:14571] CHIP:DMG: 0x0 = 1, - [1667211985.381510][14571:14571] CHIP:DMG: 0x1 = 1, - [1667211985.381596][14571:14571] CHIP:DMG: }, - [1667211985.381682][14571:14571] CHIP:DMG: 0x2 = [ - [1667211985.381768][14571:14571] CHIP:DMG: 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, - [1667211985.381860][14571:14571] CHIP:DMG: ] (6 bytes) - [1667211985.381946][14571:14571] CHIP:DMG: 0x3 = 1, - [1667211985.382040][14571:14571] CHIP:DMG: 0x4 = 0, - [1667211985.382125][14571:14571] CHIP:DMG: 0x5 = 0, - [1667211985.382216][14571:14571] CHIP:DMG: }, - [1667211985.382298][14571:14571] CHIP:DMG: }, - [1667211985.382388][14571:14571] CHIP:DMG: - [1667211985.382450][14571:14571] CHIP:DMG: ], - [1667211985.382593][14571:14571] CHIP:DMG: - [1667211985.382657][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211985.382727][14571:14571] CHIP:DMG: }, - [1667211985.382889][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667211985.382970][14571:14571] CHIP:DMG: AccessControl: allowed - [1667211985.383039][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0022 - [1667211985.383151][14571:14571] CHIP:ZCL: [SetCredential] Incoming command [endpointId=1] - [1667211985.383240][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=2,credentialType=1] - [1667211985.383300][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=2] - [1667211985.383365][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=1,credentialType=1] - [1667211985.383421][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=1] - [1667211985.383473][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=2,credentialType=1] - [1667211985.383526][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=2] - [1667211985.383579][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=3,credentialType=1] - [1667211985.383631][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=3] - [1667211985.383683][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=4,credentialType=1] - [1667211985.383736][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=4] - [1667211985.383789][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=5,credentialType=1] - [1667211985.383842][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=5] - [1667211985.383893][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=6,credentialType=1] - [1667211985.383947][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=6] - [1667211985.383999][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=7,credentialType=1] - [1667211985.384052][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=7] - [1667211985.384103][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=8,credentialType=1] - [1667211985.384156][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=8] - [1667211985.384207][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=9,credentialType=1] - [1667211985.384260][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=9] - [1667211985.384311][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=10,credentialType=1] - [1667211985.384364][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=10] - [1667211985.384416][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=1,credentialType=1] - [1667211985.384469][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=1] - [1667211985.384521][14571:14571] CHIP:ZCL: [SetCredential] Unable to set the credential: user status is out of range [endpointId=1,credentialIndex=1,userStatus=0] - [1667211985.384606][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667211985.384679][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667211985.384748][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667211985.384861][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667211985.385364][14571:14571] CHIP:EM: <<< [E:61782r M:160486692 (Ack:32724823)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667211985.385467][14571:14571] CHIP:IN: (S) Sending msg 160486692 on secure session with LSID: 42482 - [1667211985.386171][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:34405 | 160486692 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 26384 / Exchange = 61782] - [1667211985.386278][14571:14571] CHIP:DMG: Header Flags = - [1667211985.386335][14571:14571] CHIP:DMG: { - [1667211985.386419][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667211985.386508][14571:14571] CHIP:DMG: { - [1667211985.386570][14571:14571] CHIP:DMG: AckMsg = 32724823 - [1667211985.386626][14571:14571] CHIP:DMG: NeedsAck = true - [1667211985.386681][14571:14571] CHIP:DMG: } - [1667211985.386753][14571:14571] CHIP:DMG: } - [1667211985.386808][14571:14571] CHIP:DMG: - [1667211985.386877][14571:14571] CHIP:DMG: Encrypted Payload (73 bytes) = - [1667211985.386933][14571:14571] CHIP:DMG: { - [1667211985.386988][14571:14571] CHIP:DMG: data = 0010670024d59009e4a18ce5a334af34af2dfef43c4f3ede83b442faa5672b0eeaa5d15d4e3ea38155c269ecff4c629a536a239a8332c8eb0d7c4b9e8311d718036bb038c757046603 - [1667211985.387046][14571:14571] CHIP:DMG: buffer_ptr = 187651867791424 - [1667211985.387100][14571:14571] CHIP:DMG: } - [1667211985.387152][14571:14571] CHIP:DMG: - [1667211985.387225][14571:14571] CHIP:DMG: Decrypted Payload (39 bytes) = - [1667211985.387283][14571:14571] CHIP:DMG: { - [1667211985.387337][14571:14571] CHIP:DMG: data = 152800360115350037002400012501010124022318350124008534012402021818181824ff0118 - [1667211985.387392][14571:14571] CHIP:DMG: } - [1667211985.387445][14571:14571] CHIP:DMG: - [1667211985.387597][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667211985.387660][14571:14571] CHIP:DMG: { - [1667211985.387720][14571:14571] CHIP:DMG: suppressResponse = false, - [1667211985.387782][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667211985.387861][14571:14571] CHIP:DMG: [ - [1667211985.387924][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667211985.388019][14571:14571] CHIP:DMG: { - [1667211985.388092][14571:14571] CHIP:DMG: CommandDataIB = - [1667211985.388179][14571:14571] CHIP:DMG: { - [1667211985.388262][14571:14571] CHIP:DMG: CommandPathIB = - [1667211985.388339][14571:14571] CHIP:DMG: { - [1667211985.388431][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667211985.388521][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667211985.388610][14571:14571] CHIP:DMG: CommandId = 0x23, - [1667211985.388702][14571:14571] CHIP:DMG: }, - [1667211985.388797][14571:14571] CHIP:DMG: - [1667211985.388882][14571:14571] CHIP:DMG: CommandFields = - [1667211985.388965][14571:14571] CHIP:DMG: { - [1667211985.389054][14571:14571] CHIP:DMG: 0x0 = 133, - [1667211985.389152][14571:14571] CHIP:DMG: 0x1 = NULL - [1667211985.389249][14571:14571] CHIP:DMG: 0x2 = 2, - [1667211985.389330][14571:14571] CHIP:DMG: }, - [1667211985.389394][14571:14571] CHIP:DMG: }, - [1667211985.389480][14571:14571] CHIP:DMG: - [1667211985.389550][14571:14571] CHIP:DMG: }, - [1667211985.389633][14571:14571] CHIP:DMG: - [1667211985.389693][14571:14571] CHIP:DMG: ], - [1667211985.389772][14571:14571] CHIP:DMG: - [1667211985.389831][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667211985.389890][14571:14571] CHIP:DMG: }, - [1667211985.389946][14571:14571] CHIP:DMG: + ./chip-tool doorlock set-credential 0 '{ "credentialType" : 1 , "credentialIndex" : 1 }' 123456 1 0 0 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Set Credential command response on TH(lock-app) log: + + [1685673397.369211][2660:2662] CHIP:DMG: InvokeResponseMessage = + [1685673397.369266][2660:2662] CHIP:DMG: { + [1685673397.369320][2660:2662] CHIP:DMG: suppressResponse = false, + [1685673397.369375][2660:2662] CHIP:DMG: InvokeResponseIBs = + [1685673397.369448][2660:2662] CHIP:DMG: [ + [1685673397.369504][2660:2662] CHIP:DMG: InvokeResponseIB = + [1685673397.369584][2660:2662] CHIP:DMG: { + [1685673397.369644][2660:2662] CHIP:DMG: CommandDataIB = + [1685673397.369712][2660:2662] CHIP:DMG: { + [1685673397.369829][2660:2662] CHIP:DMG: CommandPathIB = + [1685673397.369908][2660:2662] CHIP:DMG: { + [1685673397.369981][2660:2662] CHIP:DMG: EndpointId = 0x1, + [1685673397.370061][2660:2662] CHIP:DMG: ClusterId = 0x101, + [1685673397.370138][2660:2662] CHIP:DMG: CommandId = 0x23, + [1685673397.370212][2660:2662] CHIP:DMG: }, + [1685673397.370289][2660:2662] CHIP:DMG: + [1685673397.370356][2660:2662] CHIP:DMG: CommandFields = + [1685673397.370428][2660:2662] CHIP:DMG: { + [1685673397.370506][2660:2662] CHIP:DMG: 0x0 = 133, + [1685673397.370586][2660:2662] CHIP:DMG: 0x1 = NULL + [1685673397.370665][2660:2662] CHIP:DMG: 0x2 = 2, + [1685673397.370743][2660:2662] CHIP:DMG: }, + [1685673397.370812][2660:2662] CHIP:DMG: }, + [1685673397.370892][2660:2662] CHIP:DMG: + [1685673397.370951][2660:2662] CHIP:DMG: }, + [1685673397.371023][2660:2662] CHIP:DMG: + [1685673397.371078][2660:2662] CHIP:DMG: ], + [1685673397.371150][2660:2662] CHIP:DMG: + [1685673397.371208][2660:2662] CHIP:DMG: InteractionModelRevision = 1 + [1685673397.371263][2660:2662] CHIP:DMG: }, disabled: true - - label: "DUT sends Get Credential to TH." + - label: "Step 17: DUT sends Get Credential to TH." PICS: DRLK.C.F08 && DRLK.C.C24.Tx verification: | - ./chip-tool doorlock get-credential-status '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 - Verify the " Get Credential command response" on TH(lock-app): - - [1667212093.273797][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1ae93420 exchange 30438r - [1667212093.273905][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667212093.273968][14571:14571] CHIP:DMG: { - [1667212093.274026][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212093.274093][14571:14571] CHIP:DMG: timedRequest = true, - [1667212093.274154][14571:14571] CHIP:DMG: InvokeRequests = - [1667212093.274230][14571:14571] CHIP:DMG: [ - [1667212093.274292][14571:14571] CHIP:DMG: CommandDataIB = - [1667212093.274361][14571:14571] CHIP:DMG: { - [1667212093.274433][14571:14571] CHIP:DMG: CommandPathIB = - [1667212093.274569][14571:14571] CHIP:DMG: { - [1667212093.274652][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212093.274726][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212093.274820][14571:14571] CHIP:DMG: CommandId = 0x24, - [1667212093.274899][14571:14571] CHIP:DMG: }, - [1667212093.274990][14571:14571] CHIP:DMG: - [1667212093.275062][14571:14571] CHIP:DMG: CommandFields = - [1667212093.275148][14571:14571] CHIP:DMG: { - [1667212093.275234][14571:14571] CHIP:DMG: 0x0 = - [1667212093.275317][14571:14571] CHIP:DMG: { - [1667212093.275406][14571:14571] CHIP:DMG: 0x0 = 1, - [1667212093.275502][14571:14571] CHIP:DMG: 0x1 = 1, - [1667212093.275596][14571:14571] CHIP:DMG: }, - [1667212093.275688][14571:14571] CHIP:DMG: }, - [1667212093.275762][14571:14571] CHIP:DMG: }, - [1667212093.275845][14571:14571] CHIP:DMG: - [1667212093.275911][14571:14571] CHIP:DMG: ], - [1667212093.275990][14571:14571] CHIP:DMG: - [1667212093.276051][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667212093.276110][14571:14571] CHIP:DMG: }, - [1667212093.276259][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667212093.276339][14571:14571] CHIP:DMG: AccessControl: allowed - [1667212093.276408][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0024 - [1667212093.276495][14571:14571] CHIP:ZCL: [GetCredentialStatus] Incoming command [endpointId=1] - [1667212093.276576][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=1,credentialType=1] - [1667212093.276634][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=1] - [1667212093.276696][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=2,credentialType=1] - [1667212093.276751][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=2] - [1667212093.276804][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=3,credentialType=1] - [1667212093.276858][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=3] - [1667212093.276914][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=4,credentialType=1] - [1667212093.276967][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=4] - [1667212093.277020][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=5,credentialType=1] - [1667212093.277073][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=5] - [1667212093.277134][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=6,credentialType=1] - [1667212093.277188][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=6] - [1667212093.277240][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=7,credentialType=1] - [1667212093.277293][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=7] - [1667212093.277354][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=8,credentialType=1] - [1667212093.277407][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=8] - [1667212093.277459][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=9,credentialType=1] - [1667212093.277513][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=9] - [1667212093.277568][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=10,credentialType=1] - [1667212093.277622][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=10] - [1667212093.277702][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667212093.277776][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667212093.277846][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667212093.277902][14571:14571] CHIP:ZCL: [GetCredentialStatus] Prepared credential status [endpointId=1,credentialType=1,credentialIndex=1,userIndex=0,nextCredentialIndex=0] - [1667212093.278006][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667212093.278542][14571:14571] CHIP:EM: <<< [E:30438r M:4480764 (Ack:186848136)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667212093.278641][14571:14571] CHIP:IN: (S) Sending msg 4480764 on secure session with LSID: 42483 - [1667212093.279298][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:57039 | 4480764 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 43119 / Exchange = 30438] - [1667212093.279396][14571:14571] CHIP:DMG: Header Flags = - [1667212093.279453][14571:14571] CHIP:DMG: { - [1667212093.279539][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667212093.279597][14571:14571] CHIP:DMG: { - [1667212093.279656][14571:14571] CHIP:DMG: AckMsg = 186848136 - [1667212093.279712][14571:14571] CHIP:DMG: NeedsAck = true - [1667212093.279767][14571:14571] CHIP:DMG: } - [1667212093.279838][14571:14571] CHIP:DMG: } - [1667212093.279893][14571:14571] CHIP:DMG: - [1667212093.279961][14571:14571] CHIP:DMG: Encrypted Payload (75 bytes) = - [1667212093.280016][14571:14571] CHIP:DMG: { - [1667212093.280070][14571:14571] CHIP:DMG: data = 006fa800fc5e4400c7276ff1d39cf739fa9accc0d3bc9011e5054e3518b94d01735f0b15877dcd655b1cd5c0454c146798aea65ab4ca874add0cd3f7bfae3d8a7a05775dafc0596dd29643 - [1667212093.280128][14571:14571] CHIP:DMG: buffer_ptr = 187651867792640 - [1667212093.280181][14571:14571] CHIP:DMG: } - [1667212093.280233][14571:14571] CHIP:DMG: - [1667212093.280306][14571:14571] CHIP:DMG: Decrypted Payload (41 bytes) = - [1667212093.280362][14571:14571] CHIP:DMG: { - [1667212093.280415][14571:14571] CHIP:DMG: data = 1528003601153500370024000125010101240225183501280034013402340334041818181824ff0118 - [1667212093.280471][14571:14571] CHIP:DMG: } - [1667212093.280524][14571:14571] CHIP:DMG: - [1667212093.280678][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667212093.280741][14571:14571] CHIP:DMG: { - [1667212093.280800][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212093.280862][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667212093.280942][14571:14571] CHIP:DMG: [ - [1667212093.281005][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667212093.281097][14571:14571] CHIP:DMG: { - [1667212093.281168][14571:14571] CHIP:DMG: CommandDataIB = - [1667212093.281255][14571:14571] CHIP:DMG: { - [1667212093.281338][14571:14571] CHIP:DMG: CommandPathIB = - [1667212093.281429][14571:14571] CHIP:DMG: { - [1667212093.281516][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212093.281614][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212093.281710][14571:14571] CHIP:DMG: CommandId = 0x25, - [1667212093.281793][14571:14571] CHIP:DMG: }, - [1667212093.281890][14571:14571] CHIP:DMG: - [1667212093.281976][14571:14571] CHIP:DMG: CommandFields = - [1667212093.282052][14571:14571] CHIP:DMG: { - [1667212093.282145][14571:14571] CHIP:DMG: 0x0 = false, - [1667212093.282228][14571:14571] CHIP:DMG: 0x1 = NULL - [1667212093.282313][14571:14571] CHIP:DMG: 0x2 = NULL - [1667212093.282404][14571:14571] CHIP:DMG: 0x3 = NULL - [1667212093.282570][14571:14571] CHIP:DMG: 0x4 = NULL - [1667212093.282671][14571:14571] CHIP:DMG: }, - [1667212093.282744][14571:14571] CHIP:DMG: }, - [1667212093.282836][14571:14571] CHIP:DMG: - [1667212093.282906][14571:14571] CHIP:DMG: }, - [1667212093.283000][14571:14571] CHIP:DMG: - [1667212093.283057][14571:14571] CHIP:DMG: ], - [1667212093.283138][14571:14571] CHIP:DMG: - [1667212093.283199][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667212093.283264][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock get-credential-status '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Get Credential command response on TH(lock-app) log: + + [1685673421.665556][2664:2666] CHIP:DMG: InvokeResponseMessage = + [1685673421.665610][2664:2666] CHIP:DMG: { + [1685673421.665662][2664:2666] CHIP:DMG: suppressResponse = false, + [1685673421.665720][2664:2666] CHIP:DMG: InvokeResponseIBs = + [1685673421.665921][2664:2666] CHIP:DMG: [ + [1685673421.665982][2664:2666] CHIP:DMG: InvokeResponseIB = + [1685673421.666061][2664:2666] CHIP:DMG: { + [1685673421.666121][2664:2666] CHIP:DMG: CommandDataIB = + [1685673421.666195][2664:2666] CHIP:DMG: { + [1685673421.666261][2664:2666] CHIP:DMG: CommandPathIB = + [1685673421.666335][2664:2666] CHIP:DMG: { + [1685673421.666411][2664:2666] CHIP:DMG: EndpointId = 0x1, + [1685673421.666490][2664:2666] CHIP:DMG: ClusterId = 0x101, + [1685673421.666652][2664:2666] CHIP:DMG: CommandId = 0x25, + [1685673421.666732][2664:2666] CHIP:DMG: }, + [1685673421.666812][2664:2666] CHIP:DMG: + [1685673421.666881][2664:2666] CHIP:DMG: CommandFields = + [1685673421.666961][2664:2666] CHIP:DMG: { + [1685673421.667041][2664:2666] CHIP:DMG: 0x0 = false, + [1685673421.667122][2664:2666] CHIP:DMG: 0x1 = NULL + [1685673421.667203][2664:2666] CHIP:DMG: 0x2 = NULL + [1685673421.667282][2664:2666] CHIP:DMG: 0x3 = NULL + [1685673421.667362][2664:2666] CHIP:DMG: 0x4 = NULL + [1685673421.667439][2664:2666] CHIP:DMG: }, + [1685673421.667509][2664:2666] CHIP:DMG: }, + [1685673421.667590][2664:2666] CHIP:DMG: + [1685673421.667722][2664:2666] CHIP:DMG: }, + [1685673421.667808][2664:2666] CHIP:DMG: + [1685673421.667865][2664:2666] CHIP:DMG: ], + [1685673421.667939][2664:2666] CHIP:DMG: + [1685673421.667995][2664:2666] CHIP:DMG: InteractionModelRevision = 1 + [1685673421.668049][2664:2666] CHIP:DMG: }, disabled: true - - label: "DUT sends Clear Credential command to TH." + - label: "Step 18: DUT sends Clear Credential command to TH." PICS: DRLK.C.F08 && DRLK.C.C26.Tx verification: | - ./chip-tool doorlock clear-credential '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 - Verify the " Clear Credential command response" on TH(lock-app): - - [1667212128.152900][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeba540 exchange 10631r - [1667212128.153426][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667212128.153496][14571:14571] CHIP:DMG: { - [1667212128.153555][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212128.153623][14571:14571] CHIP:DMG: timedRequest = true, - [1667212128.153685][14571:14571] CHIP:DMG: InvokeRequests = - [1667212128.153766][14571:14571] CHIP:DMG: [ - [1667212128.153831][14571:14571] CHIP:DMG: CommandDataIB = - [1667212128.153917][14571:14571] CHIP:DMG: { - [1667212128.153985][14571:14571] CHIP:DMG: CommandPathIB = - [1667212128.154069][14571:14571] CHIP:DMG: { - [1667212128.154154][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212128.154242][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212128.154327][14571:14571] CHIP:DMG: CommandId = 0x26, - [1667212128.154409][14571:14571] CHIP:DMG: }, - [1667212128.154576][14571:14571] CHIP:DMG: - [1667212128.154656][14571:14571] CHIP:DMG: CommandFields = - [1667212128.154738][14571:14571] CHIP:DMG: { - [1667212128.154818][14571:14571] CHIP:DMG: 0x0 = - [1667212128.154905][14571:14571] CHIP:DMG: { - [1667212128.154996][14571:14571] CHIP:DMG: 0x0 = 1, - [1667212128.155088][14571:14571] CHIP:DMG: 0x1 = 1, - [1667212128.155177][14571:14571] CHIP:DMG: }, - [1667212128.155261][14571:14571] CHIP:DMG: }, - [1667212128.155338][14571:14571] CHIP:DMG: }, - [1667212128.155492][14571:14571] CHIP:DMG: - [1667212128.155564][14571:14571] CHIP:DMG: ], - [1667212128.155646][14571:14571] CHIP:DMG: - [1667212128.155707][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667212128.155774][14571:14571] CHIP:DMG: }, - [1667212128.155932][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667212128.156015][14571:14571] CHIP:DMG: AccessControl: allowed - [1667212128.156085][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_0026 - [1667212128.156175][14571:14571] CHIP:ZCL: [ClearCredential] Incoming command [endpointId=1] - [1667212128.156257][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetCredential [endpoint=1,credentialIndex=1,credentialType=1] - [1667212128.156317][14571:14571] CHIP:ZCL: Found unoccupied credential [endpoint=1,index=1] - [1667212128.156371][14571:14571] CHIP:ZCL: [clearCredential] Ignored attempt to clear unoccupied credential slot [endpointId=1,credentialType=1,credentialIndex=1,modifier=1] - [1667212128.156461][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667212128.156535][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667212128.156602][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667212128.156701][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667212128.157316][14571:14571] CHIP:EM: <<< [E:10631r M:11930538 (Ack:156691987)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667212128.157439][14571:14571] CHIP:IN: (S) Sending msg 11930538 on secure session with LSID: 42484 - [1667212128.158170][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:51286 | 11930538 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 58469 / Exchange = 10631] - [1667212128.158376][14571:14571] CHIP:DMG: Header Flags = - [1667212128.158437][14571:14571] CHIP:DMG: { - [1667212128.158576][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667212128.158638][14571:14571] CHIP:DMG: { - [1667212128.158701][14571:14571] CHIP:DMG: AckMsg = 156691987 - [1667212128.158757][14571:14571] CHIP:DMG: NeedsAck = true - [1667212128.158812][14571:14571] CHIP:DMG: } - [1667212128.158884][14571:14571] CHIP:DMG: } - [1667212128.158940][14571:14571] CHIP:DMG: - [1667212128.159012][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667212128.159071][14571:14571] CHIP:DMG: { - [1667212128.159126][14571:14571] CHIP:DMG: data = 0065e400aa0bb600767167666da8a4704228550333f05c7a6a317f168837b8fc5c23819459344b754fdb12d3ada5c7097bff508204cf3aed1e536c476de369050ec614be - [1667212128.159185][14571:14571] CHIP:DMG: buffer_ptr = 187651867793280 - [1667212128.159239][14571:14571] CHIP:DMG: } - [1667212128.159291][14571:14571] CHIP:DMG: - [1667212128.159368][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667212128.159426][14571:14571] CHIP:DMG: { - [1667212128.159481][14571:14571] CHIP:DMG: data = 15280036011535013700240001250101012402261835012400001818181824ff0118 - [1667212128.159537][14571:14571] CHIP:DMG: } - [1667212128.159589][14571:14571] CHIP:DMG: - [1667212128.159731][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667212128.159796][14571:14571] CHIP:DMG: { - [1667212128.159855][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212128.159919][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667212128.159997][14571:14571] CHIP:DMG: [ - [1667212128.160061][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667212128.160157][14571:14571] CHIP:DMG: { - [1667212128.160224][14571:14571] CHIP:DMG: CommandStatusIB = - [1667212128.160307][14571:14571] CHIP:DMG: { - [1667212128.160384][14571:14571] CHIP:DMG: CommandPathIB = - [1667212128.160473][14571:14571] CHIP:DMG: { - [1667212128.160561][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212128.160652][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212128.160742][14571:14571] CHIP:DMG: CommandId = 0x26, - [1667212128.160827][14571:14571] CHIP:DMG: }, - [1667212128.160923][14571:14571] CHIP:DMG: - [1667212128.161002][14571:14571] CHIP:DMG: StatusIB = - [1667212128.161088][14571:14571] CHIP:DMG: { - [1667212128.161177][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667212128.161261][14571:14571] CHIP:DMG: }, - [1667212128.161347][14571:14571] CHIP:DMG: - [1667212128.161425][14571:14571] CHIP:DMG: }, - [1667212128.161512][14571:14571] CHIP:DMG: - [1667212128.161585][14571:14571] CHIP:DMG: }, - [1667212128.161672][14571:14571] CHIP:DMG: - disabled: true - - - label: "Cleanup the created user" - verification: | - ./chip-tool doorlock clear-user 1 1 1 --timedInteractionTimeoutMs 1000 - - Verify the " clear-user command response" on TH(lock-app): - - [1667212166.155071][14571:14571] CHIP:DMG: Handing timed invoke to IM engine: handler 0xaaab1aeb8b90 exchange 25089r - [1667212166.155183][14571:14571] CHIP:DMG: InvokeRequestMessage = - [1667212166.155247][14571:14571] CHIP:DMG: { - [1667212166.155305][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212166.155373][14571:14571] CHIP:DMG: timedRequest = true, - [1667212166.155512][14571:14571] CHIP:DMG: InvokeRequests = - [1667212166.155597][14571:14571] CHIP:DMG: [ - [1667212166.155661][14571:14571] CHIP:DMG: CommandDataIB = - [1667212166.155746][14571:14571] CHIP:DMG: { - [1667212166.155813][14571:14571] CHIP:DMG: CommandPathIB = - [1667212166.155897][14571:14571] CHIP:DMG: { - [1667212166.155980][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212166.156069][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212166.156157][14571:14571] CHIP:DMG: CommandId = 0x1d, - [1667212166.156239][14571:14571] CHIP:DMG: }, - [1667212166.156325][14571:14571] CHIP:DMG: - [1667212166.156448][14571:14571] CHIP:DMG: CommandFields = - [1667212166.156540][14571:14571] CHIP:DMG: { - [1667212166.156625][14571:14571] CHIP:DMG: 0x0 = 1, - [1667212166.156711][14571:14571] CHIP:DMG: }, - [1667212166.156788][14571:14571] CHIP:DMG: }, - [1667212166.156866][14571:14571] CHIP:DMG: - [1667212166.156995][14571:14571] CHIP:DMG: ], - [1667212166.157080][14571:14571] CHIP:DMG: - [1667212166.157143][14571:14571] CHIP:DMG: InteractionModelRevision = 1 - [1667212166.157249][14571:14571] CHIP:DMG: }, - [1667212166.157405][14571:14571] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_0101 e=1 p=a - [1667212166.157487][14571:14571] CHIP:DMG: AccessControl: allowed - [1667212166.157557][14571:14571] CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0101 Command=0x0000_001D - [1667212166.157635][14571:14571] CHIP:ZCL: [ClearUser] Incoming command [endpointId=1,userIndex=1] - [1667212166.157726][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::GetUser [endpoint=1,userIndex=1] - [1667212166.157786][14571:14571] CHIP:ZCL: Found occupied user [endpoint=1,adjustedIndex=0,name="xxx",credentialsCount=0,uniqueId=1934,type=0,credentialRule=0,createdBy=1,lastModifiedBy=1] - [1667212166.157877][14571:14571] CHIP:ZCL: Lock App: LockEndpoint::SetUser [endpoint=1,userIndex=1,creator=0,modifier=0,userName="",uniqueId=0,userStatus=0,userType=0,credentialRule=0,credentials=(nil),totalCredentials=0] - [1667212166.157944][14571:14571] CHIP:ZCL: Successfully set the user [mEndpointId=1,index=1,adjustedIndex=0] - [1667212166.158208][14571:14571] CHIP:EVL: Copy Event to next buffer with priority 1 - [1667212166.158421][14571:14571] CHIP:EVL: LogEvent event number: 0x0000000000000010 priority: 1, endpoint id: 0x1 cluster id: 0x0000_0101 event id: 0x4 Sys timestamp: 0x00000000012F4FC7 - [1667212166.158618][14571:14571] CHIP:ZCL: [RemoteLockUserChange] Sent lock user change event [endpointId=1,eventNumber=16,dataType=2,operation=1,nodeId=112233,fabricIndex=1] - [1667212166.158712][14571:14571] CHIP:DMG: Command handler moving to [ Preparing] - [1667212166.158784][14571:14571] CHIP:DMG: Command handler moving to [AddingComm] - [1667212166.158850][14571:14571] CHIP:DMG: Command handler moving to [AddedComma] - [1667212166.159031][14571:14571] CHIP:DMG: Decreasing reference count for CommandHandler, remaining 0 - [1667212166.159655][14571:14571] CHIP:EM: <<< [E:25089r M:67040752 (Ack:148378984)] (S) Msg TX to 1:000000000001B669 [673E] --- Type 0001:09 (IM:InvokeCommandResponse) - [1667212166.159768][14571:14571] CHIP:IN: (S) Sending msg 67040752 on secure session with LSID: 42485 - [1667212166.160473][14571:14571] CHIP:DMG: >> to UDP:[fe80::e65f:1ff:fe0e:be37%eth0]:39640 | 67040752 | [Interaction Model (1) / InvokeCommandResponse (0x09) / Session = 23540 / Exchange = 25089] - [1667212166.160580][14571:14571] CHIP:DMG: Header Flags = - [1667212166.160638][14571:14571] CHIP:DMG: { - [1667212166.160724][14571:14571] CHIP:DMG: Exchange (0x06) = - [1667212166.160782][14571:14571] CHIP:DMG: { - [1667212166.160843][14571:14571] CHIP:DMG: AckMsg = 148378984 - [1667212166.160900][14571:14571] CHIP:DMG: NeedsAck = true - [1667212166.160954][14571:14571] CHIP:DMG: } - [1667212166.161026][14571:14571] CHIP:DMG: } - [1667212166.161081][14571:14571] CHIP:DMG: - [1667212166.161152][14571:14571] CHIP:DMG: Encrypted Payload (68 bytes) = - [1667212166.161208][14571:14571] CHIP:DMG: { - [1667212166.161263][14571:14571] CHIP:DMG: data = 00f45b00f0f5fe03cc9397f24c1d44b4ea110e128f8da000ebf4424aacf7a81440f5ba6e03e782be642b469ae0e7c01b2f40419057a024ff2a28f74cddb9d23d0977b0d1 - [1667212166.161322][14571:14571] CHIP:DMG: buffer_ptr = 187651867794208 - [1667212166.161376][14571:14571] CHIP:DMG: } - [1667212166.161428][14571:14571] CHIP:DMG: - [1667212166.161504][14571:14571] CHIP:DMG: Decrypted Payload (34 bytes) = - [1667212166.161560][14571:14571] CHIP:DMG: { - [1667212166.161614][14571:14571] CHIP:DMG: data = 152800360115350137002400012501010124021d1835012400001818181824ff0118 - [1667212166.161670][14571:14571] CHIP:DMG: } - [1667212166.161723][14571:14571] CHIP:DMG: - [1667212166.161860][14571:14571] CHIP:DMG: InvokeResponseMessage = - [1667212166.161924][14571:14571] CHIP:DMG: { - [1667212166.161983][14571:14571] CHIP:DMG: suppressResponse = false, - [1667212166.162059][14571:14571] CHIP:DMG: InvokeResponseIBs = - [1667212166.162138][14571:14571] CHIP:DMG: [ - [1667212166.162210][14571:14571] CHIP:DMG: InvokeResponseIB = - [1667212166.162303][14571:14571] CHIP:DMG: { - [1667212166.162379][14571:14571] CHIP:DMG: CommandStatusIB = - [1667212166.162506][14571:14571] CHIP:DMG: { - [1667212166.162587][14571:14571] CHIP:DMG: CommandPathIB = - [1667212166.162675][14571:14571] CHIP:DMG: { - [1667212166.162765][14571:14571] CHIP:DMG: EndpointId = 0x1, - [1667212166.162856][14571:14571] CHIP:DMG: ClusterId = 0x101, - [1667212166.162947][14571:14571] CHIP:DMG: CommandId = 0x1d, - [1667212166.163032][14571:14571] CHIP:DMG: }, - [1667212166.163130][14571:14571] CHIP:DMG: - [1667212166.163208][14571:14571] CHIP:DMG: StatusIB = - [1667212166.163296][14571:14571] CHIP:DMG: { - [1667212166.163383][14571:14571] CHIP:DMG: status = 0x00 (SUCCESS), - [1667212166.163471][14571:14571] CHIP:DMG: }, - [1667212166.163558][14571:14571] CHIP:DMG: - [1667212166.163721][14571:14571] CHIP:DMG: }, + ./chip-tool doorlock clear-credential '{ "credentialType" : 1 , "credentialIndex" : 1 }' 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Clear Credential command with SUCCESS response on TH(lock-app) log: + + [1685673444.692000][2668:2670] CHIP:DMG: InvokeResponseMessage = + [1685673444.692055][2668:2670] CHIP:DMG: { + [1685673444.692109][2668:2670] CHIP:DMG: suppressResponse = false, + [1685673444.692164][2668:2670] CHIP:DMG: InvokeResponseIBs = + [1685673444.692235][2668:2670] CHIP:DMG: [ + [1685673444.692292][2668:2670] CHIP:DMG: InvokeResponseIB = + [1685673444.692368][2668:2670] CHIP:DMG: { + [1685673444.692429][2668:2670] CHIP:DMG: CommandStatusIB = + [1685673444.692518][2668:2670] CHIP:DMG: { + [1685673444.692597][2668:2670] CHIP:DMG: CommandPathIB = + [1685673444.692691][2668:2670] CHIP:DMG: { + [1685673444.692783][2668:2670] CHIP:DMG: EndpointId = 0x1, + [1685673444.692879][2668:2670] CHIP:DMG: ClusterId = 0x101, + [1685673444.692974][2668:2670] CHIP:DMG: CommandId = 0x26, + [1685673444.693065][2668:2670] CHIP:DMG: }, + [1685673444.693164][2668:2670] CHIP:DMG: + [1685673444.693239][2668:2670] CHIP:DMG: StatusIB = + [1685673444.693330][2668:2670] CHIP:DMG: { + [1685673444.693517][2668:2670] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673444.693608][2668:2670] CHIP:DMG: }, + [1685673444.693700][2668:2670] CHIP:DMG: + [1685673444.693934][2668:2670] CHIP:DMG: }, + [1685673444.694029][2668:2670] CHIP:DMG: + [1685673444.694099][2668:2670] CHIP:DMG: }, + [1685673444.694183][2668:2670] CHIP:DMG: + [1685673444.694241][2668:2670] CHIP:DMG: ], + [1685673444.694410][2668:2670] CHIP:DMG: + [1685673444.694467][2668:2670] CHIP:DMG: InteractionModelRevision = 1 + [1685673444.694522][2668:2670] CHIP:DMG: }, + + + ./chip-tool doorlock clear-user 1 1 1 --timedInteractionTimeoutMs 1000 --trace_decode 1 + + Verify TH receives Clear User command with SUCCESS response on TH(lock-app) log: + + [1685673467.295855][2674:2676] CHIP:DMG: InvokeResponseMessage = + [1685673467.295906][2674:2676] CHIP:DMG: { + [1685673467.295986][2674:2676] CHIP:DMG: suppressResponse = false, + [1685673467.296044][2674:2676] CHIP:DMG: InvokeResponseIBs = + [1685673467.296116][2674:2676] CHIP:DMG: [ + [1685673467.296194][2674:2676] CHIP:DMG: InvokeResponseIB = + [1685673467.296271][2674:2676] CHIP:DMG: { + [1685673467.296361][2674:2676] CHIP:DMG: CommandStatusIB = + [1685673467.296432][2674:2676] CHIP:DMG: { + [1685673467.296519][2674:2676] CHIP:DMG: CommandPathIB = + [1685673467.296595][2674:2676] CHIP:DMG: { + [1685673467.296692][2674:2676] CHIP:DMG: EndpointId = 0x1, + [1685673467.296772][2674:2676] CHIP:DMG: ClusterId = 0x101, + [1685673467.296872][2674:2676] CHIP:DMG: CommandId = 0x1d, + [1685673467.296947][2674:2676] CHIP:DMG: }, + [1685673467.297053][2674:2676] CHIP:DMG: + [1685673467.297121][2674:2676] CHIP:DMG: StatusIB = + [1685673467.297217][2674:2676] CHIP:DMG: { + [1685673467.297295][2674:2676] CHIP:DMG: status = 0x00 (SUCCESS), + [1685673467.297392][2674:2676] CHIP:DMG: }, + [1685673467.297468][2674:2676] CHIP:DMG: + [1685673467.297554][2674:2676] CHIP:DMG: }, + [1685673467.297632][2674:2676] CHIP:DMG: + [1685673467.297692][2674:2676] CHIP:DMG: }, + [1685673467.297836][2674:2676] CHIP:DMG: + [1685673467.297895][2674:2676] CHIP:DMG: ], + [1685673467.297997][2674:2676] CHIP:DMG: + [1685673467.298055][2674:2676] CHIP:DMG: InteractionModelRevision = 1 + [1685673467.298109][2674:2676] CHIP:DMG: }, disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml index 2dc8dbd544b233..fff517643af102 100644 --- a/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_5_4.yaml @@ -33,12 +33,12 @@ tests: fields to the corresponding values. Values given below are for reference purpose. groupKeySetID: 0x01a3 groupKeySecurityPolicy: CacheAndSync (1) epochKey0: d0d1d2d3d4d5d6d7d8d9dadbdcdddedf - epochStartTime0: 0 epochKey1: d1d1d2d3d4d5d6d7d8d9dadbdcdddedf + epochStartTime0: 1 epochKey1: d1d1d2d3d4d5d6d7d8d9dadbdcdddedf epochStartTime1: 2220001 epochKey2: d2d1d2d3d4d5d6d7d8d9dadbdcdddedf epochStartTime2: 2220002" PICS: "!GRPKEY.S.F00 && GRPKEY.S.C00.Rsp " verification: | - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, "groupKeySecurityPolicy": 1, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 0, "epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": "0x01a3", "groupKeySecurityPolicy": 1, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1, "epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 Verify DUT sends INVALID_COMMAND response on TH(chip-tool) Logs: diff --git a/src/app/tests/suites/certification/Test_TC_G_2_2.yaml b/src/app/tests/suites/certification/Test_TC_G_2_2.yaml index f2f708f273f8d0..a3c8a70e81316a 100644 --- a/src/app/tests/suites/certification/Test_TC_G_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_2_2.yaml @@ -36,9 +36,9 @@ tests: Verify for the "MaxGroupsPerFabric" value on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: - [1683802556.948465][41067:41069] CHIP:DMG: } - [1683802556.948507][41067:41069] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0002 DataVersion: 1698601848 - [1683802556.948520][41067:41069] CHIP:TOO: MaxGroupsPerFabric: 12 + [1683797307.084182][38841:38843] CHIP:DMG: } + [1683797307.084220][38841:38843] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003F Attribute 0x0000_0002 DataVersion: 366443848 + [1683797307.084237][38841:38843] CHIP:TOO: MaxGroupsPerFabric: 12 Note: MaxGroupsPerFabric has a value 12 on TH log. It can be any value between [min=4, max=65535]. disabled: true @@ -52,8 +52,8 @@ tests: 0d1d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime1: 2220001 EpochKey2: 0d2d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime2: 2220002" verification: | - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1, "groupKeySecurityPolicy": 0, "epochKey0": "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": - "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 18446744073709551613,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 18446744073709551614 }' 1 0 + Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: diff --git a/src/app/tests/suites/certification/Test_TC_G_2_3.yaml b/src/app/tests/suites/certification/Test_TC_G_2_3.yaml index c4a35cad32dad2..d0810179e9bcf5 100644 --- a/src/app/tests/suites/certification/Test_TC_G_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_2_3.yaml @@ -52,10 +52,8 @@ tests: d1d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime1: 2220001 EpochKey2: d2d1d2d3d4d5d6d7d8d9dadbdcdddedf EpochStartTime2: 2220002" verification: | - ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1, "groupKeySecurityPolicy": 0, "epochKey0": - "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": - "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": - "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 + ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1,"groupKeySecurityPolicy": 0, "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1":"d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 18446744073709551613,"epochKey2":"d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 18446744073709551614 }' 1 0 + Verify DUT responds with SUCCESS status response on the TH(Chip-tool) Log and below is the sample log provided for the raspi platform: diff --git a/src/app/tests/suites/certification/Test_TC_G_3_2.yaml b/src/app/tests/suites/certification/Test_TC_G_3_2.yaml index 7c0428940d7992..7f718a160bb9a0 100644 --- a/src/app/tests/suites/certification/Test_TC_G_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_G_3_2.yaml @@ -41,7 +41,7 @@ tests: Group Key Management cluster with the following fields set in the GroupKeySet struct:GroupKeySetId is 1,EpochKey0 is epoch_key_set0_epoch0,GroupKeySecurityPolicy = TrustFirst - (1),GroupKeyMulticastPolicy = PerGroupID (0),EpochStartTime0 = 0,TH + (0),GroupKeyMulticastPolicy = PerGroupID (0),EpochStartTime0 = 1,TH binds GroupId with GroupKeySetID in the GroupKeyMap attribute list on GroupKeyManagement cluster with the values provided in the above steps" verification: | @@ -49,7 +49,7 @@ tests: ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 1, "groupKeySecurityPolicy": 0, "epochKey0": - "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 @@ -79,7 +79,7 @@ tests: [1686908179.975512][16775:16775] CHIP:DMG: 0x2 = [ [1686908179.975535][16775:16775] CHIP:DMG: 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, [1686908179.975553][16775:16775] CHIP:DMG: ] (16 bytes) - [1686908179.975572][16775:16775] CHIP:DMG: 0x3 = 2220000, + [1686908179.975572][16775:16775] CHIP:DMG: 0x3 = 1, [1686908179.975586][16775:16775] CHIP:DMG: 0x4 = [ [1686908179.975613][16775:16775] CHIP:DMG: 0xd1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, [1686908179.975635][16775:16775] CHIP:DMG: ] (16 bytes) diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_2_2.yaml index 5b78ee21ece4ea..c23b7fae1ea6c1 100644 --- a/src/app/tests/suites/certification/Test_TC_ICDM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ICDM_2_2.yaml @@ -26,6 +26,14 @@ config: endpoint: 0 tests: + - label: "Precondition" + verification: | + Commission DUT to TH (can be skipped if done in a preceding test). + TH reads from the DUT the RegisteredClients attribute. + If list of registered clients is not empty, unregister existing clients + TH reads from the DUT the RegisteredClients attribute. Verify that the DUT response contains empty list of registered clients. + disabled: true + - label: "Step 1: TH sends RegisterClient command. - CheckInNodeID: registering clients node ID - MonitoredSubject: monitored subject ID - Key: shared diff --git a/src/app/tests/suites/certification/Test_TC_ICDM_2_3.yaml b/src/app/tests/suites/certification/Test_TC_ICDM_2_3.yaml index da710759d2c7ee..eed0da861284fa 100644 --- a/src/app/tests/suites/certification/Test_TC_ICDM_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_ICDM_2_3.yaml @@ -22,7 +22,7 @@ PICS: - ICDM.S.C03.Rsp config: - nodeId: "0x12344321" + nodeId: 0x12344321 cluster: "Basic Information" endpoint: 0 @@ -30,7 +30,13 @@ tests: - label: "Step 1: TH reads from the DUT the ActiveModeThreshold attribute." PICS: ICDM.S.A0002 verification: | - Verify that the DUT response contains an uint16; value is 300 or higher + ./chip-tool icdmanagement read active-mode-threshold 1 0 + + On TH(chip-tool) log, Verify ActiveModeThreshold attribute should contains an uint16; value is 300 or higher below is the sample log provided for the raspi platform: + + + [1685127625953] [48160:461013] [TOO] Endpoint: 0 Cluster: 0x0000_0046 Attribute 0x0000_0002 DataVersion: 326159709 + [1685127625953] [48160:461013] [TOO] ActiveModeThreshold: 300 disabled: true - label: "Step 2: TH sends StayActiveRequest command." @@ -44,5 +50,5 @@ tests: ActiveModeThreshold" PICS: ICDM.S.C03.Rsp verification: | - Verify DUT increases the remaining time in active mode by one ActiveModeThreshold + Design details pending. disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml index 2a32e97e4872e0..e551005ca6ff93 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_4_2.yaml @@ -38,7 +38,7 @@ tests: Here the command to enter interactive mode:-- ./chip-tool interactive start disabled: true - - label: "Step 0a: " + - label: "Step 0a: SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT = 60 mins" PICS: " !ICDM.S " verification: | When the ICDM feature is not supported or enabled, the SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT is set to 60 minutes. @@ -71,45 +71,44 @@ tests: verification: | Please run the following command on the TH to test the subscription feature and verify that the value of MaxIntervalCeiling is set correctly(set the value greater than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT) - onoff subscribe on-off 100 600 1 1 --keepSubscriptions true + onoff subscribe on-off 100 600 1 1 --keepSubscriptions true - On the CR1( chip-tool), verify a report data message is received and verify it contains the following data : + On the CR1( chip-tool), verify a report data message is received and verify it contains the following data : 1. Verify Report Data Message Received: - Check if a report data message is received on the CR1. + Check if a report data message is received on the CR1. 2. Verify Report Data Contents: - Confirm that the received report data message contains the data of the attribute/event that was previously requested. + Confirm that the received report data message contains the data of the attribute/event that was previously requested. 3. Verify Subscribe Response Fields: - Examine the Subscribe Response to ensure it includes the following fields: - SubscriptionId: Verify that it is of type uint32. - Verify MaxInterval Field: + Examine the Subscribe Response to ensure it includes the following fields: + SubscriptionId: Verify that it is of type uint32. + Verify MaxInterval Field: 4. Check for an additional field in the Subscribe Response: - MaxInterval: Verify that it is of type uint32. + MaxInterval: Verify that it is of type uint32. 5. Verify MaxInterval against MaxIntervalCeiling: - Compare the MaxInterval value received in the Subscribe Response to the MaxIntervalCeiling value to verify that MaxInterval is less than or equal to MaxIntervalCeiling. - - [1690475115.797447][5694:5696] CHIP:DMG: InteractionModelRevision = 1 - [1690475115.797452][5694:5696] CHIP:DMG: } - [1690475115.797536][5694:5696] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 2332229409 - [1690475115.797556][5694:5696] CHIP:TOO: OnOff: FALSE - [1690475115.797577][5694:5696] CHIP:DMG: MoveToState ReadClient[0x7fd84800fb20]: Moving to [AwaitingSu] - [1690475115.797625][5694:5696] CHIP:EM: <<< [E:36539i S:55497 M:232793668 (Ack:16536682)] (S) Msg TX to 1:0000000000000001 [3C19] --- Type 0001:01 (IM:StatusResponse) - [1690475115.797638][5694:5696] CHIP:IN: (S) Sending msg 232793668 on secure session with LSID: 55497 - [1690475115.798143][5694:5696] CHIP:EM: >>> [E:36539i S:55497 M:16536683 (Ack:232793668)] (S) Msg RX from 1:0000000000000001 [3C19] --- Type 0001:04 (IM:SubscribeResponse) - [1690475115.798165][5694:5696] CHIP:EM: Found matching exchange: 36539i, Delegate: 0x7fd84800fb30 - [1690475115.798179][5694:5696] CHIP:EM: Rxd Ack; Removing MessageCounter:232793668 from Retrans Table on exchange 36539i - [1690475115.798192][5694:5696] CHIP:DMG: SubscribeResponse is received - [1690475115.798206][5694:5696] CHIP:DMG: SubscribeResponseMessage = - [1690475115.798213][5694:5696] CHIP:DMG: { - [1690475115.798220][5694:5696] CHIP:DMG: SubscriptionId = 0x9b87e9c7, - [1690475115.798226][5694:5696] CHIP:DMG: MaxInterval = 0x258, - [1690475115.798232][5694:5696] CHIP:DMG: InteractionModelRevision = 1 - [1690475115.798238][5694:5696] CHIP:DMG: } - [1690475115.798247][5694:5696] CHIP:DMG: Subscription established with SubscriptionID = 0x9b87e9c7 MinInterval = 100s MaxInterval = 600s Peer = 01:0000000000000001 - [1690475115.798256][5694:5696] CHIP:DMG: MoveToState ReadClient[0x7fd84800fb20]: Moving to [Subscripti] + Compare the MaxInterval value received in the Subscribe Response to the MaxIntervalCeiling value to verify that MaxInterval is less than or equal to MaxIntervalCeiling. + + [1693221742.765461][22261:22263] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 523169586 + [1693221742.765473][22261:22263] CHIP:TOO: OnOff: FALSE + [1693221742.765495][22261:22263] CHIP:DMG: MoveToState ReadClient[0x7f6070027e40]: Moving to [AwaitingSu] + [1693221742.765530][22261:22263] CHIP:EM: <<< [E:26388i S:13043 M:192043500 (Ack:11734613)] (S) Msg TX to 1:0000000000000001 [3DC0] --- Type 0001:01 (IM:StatusResponse) + [1693221742.765542][22261:22263] CHIP:IN: (S) Sending msg 192043500 on secure session with LSID: 13043 + [1693221742.765587][22261:22263] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1693221742.765594][22261:22263] CHIP:DL: HandlePlatformSpecificBLEEvent 32793 + [1693221742.765981][22261:22263] CHIP:EM: >>> [E:26388i S:13043 M:11734614 (Ack:192043500)] (S) Msg RX from 1:0000000000000001 [3DC0] --- Type 0001:04 (IM:SubscribeResponse) + [1693221742.765991][22261:22263] CHIP:EM: Found matching exchange: 26388i, Delegate: 0x7f6070027e50 + [1693221742.766002][22261:22263] CHIP:EM: Rxd Ack; Removing MessageCounter:192043500 from Retrans Table on exchange 26388i + [1693221742.766012][22261:22263] CHIP:DMG: SubscribeResponse is received + [1693221742.766025][22261:22263] CHIP:DMG: SubscribeResponseMessage = + [1693221742.766031][22261:22263] CHIP:DMG: { + [1693221742.766038][22261:22263] CHIP:DMG: SubscriptionId = 0x15e2f82f, + [1693221742.766045][22261:22263] CHIP:DMG: MaxInterval = 0x64, + [1693221742.766051][22261:22263] CHIP:DMG: InteractionModelRevision = 10 + [1693221742.766057][22261:22263] CHIP:DMG: } + [1693221742.766068][22261:22263] CHIP:DMG: Subscription established with SubscriptionID = 0x15e2f82f MinInterval = 100s MaxInterval = 100s Peer = 01:0000000000000001 disabled: true - label: @@ -120,47 +119,92 @@ tests: sends a Subscribe Response Message to the CR1 to activate the subscription." verification: | - Please run the following command on the TH to test the subscription feature and verify that the value of MaxIntervalCeiling is set correctly( set the value less than SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT) + To ensure that CR1 and CR2 are on the same fabric and that CR1 grants access to CR2, Please send the below mentioned command, it will configure TH2 without access to a specific cluster, we send the ACL command, allowing access only to the Level Control cluster (cluster ID: 8); any attempts to subscribe to or use commands from other clusters will result in a status of 'INVALID_ACTION + + accesscontrol write acl '[{"privilege":5, "authMode":2, "subjects":[112233], "targets":null, "fabricIndex": 1},{"privilege":3, "authMode":2, "subjects":[4], "targets":[{"cluster":8, "endpoint":null, "deviceType":null}]}]' 1 0 + [1689933254.566655][48781:48783] CHIP:EM: Rxd Ack; Removing MessageCounter:156974239 from Retrans Table on exchange 6316i + [1689933254.566660][48781:48783] CHIP:DMG: WriteClient moving to [ResponseRe] + [1689933254.566671][48781:48783] CHIP:DMG: WriteResponseMessage = + [1689933254.566675][48781:48783] CHIP:DMG: { + [1689933254.566677][48781:48783] CHIP:DMG: AttributeStatusIBs = + [1689933254.566682][48781:48783] CHIP:DMG: [ + [1689933254.566684][48781:48783] CHIP:DMG: AttributeStatusIB = + [1689933254.566688][48781:48783] CHIP:DMG: { + [1689933254.566691][48781:48783] CHIP:DMG: AttributePathIB = + [1689933254.566695][48781:48783] CHIP:DMG: { + [1689933254.566698][48781:48783] CHIP:DMG: Endpoint = 0x0, + [1689933254.566702][48781:48783] CHIP:DMG: Cluster = 0x1f, + [1689933254.566705][48781:48783] CHIP:DMG: Attribute = 0x0000_0000, + [1689933254.566708][48781:48783] CHIP:DMG: } + [1689933254.566713][48781:48783] CHIP:DMG: + [1689933254.566716][48781:48783] CHIP:DMG: StatusIB = + [1689933254.566720][48781:48783] CHIP:DMG: { + [1689933254.566723][48781:48783] CHIP:DMG: status = 0x00 (SUCCESS), + [1689933254.566726][48781:48783] CHIP:DMG: }, + [1689933254.566730][48781:48783] CHIP:DMG: + [1689933254.566732][48781:48783] CHIP:DMG: }, + [1689933254.566739][48781:48783] CHIP:DMG: + [1689933254.566741][48781:48783] CHIP:DMG: AttributeStatusIB = + [1689933254.566744][48781:48783] CHIP:DMG: { + [1689933254.566747][48781:48783] CHIP:DMG: AttributePathIB = + [1689933254.566750][48781:48783] CHIP:DMG: { + [1689933254.566752][48781:48783] CHIP:DMG: Endpoint = 0x0, + [1689933254.566756][48781:48783] CHIP:DMG: Cluster = 0x1f, + [1689933254.566760][48781:48783] CHIP:DMG: Attribute = 0x0000_0000, + [1689933254.566763][48781:48783] CHIP:DMG: ListIndex = Null, + [1689933254.566766][48781:48783] CHIP:DMG: } + [1689933254.566770][48781:48783] CHIP:DMG: + [1689933254.566773][48781:48783] CHIP:DMG: StatusIB = + [1689933254.566776][48781:48783] CHIP:DMG: { + [1689933254.566779][48781:48783] CHIP:DMG: status = 0x00 (SUCCESS), + [1689933254.566782][48781:48783] CHIP:DMG: }, + [1689933254.566786][48781:48783] CHIP:DMG: + [1689933254.566789][48781:48783] CHIP:DMG: }, + [1689933254.566794][48781:48783] CHIP:DMG: + [1689933254.566797][48781:48783] CHIP:DMG: AttributeStatusIB = + [1689933254.566800][48781:48783] CHIP:DMG: { + [1689933254.566802][48781:48783] CHIP:DMG: AttributePathIB = + [1689933254.566805][48781:48783] CHIP:DMG: { + [1689933254.566808][48781:48783] CHIP:DMG: Endpoint = 0x0, + [1689933254.566811][48781:48783] CHIP:DMG: Cluster = 0x1f, + [1689933254.566815][48781:48783] CHIP:DMG: Attribute = 0x0000_0000, + [1689933254.566818][48781:48783] CHIP:DMG: ListIndex = Null, + [1689933254.566821][48781:48783] CHIP:DMG: } + [1689933254.566825][48781:48783] CHIP:DMG: + [1689933254.566828][48781:48783] CHIP:DMG: StatusIB = + [1689933254.566831][48781:48783] CHIP:DMG: { + [1689933254.566834][48781:48783] CHIP:DMG: status = 0x00 (SUCCESS), + [1689933254.566837][48781:48783] CHIP:DMG: }, + [1689933254.566840][48781:48783] CHIP:DMG: + [1689933254.566843][48781:48783] CHIP:DMG: }, + [1689933254.566847][48781:48783] CHIP:DMG: + [1689933254.566849][48781:48783] CHIP:DMG: ], + [1689933254.566857][48781:48783] CHIP:DMG: + [1689933254.566859][48781:48783] CHIP:DMG: InteractionModelRevision = 1 + [1689933254.566862][48781:48783] CHIP:DMG: } + [1689933254.566897][48781:48783] CHIP:DMG: WriteClient moving to [AwaitingDe] + [1689933254.566916][48781:48783] CHIP:EM: <<< [E:6316i S:13964 M:156974240 (Ack:46397313)] (S) Msg TX to 1:0000000000000001 [B15F] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689933254.566922][48781:48783] CHIP:IN: (S) Sending msg 156974240 on secure session with LSID: 13964 - basicinformation subscribe location 10 400 1 0 --keepSubscriptions true + If CR2 attempts to subscribe to an attribute on a cluster (ClusterID) for which it does not have access, the AttributePath used for the subscription would be in the form [[Attribute = AttributeName, Cluster = ClusterID, Endpoint = EndpointID]], but this action will be denied, and CR2 will not be able to access the attribute due to the restricted access. - On the CR1(chip-tool), verify a report data message is received and verify it contains the following data : - 1. Verify Report Data Message Received: - Check if a report data message is received on the CR1 (target hardware). + below provided the example command used to subscribe location attribute from basicinformation cluster from node id(4) that have access to the “levelcontrol” cluster - 2. Verify Report Data Contents: - Confirm that the received report data message contains the data of the attribute/event that was previously requested. + basicinformation subscribe location 10 2400 1 0 --commissioner-nodeid 4 + [1689933387.304826][48781:48783] CHIP:EM: Rxd Ack; Removing MessageCounter:42350588 from Retrans Table on exchange 6319i + [1689933387.304834][48781:48783] CHIP:DMG: StatusResponseMessage = + [1689933387.304838][48781:48783] CHIP:DMG: { + [1689933387.304841][48781:48783] CHIP:DMG: Status = 0x80 (INVALID_ACTION), + [1689933387.304845][48781:48783] CHIP:DMG: InteractionModelRevision = 1 + [1689933387.304846][48781:48783] CHIP:DMG: } + [1689933387.304850][48781:48783] CHIP:IM: Received status response, status is 0x80 (INVALID_ACTION) + [1689933387.304864][48781:48783] CHIP:EM: <<< [E:6319i S:13965 M:42350589 (Ack:227168589)] (S) Msg TX to 2:0000000000000001 [B15F] --- Type 0001:01 (IM:StatusResponse) + [1689933387.304869][48781:48783] CHIP:IN: (S) Sending msg 42350589 on secure session with LSID: 13965 + [1689933387.304882][48781:48783] CHIP:DMG: MoveToState ReadClient[0x7fd404019110]: Moving to [ Idle] - 3. Verify Subscribe Response Fields: - Examine the Subscribe Response to ensure it includes the following fields: - SubscriptionId: Verify that it is of type uint32. - MaxInterval: Verify that it is of type uint32. - - 4. Verify MaxInterval against SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT: - Compare the MaxInterval value received in the Subscribe Response to the value of SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT. - Verify that the MaxInterval value is less than or equal to SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT. - - [1690475286.624596][5694:5696] CHIP:DMG: - [1690475286.624598][5694:5696] CHIP:DMG: InteractionModelRevision = 1 - [1690475286.624600][5694:5696] CHIP:DMG: } - [1690475286.624620][5694:5696] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 2118637528 - [1690475286.624625][5694:5696] CHIP:TOO: Location: XX - [1690475286.624631][5694:5696] CHIP:DMG: MoveToState ReadClient[0x7fd848010a50]: Moving to [AwaitingSu] - [1690475286.624645][5694:5696] CHIP:EM: <<< [E:36540i S:55497 M:232793671 (Ack:16536684)] (S) Msg TX to 1:0000000000000001 [3C19] --- Type 0001:01 (IM:StatusResponse) - [1690475286.624649][5694:5696] CHIP:IN: (S) Sending msg 232793671 on secure session with LSID: 55497 - [1690475286.624771][5694:5696] CHIP:EM: >>> [E:36540i S:55497 M:16536685 (Ack:232793671)] (S) Msg RX from 1:0000000000000001 [3C19] --- Type 0001:04 (IM:SubscribeResponse) - [1690475286.624775][5694:5696] CHIP:EM: Found matching exchange: 36540i, Delegate: 0x7fd848010a60 - [1690475286.624778][5694:5696] CHIP:EM: Rxd Ack; Removing MessageCounter:232793671 from Retrans Table on exchange 36540i - [1690475286.624782][5694:5696] CHIP:DMG: SubscribeResponse is received - [1690475286.624787][5694:5696] CHIP:DMG: SubscribeResponseMessage = - [1690475286.624789][5694:5696] CHIP:DMG: { - [1690475286.624791][5694:5696] CHIP:DMG: SubscriptionId = 0xc96fec0e, - [1690475286.624793][5694:5696] CHIP:DMG: MaxInterval = 0x190, - [1690475286.624796][5694:5696] CHIP:DMG: InteractionModelRevision = 1 - [1690475286.624798][5694:5696] CHIP:DMG: } - [1690475286.624801][5694:5696] CHIP:DMG: Subscription established with SubscriptionID = 0xc96fec0e MinInterval = 10s MaxInterval = 400s Peer = 01:0000000000000001 - [1690475286.624805][5694:5696] CHIP:DMG: MoveToState ReadClient[0x7fd848010a50]: Moving to [Subscripti] + With the ACL command in step-2, we are overwriting the default privilege that chip-tool has an admin. After this step-3 you need to send below mentioned command to Grant access to all clusters again. + accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode":2, "subjects":[112233,4], "targets":null}]' 1 0 disabled: true - label: @@ -348,6 +392,7 @@ tests: [1687418591.903262][167960:167962] CHIP:DMG: MoveToState ReadClient[0x7fc81c00bbc0]: Moving to With the ACL command in step-2, we are overwriting the default privilege that chip-tool has an admin. After this step-3 you need to send below mentioned command to Grant access to all clusters again. + accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode":2, "subjects":[112233,4], "targets":null}]' 1 0 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_4_4.yaml b/src/app/tests/suites/certification/Test_TC_IDM_4_4.yaml index 5983a71fcef102..610125bcaf6bf9 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_4_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_4_4.yaml @@ -17,6 +17,7 @@ name: 3.4.3.[TC-IDM-4.4] Persistent Subscription Test Cases. [DUT as Server] PICS: - MCORE.IDM.S + - MCORE.IDM.S.PersistentSubscription config: nodeId: 0x12344321 @@ -24,6 +25,18 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + 1. The Cluster and Commands should be based on the cluster implementation on the DUT. + 2. The cluster used in the below test steps is an example, User can use any supported chip cluster/attribute/command. + disabled: true + + - label: "Precondition" + verification: | + 1. Please use Interactive mode to Verify subscription test cases + 2. Here the command to enter interactive mode:-- ./chip-tool interactive start + disabled: true + - label: "Step 1: TH sends a subscription request action for an attribute to the DUT. Activate the subscription between DUT and the TH." diff --git a/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml b/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml index f96eca2c6bfe3a..f8c43fa159f8fb 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_6_2.yaml @@ -28,8 +28,14 @@ config: tests: - label: "Note" verification: | - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start + 1. The Cluster and Commands should be based on the cluster implementation on the DUT. + 2. The cluster used in the below test steps is an example, User can use any supported chip cluster/attribute/command. + disabled: true + + - label: "Precondition" + verification: | + 1. Please use Interactive mode to Verify subscription test cases + 2. Here the command to enter interactive mode:-- ./chip-tool interactive start disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_IDM_6_4.yaml b/src/app/tests/suites/certification/Test_TC_IDM_6_4.yaml index c7050278c936ea..04a3882a05a2e0 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_6_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_6_4.yaml @@ -28,8 +28,8 @@ config: tests: - label: "Note" verification: | - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start + 1. The Cluster and Commands should be based on the cluster implementation on the DUT. + 2. The cluster used in the below test steps is an example, User can use any supported chip cluster/attribute/command. disabled: true - label: "Note" @@ -37,6 +37,12 @@ tests: Chip-tool command used below are an example to verify the DUT as client test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. disabled: true + - label: "Precondition" + verification: | + 1. Please use Interactive mode to Verify subscription test cases + 2. Here the command to enter interactive mode:-- ./chip-tool interactive start + disabled: true + - label: "Step 1: DUT sends Subscribe Request Message to the TH for a supported event." @@ -114,7 +120,7 @@ tests: - label: "Step 5: With an active Event subscription from DUT to TH, TH sends - Report Data message to DUT with an inactive SubscriptionId." + Report Data message to DUT with an invalid SubscriptionId." verification: | Mark this as not testable /NA. Out of Scope for V1.0 disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml index a65bf0daf41c1f..036a44caa7ff6e 100644 --- a/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_IDM_7_1.yaml @@ -26,8 +26,8 @@ config: tests: - label: "Note" verification: | - Please use Interactive mode to Verify subscription test cases - Here the command to enter interactive mode:-- ./chip-tool interactive start + 1. The Cluster and Commands should be based on the cluster implementation on the DUT. + 2. The cluster used in the below test steps is an example, User can use any supported chip cluster/attribute/command. disabled: true - label: "Precondition" @@ -59,6 +59,10 @@ tests: *Provision the device using chip tool on 5th controller(RD5) ./chip-tool pairing code 5 35358158796(mannualcode) --commissioner-name 5 + + + Please use Interactive mode to Verify subscription test cases + Here the command to enter interactive mode:-- ./chip-tool interactive start disabled: true - label: @@ -440,8 +444,6 @@ tests: [1692947914.492003][3667:3669] CHIP:DMG: MoveToState ReadClient[0xaaaafcb72000]: Moving to [Subscripti] - - #4. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true [1692947922.587132][3670:3672] CHIP:DMG: } @@ -470,8 +472,6 @@ tests: [1692947922.589442][3670:3672] CHIP:DMG: MoveToState ReadClient[0xaaaaf8a11000]: Moving to [Subscripti] - - #5. on the 5th reference device(RD5) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true [1692947931.880011][3673:3675] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3887771962 @@ -534,7 +534,7 @@ tests: disabled: true - label: - "Step 3b: RD2, RD3, RD4, RD5 send 3 Subscribe request messages each + "Step 3: RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. Verify that the subscription request messages from all reference devices succeed. Once all the Subscription Requests are activated, RD1 sends 6 subscription @@ -545,11 +545,11 @@ tests: #1. on the 2nd reference device(RD2) send a Subscribe Request Messages to DUT.(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 2 '0,0,0' --commissioner-name beta --keepSubscriptions true [1684322787.342206][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322787.342219][136396:136398] CHIP:TOO: LocalConfigDisabled: FALSE + [1684322787.342219][136396:136398] CHIP:TOO: LocalConfigDisabled: TRUE [1684322787.342246][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322787.342255][136396:136398] CHIP:TOO: Location: XX + [1684322787.342255][136396:136398] CHIP:TOO: Location: in [1684322787.342282][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322787.342289][136396:136398] CHIP:TOO: NodeLabel: + [1684322787.342289][136396:136398] CHIP:TOO: NodeLabel: "newnode" [1684322787.342308][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0001a460]: Moving to [AwaitingSu] [1684322787.342351][136396:136398] CHIP:EM: <<< [E:35584i S:50848 M:252532050 (Ack:201846722)] (S) Msg TX to 2:0000000000000002 [8559] --- Type 0001:01 (IM:StatusResponse) [1684322787.342363][136396:136398] CHIP:IN: (S) Sending msg 252532050 on secure session with LSID: 50848 @@ -572,11 +572,11 @@ tests: #2. on the 3rd reference device(RD3) send a Subscribe Request Messages to DUT..(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 3 '0,0,0' --commissioner-name gamma --keepSubscriptions true [1684322803.467486][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322803.467490][136409:136411] CHIP:TOO: LocalConfigDisabled: FALSE + [1684322803.467490][136409:136411] CHIP:TOO: LocalConfigDisabled: TRUE [1684322803.467499][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322803.467502][136409:136411] CHIP:TOO: Location: XX + [1684322803.467502][136409:136411] CHIP:TOO: Location: in [1684322803.467511][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322803.467513][136409:136411] CHIP:TOO: NodeLabel: + [1684322803.467513][136409:136411] CHIP:TOO: NodeLabel: "newnode" [1684322803.467520][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc01bb90]: Moving to [AwaitingSu] [1684322803.467531][136409:136411] CHIP:EM: <<< [E:42346i S:52489 M:199100316 (Ack:174085431)] (S) Msg TX to 3:0000000000000003 [5371] --- Type 0001:01 (IM:StatusResponse) [1684322803.467535][136409:136411] CHIP:IN: (S) Sending msg 199100316 on secure session with LSID: 52489 @@ -598,11 +598,11 @@ tests: #3. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true [1684322837.225922][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322837.225930][136403:136405] CHIP:TOO: LocalConfigDisabled: FALSE + [1684322837.225930][136403:136405] CHIP:TOO: LocalConfigDisabled: TRUE [1684322837.225940][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322837.225943][136403:136405] CHIP:TOO: Location: XX + [1684322837.225943][136403:136405] CHIP:TOO: Location: in [1684322837.225952][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322837.225955][136403:136405] CHIP:TOO: NodeLabel: + [1684322837.225955][136403:136405] CHIP:TOO: NodeLabel: "newnode" [1684322837.225961][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc019c70]: Moving to [AwaitingSu] [1684322837.225980][136403:136405] CHIP:EM: <<< [E:28544i S:21311 M:202084358 (Ack:249111943)] (S) Msg TX to 4:0000000000000004 [8451] --- Type 0001:01 (IM:StatusResponse) [1684322837.225984][136403:136405] CHIP:IN: (S) Sending msg 202084358 on secure session with LSID: 21311 @@ -624,11 +624,11 @@ tests: #4. on the 5th reference device(RD5) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true [1684322852.957519][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684322852.957525][136414:136416] CHIP:TOO: LocalConfigDisabled: FALSE + [1684322852.957525][136414:136416] CHIP:TOO: LocalConfigDisabled: TRUE [1684322852.957537][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684322852.957541][136414:136416] CHIP:TOO: Location: XX + [1684322852.957541][136414:136416] CHIP:TOO: Location: in [1684322852.957552][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684322852.957556][136414:136416] CHIP:TOO: NodeLabel: + [1684322852.957556][136414:136416] CHIP:TOO: NodeLabel: "newnode" [1684322852.957564][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a400e880]: Moving to [AwaitingSu] [1684322852.957585][136414:136416] CHIP:EM: <<< [E:5171i S:40695 M:166661007 (Ack:81061555)] (S) Msg TX to 5:0000000000000005 [D311] --- Type 0001:01 (IM:StatusResponse) [1684322852.957590][136414:136416] CHIP:IN: (S) Sending msg 166661007 on secure session with LSID: 40695 @@ -698,17 +698,17 @@ tests: request messages having 3 different paths from RD1A to the DUT." verification: | RD1, RD2, RD3, RD4, RD5 send 3 Subscribe request messages each with each of them having 3 different paths. - Verify that the subscription request messages from RD1, RD2, RD3, RD4 and RD5 succeed. - Once all the Subscription Requests are activated, send a Subscribe request messages having 3 different paths from RD1A to the DUT + Verify that the subscription request messages from RD1, RD2, RD3, RD4 and RD5 succeed. + Once all the Subscription Requests are activated, send a Subscribe request messages having 3 different paths from RD1A to the DUT #1. on the first reference device(RD1) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 1 '0,0,0' --keepSubscriptions true [1684323009.937251][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323009.937257][136393:136395] CHIP:TOO: LocalConfigDisabled: FALSE + [1684323009.937257][136393:136395] CHIP:TOO: LocalConfigDisabled: TRUE [1684323009.937274][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323009.937279][136393:136395] CHIP:TOO: Location: XX + [1684323009.937279][136393:136395] CHIP:TOO: Location: in [1684323009.937293][136393:136395] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323009.937298][136393:136395] CHIP:TOO: NodeLabel: + [1684323009.937298][136393:136395] CHIP:TOO: NodeLabel: "newnode" [1684323009.937308][136393:136395] CHIP:DMG: MoveToState ReadClient[0x7fb510002110]: Moving to [AwaitingSu] [1684323009.937334][136393:136395] CHIP:EM: <<< [E:41663i S:42488 M:180349725 (Ack:108042016)] (S) Msg TX to 1:0000000000000001 [E777] --- Type 0001:01 (IM:StatusResponse) [1684323009.937339][136393:136395] CHIP:IN: (S) Sending msg 180349725 on secure session with LSID: 42488 @@ -729,11 +729,11 @@ tests: #2. on the 2nd reference device(RD2) send a Subscribe Request Messages to DUT.(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 2 '0,0,0' --commissioner-name beta --keepSubscriptions true [1684323023.679481][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323023.679488][136396:136398] CHIP:TOO: LocalConfigDisabled: FALSE + [1684323023.679488][136396:136398] CHIP:TOO: LocalConfigDisabled: TRUE [1684323023.679503][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323023.679508][136396:136398] CHIP:TOO: Location: xx + [1684323023.679508][136396:136398] CHIP:TOO: Location: in [1684323023.679521][136396:136398] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323023.679525][136396:136398] CHIP:TOO: NodeLabel: + [1684323023.679525][136396:136398] CHIP:TOO: NodeLabel: "newnode" [1684323023.679535][136396:136398] CHIP:DMG: MoveToState ReadClient[0x7f6a0000a890]: Moving to [AwaitingSu] [1684323023.679556][136396:136398] CHIP:EM: <<< [E:35585i S:50848 M:252532054 (Ack:201846726)] (S) Msg TX to 2:0000000000000002 [8559] --- Type 0001:01 (IM:StatusResponse) [1684323023.679563][136396:136398] CHIP:IN: (S) Sending msg 252532054 on secure session with LSID: 50848 @@ -755,11 +755,11 @@ tests: #3. on the 3rd reference device(RD3) send a Subscribe Request Messages to DUT..(Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 3 '0,0,0' --commissioner-name gamma --keepSubscriptions true [1684323039.115907][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323039.115916][136409:136411] CHIP:TOO: LocalConfigDisabled: FALSE + [1684323039.115916][136409:136411] CHIP:TOO: LocalConfigDisabled: TRUE [1684323039.115943][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323039.115949][136409:136411] CHIP:TOO: Location: XX + [1684323039.115949][136409:136411] CHIP:TOO: Location: in [1684323039.115977][136409:136411] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323039.115981][136409:136411] CHIP:TOO: NodeLabel: + [1684323039.115981][136409:136411] CHIP:TOO: NodeLabel: "newnode" [1684323039.116000][136409:136411] CHIP:DMG: MoveToState ReadClient[0x7f53dc016c20]: Moving to [AwaitingSu] [1684323039.116030][136409:136411] CHIP:EM: <<< [E:42347i S:52489 M:199100320 (Ack:174085435)] (S) Msg TX to 3:0000000000000003 [5371] --- Type 0001:01 (IM:StatusResponse) [1684323039.116039][136409:136411] CHIP:IN: (S) Sending msg 199100320 on secure session with LSID: 52489 @@ -781,11 +781,11 @@ tests: #4. on the 4th reference device(RD4) send a Subscribe Request Messages to DUT. (Below is the example command to send a subscribe requests with 3 different paths in a single command ) any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 4 '0,0,0' --commissioner-name 4 --keepSubscriptions true [1684323055.304162][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323055.304177][136403:136405] CHIP:TOO: LocalConfigDisabled: FALSE + [1684323055.304177][136403:136405] CHIP:TOO: LocalConfigDisabled: TRUE [1684323055.304206][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323055.304216][136403:136405] CHIP:TOO: Location: XX + [1684323055.304216][136403:136405] CHIP:TOO: Location: in [1684323055.304243][136403:136405] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323055.304250][136403:136405] CHIP:TOO: NodeLabel: + [1684323055.304250][136403:136405] CHIP:TOO: NodeLabel: "newnode" [1684323055.304274][136403:136405] CHIP:DMG: MoveToState ReadClient[0x7ff4cc010a60]: Moving to [AwaitingSu] [1684323055.304312][136403:136405] CHIP:EM: <<< [E:28545i S:21311 M:202084362 (Ack:249111947)] (S) Msg TX to 4:0000000000000004 [8451] --- Type 0001:01 (IM:StatusResponse) [1684323055.304324][136403:136405] CHIP:IN: (S) Sending msg 202084362 on secure session with LSID: 21311 @@ -806,11 +806,11 @@ tests: any subscribe-by-id '0x0028,0x0028,0x0028' '5,6,16' 100 1000 5 '0,0,0' --commissioner-name 5 --keepSubscriptions true [1684323072.765216][136414:136416] CHIP:DMG: } [1684323072.765277][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0010 DataVersion: 3947588725 - [1684323072.765290][136414:136416] CHIP:TOO: LocalConfigDisabled: FALSE + [1684323072.765290][136414:136416] CHIP:TOO: LocalConfigDisabled: TRUE [1684323072.765318][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0006 DataVersion: 3947588725 - [1684323072.765327][136414:136416] CHIP:TOO: Location: XX + [1684323072.765327][136414:136416] CHIP:TOO: Location: in [1684323072.765352][136414:136416] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0028 Attribute 0x0000_0005 DataVersion: 3947588725 - [1684323072.765359][136414:136416] CHIP:TOO: NodeLabel: + [1684323072.765359][136414:136416] CHIP:TOO: NodeLabel: "newnode" [1684323072.765379][136414:136416] CHIP:DMG: MoveToState ReadClient[0x7f58a4014ee0]: Moving to [AwaitingSu] [1684323072.765426][136414:136416] CHIP:EM: <<< [E:5172i S:40695 M:166661011 (Ack:81061559)] (S) Msg TX to 5:0000000000000005 [D311] --- Type 0001:01 (IM:StatusResponse) [1684323072.765439][136414:136416] CHIP:IN: (S) Sending msg 166661011 on secure session with LSID: 40695 diff --git a/src/app/tests/suites/certification/Test_TC_I_2_2.yaml b/src/app/tests/suites/certification/Test_TC_I_2_2.yaml index 77cd19748e8e0b..d5061b3a8302f8 100644 --- a/src/app/tests/suites/certification/Test_TC_I_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_I_2_2.yaml @@ -178,7 +178,7 @@ tests: IdentifyType from Step 1b, in order to indicate to an observer which of several nodes and/or endpoints it is." verification: | - Verify that the device enters its identification state using the IdentifyType from step1b, + Verify that the identification state is terminated in the DUT. Here the Identifytype is 2(VisibleIndicator) which can be a small led that indicates the device is in identification state. This IdentifyType can vary to device ref: 1.2.5.1 in spec for the IdentifyTypeEnum of the particular DUT cluster: "LogCommands" diff --git a/src/app/tests/suites/certification/Test_TC_MC_11_1.yaml b/src/app/tests/suites/certification/Test_TC_MC_11_1.yaml index c944969c939f11..78ade89999317c 100644 --- a/src/app/tests/suites/certification/Test_TC_MC_11_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_MC_11_1.yaml @@ -26,6 +26,20 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + Refer to device or application documentation for supported DUT configuration. + For step 3 (prompt user), manufacturer may utilize a custom method for obtaining user consent other than an on-screen prompt. + Refer to manufacturer provided instructions for special argument values to each command, and/or additional steps required to put DUT into correct state to exhibit test behavior. + disabled: true + + - label: "Pre-Conditions" + verification: | + 1. DUT and Harness support Commissioner Discovery feature + 2. DUT is already in the network + 3. DUT supports AccountLogin cluster for certain Content Apps + disabled: true + - label: "Step 1: TH start scanning for available commissioners using Commissioner Discovery" diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_2.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_2.yaml index 7b0beddcff57d2..daf603b235af8d 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_2.yaml @@ -128,7 +128,7 @@ tests: After commissioning DUT to TH2's fabric read nocs - Verify the FabricIndex value during commissioning in TH2 Log + Save the the FabricIndex and NOC value during commissioning in TH2 Log [1673249259.166158][1742:1744] CHIP:DIS: Keeping DNSSD lookup active @@ -188,7 +188,7 @@ tests: CHIP:EM: Sending Standalone Ack for MessageCounter:7141893 on exchange 26909i disabled: true - - label: "Verify that CurrentFabricIndex = FabricIndex_TH1" + - label: "Step 7: Verify that CurrentFabricIndex = FabricIndex_TH1" verification: | Verify that CurrentFabricIndex = FabricIndex_TH1 disabled: true @@ -211,8 +211,8 @@ tests: disabled: true - label: - "Verify that there is only data for the entry whose FabricIndex field - is equal to FabricIndex_TH1" + "Step 9: Verify that there is only data for the entry whose + FabricIndex field is equal to FabricIndex_TH1" verification: | Verify that Noc"s list has only data for FabricIndex_TH1 @@ -243,8 +243,8 @@ tests: disabled: true - label: - "Verify that there is only data for the entry whose FabricIndex field - is equal to FabricIndex_TH1" + "Step 11: Verify that there is only data for the entry whose + FabricIndex field is equal to FabricIndex_TH1" verification: | Verify that Noc"s list has only data for FabricIndex_TH1 @@ -273,9 +273,9 @@ tests: disabled: true - label: - "From the NOCStruct values verify the following: NOC matches the NOC - sent to the DUT during commissioning process ICAC matches the ICAC - sent to the DUT during commissioning process from AddNOC in + "Step 13: From the NOCStruct values verify the following: NOC matches + the NOC sent to the DUT during commissioning process ICAC matches the + ICAC sent to the DUT during commissioning process from AddNOC in pre-condition" verification: | Verify NOC and ICAC value in step 12 and 2 matches @@ -309,8 +309,8 @@ tests: disabled: true - label: - "Verify that TH1 is able to read the FabricDescriptorStruct values - Verify that Fabrics list does not have any entry as FabricID = + "Step 15: Verify that TH1 is able to read the FabricDescriptorStruct + values Verify that Fabrics list does not have any entry as FabricID = FabricID2" verification: | Verify the FabricDescriptorStruct values has no entry log FabricID2 on TH1 @@ -338,7 +338,7 @@ tests: CHIP:EM: Sending Standalone Ack for MessageCounter:8900122 on exchange 26519i disabled: true - - label: "Verify that CurrentFabricIndex = FabricIndex_TH2" + - label: "Step 17: Verify that CurrentFabricIndex = FabricIndex_TH2" verification: | Verify that CurrentFabricIndex = FabricIndex_TH2 disabled: true @@ -362,8 +362,8 @@ tests: disabled: true - label: - "Verify that there is only data for the entry whose FabricIndex field - is equal to FabricIndex_TH2" + "Step 19: Verify that there is only data for the entry whose + FabricIndex field is equal to FabricIndex_TH2" verification: | ./chip-tool operationalcredentials read current-fabric-index 2 0 --commissioner-name beta @@ -393,8 +393,8 @@ tests: disabled: true - label: - "Verify that there is only data for the entry whose FabricIndex field - is equal to FabricIndex_TH2" + "Step 21: Verify that there is only data for the entry whose + FabricIndex field is equal to FabricIndex_TH2" verification: | Verify that Noc"s list has only data for FabricIndex_TH2 @@ -423,9 +423,9 @@ tests: disabled: true - label: - "From the NOCStruct values verify the following: NOC matches the NOC - sent to the DUT during commissioning process ICAC matches the ICAC - sent to the DUT during commissioning process from AddNOC in + "Step 23: From the NOCStruct values verify the following: NOC matches + the NOC sent to the DUT during commissioning process ICAC matches the + ICAC sent to the DUT during commissioning process from AddNOC in pre-condition" verification: | Verify the value of NOC and ICAC are same in step 22 and 4 are same diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml index 82ae75fb18f437..469f42d27ae55f 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml @@ -45,10 +45,13 @@ tests: - label: "Step 2: Start the commissioning process of TH with DUT" verification: | - ./chip-tool pairing ble-wifi 1 GRLPrivate_EXT matter123 20202021 3840 --trace_decode 1 + On dut(chip-tool) side: + ./chip-tool pairing ble-wifi 1 GRLPrivate_EXT matter123 20202021 3840 --trace_decode 1 [1641381202.376419][5628:5633] CHIP:CTL: Received success response 0x3df8 - sudo ./all-clusters-app --wifi + + On TH(all-clusters-app) + ./all-clusters-app --wifi [1641381202.306840][4431:4431] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_6.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_6.yaml index d835f8305e630d..e1d0eb9cb4e18b 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_6.yaml @@ -91,20 +91,17 @@ tests: disabled: true - label: - "Step 3: DUT shouldnt be discoverable via both commissionable and - operational advertisements" - PICS: "!MCORE.DD.EXTENDED_DISCOVERY" + "Step 3: Verify that the DUT is not advertising as an operational node + on DNS-SD with service type _matter._tcp" verification: | - Verify DUT is not discoverable over DNS-SD in both TCP and UDP - - avahi-browse -rt _matterc._tcp - avahi-browse -rt _matterc._udp + Verify that the DUT is not advertising as an operational node on DNS-SD with service type _matter._tcp + avahi-browse -rt _matter._tcp disabled: true - label: - "Step 4: DUT should be discoverable via commissionable service - advertisements but shall not be in the commissioning mode" - PICS: MCORE.DD.EXTENDED_DISCOVERY + "Step 4: If the DUT is advertising as a commissionable node with CM=2 + over DNS-SD or advertising the Matter service over BLE, TH commissions + the device" verification: | Verify that the DUT is discoverable over DNS-SD with service type _matterc._udp with no subtype _CM and text key for CM with value 0 diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_1.yaml deleted file mode 100644 index 6720a5b1f8cba1..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_1.yaml +++ /dev/null @@ -1,374 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 202.2.1. [TC-OPSTATE-2.1] Attributes with DUT as Server - -PICS: - - OPSTATE.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Note" - verification: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the PhaseList attribute" - PICS: OPSTATE.S.A0000 - verification: | - ./chip-tool operationalstate read phase-list 1 1 - Via the TH (chip-tool), verify: - - that PhaseList attribute value contains either null or a list of strings. - - that the list has no more than 32 entries. on TH(chip-tool) - - [1689673042.242432][16559:16561] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0000 DataVersion: 2102885775 - [1689673042.242467][16559:16561] CHIP:TOO: PhaseList: null - [1689673042.242534][16559:16561] CHIP:EM: <<< [E:48068i S:38311 M:143641441 (Ack:153463022)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689673042.242550][16559:16561] CHIP:IN: (S) Sending msg 143641441 on secure session with LSID: 38311 - [1689673042.242576][16559:16561] CHIP:EM: Flushed pending ack for MessageCounter:153463022 on exchange 48068i - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentPhase attribute" - PICS: OPSTATE.S.A0001 - verification: | - ./chip-tool operationalstate read current-phase 1 1 - - - Via the TH (chip-tool), verify: - - if the value from Step 1 was null, verify that this is also null. - - otherwise, verify that the CurrentPhase attribute value contains contains an integer between 0 and the size of the list from step 1 minus 1. - - [1689673092.833781][16569:16571] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0001 DataVersion: 2102885775 - [1689673092.833792][16569:16571] CHIP:TOO: CurrentPhase: null - [1689673092.833817][16569:16571] CHIP:EM: <<< [E:13231i S:9793 M:23831753 (Ack:197019464)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689673092.833821][16569:16571] CHIP:IN: (S) Sending msg 23831753 on secure session with LSID: 9793 - [1689673092.833830][16569:16571] CHIP:EM: Flushed pending ack for MessageCounter:197019464 on exchange 13231i - disabled: true - - - label: "Step 4: TH reads from the DUT the CountdownTime attribute" - PICS: OPSTATE.S.A0002 - verification: | - ./chip-tool operationalstate read countdown-time 1 1 - - Via the TH (chip-tool), verify: - - that CountdownTime attribute contains either null our a uint32 value - - if non-null, verify that the value is in the range 0 to 259200 - - [1689673127.371922][16577:16579] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0002 DataVersion: 2102885775 - [1689673127.371959][16577:16579] CHIP:TOO: CountdownTime: null - [1689673127.372043][16577:16579] CHIP:EM: <<< [E:30495i S:28535 M:52017774 (Ack:9447363)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689673127.372059][16577:16579] CHIP:IN: (S) Sending msg 52017774 on secure session with LSID: 28535 - [1689673127.372096][16577:16579] CHIP:EM: Flushed pending ack for MessageCounter:9447363 on exchange 30495i - [1689673127.372209][16577:16577] CHIP:CTL: Shutting down the commissioner - [1689673127.372229][16577:16577] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: "Step 5: TH reads from the DUT the OperationalStateList attribute" - PICS: OPSTATE.S.A0003 - verification: | - ./chip-tool operationalstate read operational-state-list 1 1 - - Via the TH (chip-tool), verify: - - the provided list contains the Error state (an entry with an ID of 0x03). - - all entries include an ID (enum8) and a label (string) - - all provided IDs are in the allowed range - - [1689673161.214277][16581:16583] CHIP:DMG: } - [1689673161.214405][16581:16583] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0003 DataVersion: 2102885775 - [1689673161.214450][16581:16583] CHIP:TOO: OperationalStateList: 4 entries - [1689673161.214465][16581:16583] CHIP:TOO: [1]: { - [1689673161.214479][16581:16583] CHIP:TOO: OperationalStateID: 0 - [1689673161.214486][16581:16583] CHIP:TOO: } - [1689673161.214495][16581:16583] CHIP:TOO: [2]: { - [1689673161.214500][16581:16583] CHIP:TOO: OperationalStateID: 1 - [1689673161.214506][16581:16583] CHIP:TOO: } - [1689673161.214513][16581:16583] CHIP:TOO: [3]: { - [1689673161.214519][16581:16583] CHIP:TOO: OperationalStateID: 2 - [1689673161.214524][16581:16583] CHIP:TOO: } - [1689673161.214532][16581:16583] CHIP:TOO: [4]: { - [1689673161.214537][16581:16583] CHIP:TOO: OperationalStateID: 3 - [1689673161.214543][16581:16583] CHIP:TOO: } - [1689673161.214602][16581:16583] CHIP:EM: <<< [E:25860i S:31003 M:109977752 (Ack:203100043)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689673161.214616][16581:16583] CHIP:IN: (S) Sending msg 109977752 on secure session with LSID: 31003 - [1689673161.214642][16581:16583] CHIP:EM: Flushed pending ack for MessageCounter:203100043 on exchange 25860i - disabled: true - - - label: "Step 6: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 - verification: | - ./chip-tool operationalstate read operational-state 1 1 - - Via the TH (chip-tool), verify: - - the response includes an ID (enum8) amd a label (string) - - the provided ID is found in the set provided in step 4 - - the provided ID is in the allowed range - - [1689673213.434610][16591:16593] CHIP:DMG: } - [1689673213.434686][16591:16593] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 2102885775 - [1689673213.434721][16591:16593] CHIP:TOO: OperationalState: { - [1689673213.434728][16591:16593] CHIP:TOO: OperationalStateID: 0 - [1689673213.434735][16591:16593] CHIP:TOO: } - [1689673213.434799][16591:16593] CHIP:EM: <<< [E:57905i S:36558 M:162792358 (Ack:245583777)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689673213.434812][16591:16593] CHIP:IN: (S) Sending msg 162792358 on secure session with LSID: 36558 - [1689673213.434839][16591:16593] CHIP:EM: Flushed pending ack for MessageCounter:245583777 on exchange 57905i - [1689673213.434993][16591:16591] CHIP:CTL: Shutting down the commissioner - disabled: true - - - label: - "Step 6a: manually put the device in the Stopped(0x00) operational - state" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_STOPPED - verification: | - manually put the device in the Stopped(0x00) operational state - disabled: true - - - label: "Step 6b: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_STOPPED - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Stopped(0x00) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 0 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 6c: manually put the device in the Running(0x01) operational - state" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_RUNNING - verification: | - manually put the device in the Running(0x01) operational state - disabled: true - - - label: "Step 6d: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_RUNNING - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Running(0x01) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 1 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 6e: manually put the device in the Paused(0x02) operational - state" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_PAUSED - verification: | - manually put the device in the Paused(0x02) operational state - disabled: true - - - label: "Step 6f: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_PAUSED - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Paused(0x02) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 2 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 6g: manually put the device in the Error(0x03) operational state" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_ERROR - verification: | - manually put the device in the Error(0x03) operational state - disabled: true - - - label: "Step 6h: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 && OPSTATE.S.M.ST_ERROR - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Error(0x03) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 3 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: "Step 7: TH reads from the DUT the OperationalError attribute" - PICS: OPSTATE.S.A0005 - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an instance of ErrorStateStruct and Verify the ErrorStateID is a defined error (NoError(0x00), UnableToStartOrResume(0x01), UnableToCompleteOperation(0x02), CommandInvalidInState(0x03)) or in the range 0x80 to 0xBF. - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 3 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: "Step 7a: manually put the device in the NoError(0x00) error state" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_NO_ERROR - verification: | - manually put the device in the NoError(0x00) error state - disabled: true - - - label: "Step 7b: TH reads from the DUT the OperationalError attribute" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_NO_ERROR - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to SeekingCharger(0x40) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 64 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 7c: manually put the device in the UnableToStartOrResume(0x01) - error state" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME - verification: | - manually put the device in the UnableToStartOrResume(0x01) error state - disabled: true - - - label: "Step 7d: TH reads from the DUT the OperationalError attribute" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME - verification: | - ./chip-tool operationalstate read operational-state 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Charging(0x41) - - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 65 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 7e: manually put the device in the - UnableToCompleteOperation(0x02) error state" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION - verification: | - manually put the device in the Docked(0x42) operational state - disabled: true - - - label: "Step 7f: TH reads from the DUT the OperationalError attribute" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION - verification: | - ./chip-tool operationalstate read operational-error 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an OperationalStateEnum value. Verify this is set to Docked(0x42) - [1690201842.479098][15020:15022] CHIP:DMG: SuppressResponse = true, - [1690201842.479158][15020:15022] CHIP:DMG: InteractionModelRevision = 1 - [1690201842.479211][15020:15022] CHIP:DMG: } - [1690201842.479528][15020:15022] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0004 DataVersion: 3675566847 - [1690201842.479656][15020:15022] CHIP:TOO: OperationalState: 66 - [1690201842.479966][15020:15022] CHIP:EM: <<< [E:7640i S:22973 M:102288525 (Ack:157133280)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201842.480062][15020:15022] CHIP:IN: (S) Sending msg 102288525 on secure session with LSID: 22973 - [1690201842.480329][15020:15022] CHIP:EM: Flushed pending ack for MessageCounter:157133280 on exchange 7640i - [1690201842.480735][15020:15020] CHIP:CTL: Shutting down the commissioner - [1690201842.480807][15020:15020] CHIP:CTL: Stopping commissioning discovery over DNS-SD - disabled: true - - - label: - "Step 7g: manually put the device in the CommandInvalidInState(0x03) - error state" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE - verification: | - ./chip-tool operationalstate read operational-error 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an instance of ErrorStateStruct and Verify the ErrorStateID is a defined error (NoError(0x00), UnableToStartOrResume(0x01), UnableToCompleteOperation(0x02), CommandInvalidInState(0x03), FailedToFindChargingDock(0x40), Stuck(0x41), DustBinMissing(0x42), DustBinFull(0x43), WaterTankEmpty(0x44), WaterTankMissing(0x45), WaterTankLidOpen(0x46), MopCleaningPadMissing(0x47)) or in the range 0x80 to 0xBF. - - - [1690201879.312424][15025:15027] CHIP:DMG: } - [1690201879.312754][15025:15027] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0005 DataVersion: 3675566847 - [1690201879.312892][15025:15027] CHIP:TOO: OperationalError: { - [1690201879.312953][15025:15027] CHIP:TOO: ErrorStateID: 0 - [1690201879.313009][15025:15027] CHIP:TOO: } - [1690201879.313334][15025:15027] CHIP:EM: <<< [E:36372i S:53703 M:124059394 (Ack:197234404)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201879.313431][15025:15027] CHIP:IN: (S) Sending msg 124059394 on secure session with LSID: 53703 - [1690201879.313647][15025:15027] CHIP:EM: Flushed pending ack for MessageCounter:197234404 on exchange 36372i - [1690201879.314067][15025:15025] CHIP:CTL: Shutting down the commissioner - [1690201879.314141][15025:15025] CHIP:CTL: Stopping commissioning discovery over DNS-SD - [1690201879.314334][15025:15025] CHIP:CTL: Shutting down the controller - disabled: true - - - label: "Step 7h: TH reads from the DUT the OperationalError attribute" - PICS: OPSTATE.S.A0005 && OPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE - verification: | - ./chip-tool operationalstate read operational-error 1 1 - Via the TH (chip-tool), Verify that the DUT response contains an instance of ErrorStateStruct. This shall contain an ErrorStateId with a value of UnableToStartOrResume(0x01) - - [1690201879.312424][15025:15027] CHIP:DMG: } - [1690201879.312754][15025:15027] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Attribute 0x0000_0005 DataVersion: 3675566847 - [1690201879.312892][15025:15027] CHIP:TOO: OperationalError: { - [1690201879.312953][15025:15027] CHIP:TOO: ErrorStateID: 1 - [1690201879.313009][15025:15027] CHIP:TOO: } - [1690201879.313334][15025:15027] CHIP:EM: <<< [E:36372i S:53703 M:124059394 (Ack:197234404)] (S) Msg TX to 1:0000000000000001 [9278] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1690201879.313431][15025:15027] CHIP:IN: (S) Sending msg 124059394 on secure session with LSID: 53703 - [1690201879.313647][15025:15027] CHIP:EM: Flushed pending ack for MessageCounter:197234404 on exchange 36372i - [1690201879.314067][15025:15025] CHIP:CTL: Shutting down the commissioner - [1690201879.314141][15025:15025] CHIP:CTL: Stopping commissioning discovery over DNS-SD - [1690201879.314334][15025:15025] CHIP:CTL: Shutting down the controller - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml index fb0fc296d816cc..5e12a2d56b80a8 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml @@ -40,7 +40,7 @@ tests: "Step 2: Manually put the DUT into a state wherein it can receive a Start Command" verification: | - + Manually put the DUT into a state wherein it can receive a Start Command disabled: true - label: "Step 3: TH reads from the DUT the OperationalStateList attribute" @@ -191,7 +191,7 @@ tests: of time less than the expected duration of the operation that has been started" verification: | - + TH waits for a vendor defined wait time, this being a period of time less than the expected duration of the operation that has been started disabled: true - label: "Step 11: TH reads from the DUT the CountdownTime attribute" @@ -305,7 +305,7 @@ tests: "Step 16: Manually put the DUT into a state wherein it cannot receive a Start Command" verification: | - + Manually put the DUT into a state wherein it cannot receive a Start Command disabled: true - label: "Step 17: TH sends Start command to the DUT" @@ -322,7 +322,7 @@ tests: [1689674700.385233][17340:17342] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0060 Command 0x0000_0004 [1689674700.385266][17340:17342] CHIP:TOO: OperationalCommandResponse: { [1689674700.385274][17340:17342] CHIP:TOO: commandResponseState: { - [1689674700.385281][17340:17342] CHIP:TOO: ErrorStateID: 0 + [1689674700.385281][17340:17342] CHIP:TOO: ErrorStateID: 1 [1689674700.385289][17340:17342] CHIP:TOO: } [1689674700.385295][17340:17342] CHIP:TOO: } [1689674700.385311][17340:17342] CHIP:DMG: ICR moving to [AwaitingDe] diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_3.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_3.yaml deleted file mode 100644 index d0e4cf49ff83b8..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_3.yaml +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 202.2.3. [TC-OPSTATE-2.3] Pause and Resume commands with DUT as Server - -PICS: - - OPSTATE.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Note" - verifications: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)" - verification: | - OPSTATE.S.C00 && OPSTATE.S.C03 - disabled: true - - - label: - "Step 2: Manually put the DUT into a state wherein it can receive a - Pause Command" - verification: | - - disabled: true - - - label: "Step 3: TH reads from the DUT the OperationalStateList attribute" - PICS: OPSTATE.S.A0003 - verification: | - ./chip-tool operationalstate read operationalstatelist 1 1 - - Via the TH (chip-tool), verify: - - all entries include an ID (enum8) and a label (string) - - all provided IDs are in the allowed range - - the list includes IDs for Error (0x03), Running (0x01), and Paused (0x02) - disabled: true - - - label: "Step 4: TH sends Pause command to the DUT" - PICS: OPSTATE.S.C00.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate pause 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) - disabled: true - - - label: "Step 5: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 - verification: | - ./chip-tool operationalstate read operationalstate 1 1 - - Via the TH (chip-tool), verify: - - the response has an OperationalStateID field that is set to 0x02 (Paused) - disabled: true - - - label: "Step 6: TH reads from the DUT the CountdownTime attribute" - PICS: OPSTATE.S.A0002 - verification: | - ./chip-tool operationalstate read countdowntime 1 1 - - Via the TH (chip-tool), verify: - - that CountdownTime attribute contains either null our a uint32 value - - if non-null, verify that the value is in the range 1 to 259200 - - store the value in 'initialcountdown-time' - disabled: true - - - label: "Step 7: TH waits for 5 seconds" - verification: | - - disabled: true - - - label: "Step 8: TH reads from the DUT the CountdownTime attribute" - PICS: OPSTATE.S.A0002 - verification: | - ./chip-tool operationalstate read operationalerror 1 1 - - Via the TH (chip-tool), verify: - - that CountdownTime attribute contains either null our a uint32 value - - if non-null, verify that the value is in the range 1 to 259200 - - that the value is the same as 'initialcountdown-time' - disabled: true - - - label: "Step 9: TH sends Pause command to the DUT" - PICS: OPSTATE.S.C00.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate pause 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) - disabled: true - - - label: "Step 10: TH sends Resume command to the DUT" - PICS: OPSTATE.S.C03.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate resume 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) - disabled: true - - - label: "Step 11: TH reads from the DUT the OperationalState attribute" - PICS: OPSTATE.S.A0004 - verification: | - ./chip-tool operationalstate read operationalstate 1 1 - - Via the TH (chip-tool), verify: - - the response has an OperationalStateID field that is set to 0x01 (Running) - disabled: true - - - label: "Step 12: TH sends Resume command to the DUT" - PICS: OPSTATE.S.C03.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate resume 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) - disabled: true - - - label: - "Step 13: Manually put the DUT into a state wherein it cannot receive - a Pause command (e.g. Stopped state)" - verification: | - - disabled: true - - - label: "Step 14: TH sends Pause command to the DUT" - PICS: OPSTATE.S.C00.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate pause 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x03 (CommandInvalidInState) - disabled: true - - - label: - "Step 15: Manually put the DUT into a state wherein it cannot receive - a Resume command (e.g. Stopped state)" - verification: | - - disabled: true - - - label: "Step 16: TH sends Resume command to the DUT" - PICS: OPSTATE.S.C03.Rsp && OPSTATE.S.C04.Tx - verification: | - ./chip-tool operationalstate resume 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x03 (CommandInvalidInState) - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml deleted file mode 100644 index bde5980061e3e5..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_1_2.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 92.2.1. [TC-RVCCLEANM-1.2] Cluster attributes with DUT as Server - -PICS: - - RVCCLEANM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Preconditions" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: RVCCLEANM.S.A0000 - verification: | - ./chip-tool rvccleanmode read supported-modes 1 1 - - Verify that the DUT response contains list of ModeOptionsStruct entries. - - Verify that the list has at least 2 and at most 255 entries - - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value - - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) or a defined derived cluster tag value (DeepClean(0x4000), Vacuum(0x4001), Mop(0x4002)) or in the MfgTags (0x8000 to 0xBFFF) range. - - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 - - Verify that at least one ModeOptionsStruct entry includes either the Vacuum(0x4001) mode tag or the Mop(0x4002)mode tag in the ModeTags field - - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690182376.583260][14996:14998] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0000 DataVersion: 3145953005 - [1690182376.583288][14996:14998] CHIP:TOO: SupportedModes: 3 entries - [1690182376.583301][14996:14998] CHIP:TOO: [1]: { - [1690182376.583304][14996:14998] CHIP:TOO: Label: Vacuum - [1690182376.583307][14996:14998] CHIP:TOO: Mode: 0 - [1690182376.583311][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583316][14996:14998] CHIP:TOO: [1]: { - [1690182376.583319][14996:14998] CHIP:TOO: Value: 16385 - [1690182376.583322][14996:14998] CHIP:TOO: } - [1690182376.583325][14996:14998] CHIP:TOO: } - [1690182376.583331][14996:14998] CHIP:TOO: [2]: { - [1690182376.583333][14996:14998] CHIP:TOO: Label: Wash - [1690182376.583336][14996:14998] CHIP:TOO: Mode: 1 - [1690182376.583340][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583344][14996:14998] CHIP:TOO: [1]: { - [1690182376.583347][14996:14998] CHIP:TOO: Value: 16386 - [1690182376.583349][14996:14998] CHIP:TOO: } - [1690182376.583352][14996:14998] CHIP:TOO: } - [1690182376.583357][14996:14998] CHIP:TOO: [3]: { - [1690182376.583360][14996:14998] CHIP:TOO: Label: Deep clean - [1690182376.583362][14996:14998] CHIP:TOO: Mode: 2 - [1690182376.583366][14996:14998] CHIP:TOO: ModeTags: 2 entries - [1690182376.583369][14996:14998] CHIP:TOO: [1]: { - [1690182376.583372][14996:14998] CHIP:TOO: Value: 7 - [1690182376.583375][14996:14998] CHIP:TOO: } - [1690182376.583378][14996:14998] CHIP:TOO: [2]: { - [1690182376.583380][14996:14998] CHIP:TOO: Value: 16384 - [1690182376.583383][14996:14998] CHIP:TOO: } - [1690182376.583385][14996:14998] CHIP:TOO: } - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 - [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 4: TH reads from the DUT the OnMode attribute." - PICS: RVCCLEANM.S.A0003 - verification: | - ./chip-tool rvccleanmode read on-mode 1 1 - - Verify on TH(chip-tool) logs, OnMode attribute value is an integer from supported_modes_dut or Null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null - - [1690182436.721527][15012:15014] CHIP:DMG: } - [1690182436.721673][15012:15014] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0003 DataVersion: 3145953005 - [1690182436.721723][15012:15014] CHIP:TOO: OnMode: null - disabled: true - - - label: "Step 5: TH reads from the DUT the StartUpMode attribute." - PICS: RVCCLEANM.S.A0002 - verification: | - ./chip-tool rvccleanmode read start-up-mode 1 1 - - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null - - [1690182475.587786][15022:15024] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3145953005 - [1690182475.587797][15022:15024] CHIP:TOO: StartUpMode: null - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml deleted file mode 100644 index 5f16be922706ba..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_2_1.yaml +++ /dev/null @@ -1,241 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 92.3.1. [TC-RVCCLEANM-2.1] Change to Mode functionality with DUT as Server - -PICS: - - RVCCLEANM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: RVCCLEANM.S.A0000 - verification: | - ./chip-tool rvccleanmode read supported-modes 1 1 - - Verify that the DUT response contains list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690182376.583260][14996:14998] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0000 DataVersion: 3145953005 - [1690182376.583288][14996:14998] CHIP:TOO: SupportedModes: 3 entries - [1690182376.583301][14996:14998] CHIP:TOO: [1]: { - [1690182376.583304][14996:14998] CHIP:TOO: Label: Vacuum - [1690182376.583307][14996:14998] CHIP:TOO: Mode: 0 - [1690182376.583311][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583316][14996:14998] CHIP:TOO: [1]: { - [1690182376.583319][14996:14998] CHIP:TOO: Value: 16385 - [1690182376.583322][14996:14998] CHIP:TOO: } - [1690182376.583325][14996:14998] CHIP:TOO: } - [1690182376.583331][14996:14998] CHIP:TOO: [2]: { - [1690182376.583333][14996:14998] CHIP:TOO: Label: Wash - [1690182376.583336][14996:14998] CHIP:TOO: Mode: 1 - [1690182376.583340][14996:14998] CHIP:TOO: ModeTags: 1 entries - [1690182376.583344][14996:14998] CHIP:TOO: [1]: { - [1690182376.583347][14996:14998] CHIP:TOO: Value: 16386 - [1690182376.583349][14996:14998] CHIP:TOO: } - [1690182376.583352][14996:14998] CHIP:TOO: } - [1690182376.583357][14996:14998] CHIP:TOO: [3]: { - [1690182376.583360][14996:14998] CHIP:TOO: Label: Deep clean - [1690182376.583362][14996:14998] CHIP:TOO: Mode: 2 - [1690182376.583366][14996:14998] CHIP:TOO: ModeTags: 2 entries - [1690182376.583369][14996:14998] CHIP:TOO: [1]: { - [1690182376.583372][14996:14998] CHIP:TOO: Value: 7 - [1690182376.583375][14996:14998] CHIP:TOO: } - [1690182376.583378][14996:14998] CHIP:TOO: [2]: { - [1690182376.583380][14996:14998] CHIP:TOO: Value: 16384 - [1690182376.583383][14996:14998] CHIP:TOO: } - [1690182376.583385][14996:14998] CHIP:TOO: } - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut - - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 - [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set - to old_current_mode_dut" - PICS: RVCCLEANM.S.C00.Rsp - verification: | - ./chip-tool rvccleanmode change-to-mode 0 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690182553.733326][15036:15038] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690182553.733341][15036:15038] CHIP:TOO: ChangeToModeResponse: { - [1690182553.733348][15036:15038] CHIP:TOO: status: 0 - [1690182553.733351][15036:15038] CHIP:TOO: } - disabled: true - - - label: - "Step 5: Manually put the device in a state from which it will FAIL to - transition to PIXIT.RVCCLEANM.MODE_CHANGE_FAIL" - PICS: RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE - verification: | - Manual operation required - disabled: true - - - label: "Step 6: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 - [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to PIXIT.RVCCLEANM.MODE_CHANGE_FAIL" - PICS: RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE && RVCCLEANM.S.C00.Rsp - verification: | - First change the mode to cleaning after that try to change the mode to any other modes (Deep clean, Wash ) - - ./chip-tool rvcrunmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690262143.410054][28190:28192] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690262143.410070][28190:28192] CHIP:TOO: ChangeToModeResponse: { - [1690262143.410076][28190:28192] CHIP:TOO: status: 0 - [1690262143.410079][28190:28192] CHIP:TOO: } - - ./chip-tool rvccleanmode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a CleaningInProgress(0X40) status response and StatusText field has a length between 1 to 64, below is the sample log provided for the raspi platform: - - [1690262155.519185][28202:28204] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690262155.519202][28202:28204] CHIP:TOO: ChangeToModeResponse: { - [1690262155.519206][28202:28204] CHIP:TOO: status: 64 - [1690262155.519210][28202:28204] CHIP:TOO: statusText: Cannot change the cleaning mode during a clean - [1690262155.519213][28202:28204] CHIP:TOO: } - disabled: true - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool), CurrentMode attribute value is an integer value and equal to old_current_mode_dut below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 - [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 9: Manually put the device in a state from which it will - SUCCESSFULLY transition to PIXIT.RVCCLEANM.MODE_CHANGE_OK" - verification: | - Manual operation required - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690182411.579845][15004:15006] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3145953005 - [1690182411.579857][15004:15006] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set - to PIXIT.RVCCLEANM.MODE_CHANGE_OK" - PICS: RVCCLEANM.S.C00.Rsp - verification: | - Change to mode is not allowed from cleaning to any other mode(Vaccum, Deep clean, Wash ), Please switch the mode to idle and then try to change to other modes - - ./chip-tool rvcrunmode change-to-mode 0 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690262367.604437][28315:28317] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690262367.604496][28315:28317] CHIP:TOO: ChangeToModeResponse: { - [1690262367.604517][28315:28317] CHIP:TOO: status: 0 - [1690262367.604529][28315:28317] CHIP:TOO: } - - - ./chip-tool rvccleanmode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690262376.067598][28323:28325] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690262376.067612][28323:28325] CHIP:TOO: ChangeToModeResponse: { - [1690262376.067618][28323:28325] CHIP:TOO: status: 0 - [1690262376.067621][28323:28325] CHIP:TOO: } - disabled: true - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 11, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 2 - - [1690262464.326501][28342:28344] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 2064453499 - [1690262464.326542][28342:28344] CHIP:TOO: CurrentMode: 2 - disabled: true - - - label: - "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set - to invalid_mode_th" - PICS: RVCCLEANM.S.C00.Rsp - verification: | - ./chip-tool rvccleanmode change-to-mode 4 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a UnsupportedMode(0x01) status response and below is the sample log provided for the raspi platform: - - [1690262496.596029][28351:28353] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690262496.596080][28351:28353] CHIP:TOO: ChangeToModeResponse: { - [1690262496.596117][28351:28353] CHIP:TOO: status: 1 - [1690262496.596120][28351:28353] CHIP:TOO: } - disabled: true - - - label: "Step 14: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 12, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 2 - - [1690262464.326501][28342:28344] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 2064453499 - [1690262464.326542][28342:28344] CHIP:TOO: CurrentMode: 2 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml index 3ffc3454e12766..83634fa0c29635 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_1.yaml @@ -65,7 +65,24 @@ tests: minValue: 0 maxValue: 254 + - label: + "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. + Else proceed to step 6." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue PICS: RVCCLEANM.S.A0000 && RVCCLEANM.S.F00 command: "readAttribute" attribute: "SupportedModes" @@ -77,6 +94,7 @@ tests: - label: "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th" + runIf: IsExpectedValue PICS: RVCCLEANM.S.C00.Rsp && RVCCLEANM.S.F00 command: "ChangeToMode" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml deleted file mode 100644 index a878da5691c923..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCCLEANM_3_2.yaml +++ /dev/null @@ -1,203 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 92.4.2. [TC-RVCCLEANM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - RVCCLEANM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Preconditions" - verification: | - !RVCCLEANM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: RVCCLEANM.S.A0002 - verification: | - ./chip-tool rvccleanmode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer value or null - - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is null - - NOTE: if startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - - [1690545840.189340][3104:3106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3338736524 - [1690545840.189408][3104:3106] CHIP:TOO: StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - PICS: RVCCLEANM.S.A0000 - verification: | - ./chip-tool rvccleanmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690183637.107558][15230:15232] CHIP:TOO: SupportedModes: 3 entries - [1690183637.107597][15230:15232] CHIP:TOO: [1]: { - [1690183637.107608][15230:15232] CHIP:TOO: Label: Vacuum - [1690183637.107618][15230:15232] CHIP:TOO: Mode: 0 - [1690183637.107633][15230:15232] CHIP:TOO: ModeTags: 1 entries - [1690183637.107651][15230:15232] CHIP:TOO: [1]: { - [1690183637.107662][15230:15232] CHIP:TOO: Value: 16385 - [1690183637.107670][15230:15232] CHIP:TOO: } - [1690183637.107679][15230:15232] CHIP:TOO: } - [1690183637.107700][15230:15232] CHIP:TOO: [2]: { - [1690183637.107708][15230:15232] CHIP:TOO: Label: Wash - [1690183637.107718][15230:15232] CHIP:TOO: Mode: 1 - [1690183637.107730][15230:15232] CHIP:TOO: ModeTags: 1 entries - [1690183637.107744][15230:15232] CHIP:TOO: [1]: { - [1690183637.107753][15230:15232] CHIP:TOO: Value: 16386 - [1690183637.107765][15230:15232] CHIP:TOO: } - [1690183637.107774][15230:15232] CHIP:TOO: } - [1690183637.107793][15230:15232] CHIP:TOO: [3]: { - [1690183637.107801][15230:15232] CHIP:TOO: Label: Deep clean - [1690183637.107811][15230:15232] CHIP:TOO: Mode: 2 - [1690183637.107823][15230:15232] CHIP:TOO: ModeTags: 2 entries - [1690183637.107837][15230:15232] CHIP:TOO: [1]: { - [1690183637.107846][15230:15232] CHIP:TOO: Value: 7 - [1690183637.107856][15230:15232] CHIP:TOO: } - [1690183637.107885][15230:15232] CHIP:TOO: [2]: { - [1690183637.107888][15230:15232] CHIP:TOO: Value: 16384 - [1690183637.107890][15230:15232] CHIP:TOO: } - [1690183637.107894][15230:15232] CHIP:TOO: } - disabled: true - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: RVCCLEANM.S.A0002 - verification: | - ./chip-tool rvccleanmode write start-up-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690183561.346360][15209:15211] CHIP:DMG: StatusIB = - [1690183561.346364][15209:15211] CHIP:DMG: { - [1690183561.346367][15209:15211] CHIP:DMG: status = 0x00 (SUCCESS), - [1690183561.346369][15209:15211] CHIP:DMG: }, - disabled: true - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - On TH(chip-tool), Verify CurrentMode attribute value is an integer value - - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. - - [1690183605.342520][15217:15219] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 3992778259 - [1690183605.342539][15217:15219] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: RVCCLEANM.S.A0000 - verification: | - ./chip-tool rvccleanmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th., below is the sample log provided for the raspi platform: - - [1690183637.107558][15230:15232] CHIP:TOO: SupportedModes: 3 entries - [1690183637.107597][15230:15232] CHIP:TOO: [1]: { - [1690183637.107608][15230:15232] CHIP:TOO: Label: Vacuum - [1690183637.107618][15230:15232] CHIP:TOO: Mode: 0 - [1690183637.107633][15230:15232] CHIP:TOO: ModeTags: 1 entries - [1690183637.107651][15230:15232] CHIP:TOO: [1]: { - [1690183637.107662][15230:15232] CHIP:TOO: Value: 16385 - [1690183637.107670][15230:15232] CHIP:TOO: } - [1690183637.107679][15230:15232] CHIP:TOO: } - [1690183637.107700][15230:15232] CHIP:TOO: [2]: { - [1690183637.107708][15230:15232] CHIP:TOO: Label: Wash - [1690183637.107718][15230:15232] CHIP:TOO: Mode: 1 - [1690183637.107730][15230:15232] CHIP:TOO: ModeTags: 1 entries - [1690183637.107744][15230:15232] CHIP:TOO: [1]: { - [1690183637.107753][15230:15232] CHIP:TOO: Value: 16386 - [1690183637.107765][15230:15232] CHIP:TOO: } - [1690183637.107774][15230:15232] CHIP:TOO: } - [1690183637.107793][15230:15232] CHIP:TOO: [3]: { - [1690183637.107801][15230:15232] CHIP:TOO: Label: Deep clean - [1690183637.107811][15230:15232] CHIP:TOO: Mode: 2 - [1690183637.107823][15230:15232] CHIP:TOO: ModeTags: 2 entries - [1690183637.107837][15230:15232] CHIP:TOO: [1]: { - [1690183637.107846][15230:15232] CHIP:TOO: Value: 7 - [1690183637.107856][15230:15232] CHIP:TOO: } - [1690183637.107885][15230:15232] CHIP:TOO: [2]: { - [1690183637.107888][15230:15232] CHIP:TOO: Value: 16384 - [1690183637.107890][15230:15232] CHIP:TOO: } - [1690183637.107894][15230:15232] CHIP:TOO: } - disabled: true - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: RVCCLEANM.S.C00.Rsp - verification: | - ./chip-tool rvccleanmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690183675.346665][15234:15236] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Command 0x0000_0001 - [1690183675.346731][15234:15236] CHIP:TOO: ChangeToModeResponse: { - [1690183675.346753][15234:15236] CHIP:TOO: status: 0 - [1690183675.346768][15234:15236] CHIP:TOO: } - disabled: true - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - disabled: true - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: RVCCLEANM.S.A0002 - verification: | - ./chip-tool rvccleanmode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer - - Save the value as startup_mode_dut and below is the sample log provided for the raspi platform, Here StartUpMode value is 0 - - [1690545840.189340][3104:3106] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0002 DataVersion: 3338736524 - [1690545840.189408][3104:3106] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: RVCCLEANM.S.A0001 - verification: | - ./chip-tool rvccleanmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690347752.080278][43423:43425] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0055 Attribute 0x0000_0001 DataVersion: 1382495026 - [1690347752.080330][43423:43425] CHIP:TOO: CurrentMode: 0 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_2_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_2_2.yaml index bd3287652a5fdf..d3e2f0226362b0 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCOPSTATE_2_2.yaml @@ -24,90 +24,168 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + Note: The test case includes preconditions with the PICS codes for start and stop. If the PICS are not supported, the test should be skipped. + + This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + disabled: true + - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)" verification: | - + RVCOPSTATE.S.C02.Rsp(Start) and RVCOPSTATE.S.C01.Rsp(Stop) disabled: true - label: "Step 2: Manually put the DUT into a state wherein it can receive a Start Command" verification: | - + Manually put the DUT into a state wherein it can receive a Start Command disabled: true - label: "Step 3: TH reads from the DUT the OperationalStateList attribute" PICS: RVCOPSTATE.S.A0003 verification: | - ./chip-tool roboticvacuumoperationalstate read operationalstatelist 1 1 - - Via the TH (chip-tool), verify: - - all entries include an ID (enum8) and a label (string) - - all provided IDs are in the allowed range - - the list includes IDs for Error (0x03), Running (0x01), and Stopped (0x00) + ./chip-tool rvcoperationalstate read operational-state-list 1 1 + + Via the TH (chip-tool), verify: + - all entries include an ID (enum8) and a label (string) + - all provided IDs are in the allowed range + - the list includes IDs for Error (0x03), Running (0x01), and Stopped (0x00) + + [1689674049.504261][17222:17224] CHIP:DMG: } + [1689674049.504390][17222:17224] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0003 DataVersion: 2102885775 + [1689674049.504440][17222:17224] CHIP:TOO: OperationalStateList: 4 entries + [1689674049.504462][17222:17224] CHIP:TOO: [1]: { + [1689674049.504469][17222:17224] CHIP:TOO: OperationalStateID: 0 + [1689674049.504476][17222:17224] CHIP:TOO: } + [1689674049.504484][17222:17224] CHIP:TOO: [2]: { + [1689674049.504490][17222:17224] CHIP:TOO: OperationalStateID: 1 + [1689674049.504495][17222:17224] CHIP:TOO: } + [1689674049.504503][17222:17224] CHIP:TOO: [3]: { + [1689674049.504508][17222:17224] CHIP:TOO: OperationalStateID: 2 + [1689674049.504514][17222:17224] CHIP:TOO: } + [1689674049.504521][17222:17224] CHIP:TOO: [4]: { + [1689674049.504527][17222:17224] CHIP:TOO: OperationalStateID: 3 + [1689674049.504533][17222:17224] CHIP:TOO: } + [1689674049.504605][17222:17224] CHIP:EM: <<< [E:22830i S:37151 M:4250114 (Ack:140781365)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674049.504620][17222:17224] CHIP:IN: (S) Sending msg 4250114 on secure session with LSID: 37151 disabled: true - label: "Step 4: TH sends Start command to the DUT" PICS: RVCOPSTATE.S.C02.Rsp && RVCOPSTATE.S.C04.Tx verification: | - ./chip-tool roboticvacuumoperationalstate start 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) + ./chip-tool rvcoperationalstate start 1 1 + + Via the TH (chip-tool), verify: + - the response is an instance of OperationalCommandResponse + - The ErrorStateID field is set to 0x00 (NoError) + + [1689674139.018639][17233:17235] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0060 Command=0x0000_0004 + [1689674139.018658][17233:17235] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Command 0x0000_0004 + [1689674139.018704][17233:17235] CHIP:TOO: OperationalCommandResponse: { + [1689674139.018712][17233:17235] CHIP:TOO: commandResponseState: { + [1689674139.018719][17233:17235] CHIP:TOO: ErrorStateID: 0 + [1689674139.018726][17233:17235] CHIP:TOO: } + [1689674139.018732][17233:17235] CHIP:TOO: } + [1689674139.018755][17233:17235] CHIP:DMG: ICR moving to [AwaitingDe] + [1689674139.018818][17233:17235] CHIP:EM: <<< [E:26021i S:33879 M:235550100 (Ack:58905970)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674139.018837][17233:17235] CHIP:IN: (S) Sending msg 235550100 on secure session with LSID: 33879 + [1689674139.018885][17233:17235] CHIP:EM: Flushed pending ack for MessageCounter:58905970 on exchange 26021i disabled: true - label: "Step 5: TH reads from the DUT the OperationalState attribute" PICS: RVCOPSTATE.S.A0004 verification: | - ./chip-tool roboticvacuumoperationalstate read operationalstate 1 1 + ./chip-tool rvcoperationalstate read operational-state 1 1 Via the TH (chip-tool), verify: - - the response has an operationalstateID field that is set to 0x01 (Running) + - the response has an OperationalStateID field that is set to 0x01 (Running) + + [1689674196.878722][17249:17251] CHIP:DMG: InteractionModelRevision = 1 + [1689674196.878727][17249:17251] CHIP:DMG: } + [1689674196.878800][17249:17251] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0004 DataVersion: 2102885775 + [1689674196.878834][17249:17251] CHIP:TOO: OperationalState: { + [1689674196.878841][17249:17251] CHIP:TOO: OperationalStateID: 1 + [1689674196.878847][17249:17251] CHIP:TOO: } + [1689674196.878914][17249:17251] CHIP:EM: <<< [E:56939i S:28614 M:63040141 (Ack:57012545)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674196.878928][17249:17251] CHIP:IN: (S) Sending msg 63040141 on secure session with LSID: 28614 disabled: true - label: "Step 6: TH reads from the DUT the OperationalError attribute" PICS: RVCOPSTATE.S.A0005 verification: | - ./chip-tool roboticvacuumoperationalstate read countdowntime 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of a uint32 + ./chip-tool rvcoperationalstate read operational-error 1 1 + + Via the TH (chip-tool), verify: + - the response contains the ErrorStateId set to NoError(0x00) + + [1689674342.832448][17274:17276] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0005 DataVersion: 2102885775 + [1689674342.832482][17274:17276] CHIP:TOO: OperationalError: { + [1689674342.832500][17274:17276] CHIP:TOO: ErrorStateID: 0 + [1689674342.832509][17274:17276] CHIP:TOO: } + [1689674342.832570][17274:17276] CHIP:EM: <<< [E:37158i S:10451 M:72875113 (Ack:195983315)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674342.832585][17274:17276] CHIP:IN: (S) Sending msg 72875113 on secure session with LSID: 10451 + [1689674342.832614][17274:17276] CHIP:EM: Flushed pending ack for MessageCounter:195983315 on exchange 37158i disabled: true - label: "Step 7: TH reads from the DUT the CountdownTime attribute" PICS: RVCOPSTATE.S.A0002 verification: | - ./chip-tool roboticvacuumoperationalstate read countdowntime 1 1 - - Via the TH (chip-tool), verify: - - that CountdownTime attribute contains either null our a uint32 value - - if non-null, verify that the value is in the range 1 to 259200 - - store the value in 'initialcountdown-time' + ./chip-tool rvcoperationalstate read countdown-time 1 1 + + Via the TH (chip-tool), verify: + - that CountdownTime attribute contains either null our a uint32 value + - if non-null, verify that the value is in the range 1 to 259200 + - store the value in 'initialcountdown-time' + + [1689674384.271623][17278:17280] CHIP:DMG: InteractionModelRevision = 1 + [1689674384.271625][17278:17280] CHIP:DMG: } + [1689674384.271649][17278:17280] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0002 DataVersion: 2102885775 + [1689674384.271662][17278:17280] CHIP:TOO: CountdownTime: null + [1689674384.271683][17278:17280] CHIP:EM: <<< [E:24665i S:47371 M:757241 (Ack:152992659)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674384.271687][17278:17280] CHIP:IN: (S) Sending msg 757241 on secure session with LSID: 47371 + [1689674384.271696][17278:17280] CHIP:EM: Flushed pending ack for MessageCounter:152992659 on exchange 24665i disabled: true - label: "Step 8: TH reads from the DUT the PhaseList attribute" PICS: RVCOPSTATE.S.A0000 verification: | - ./chip-tool roboticvacuumoperationalstate read phaselist 1 1 + ./chip-tool rvcoperationalstate read phase-list 1 1 - Via the TH (chip-tool), verify: - - that PhaseList attribute value contains either null or a list of strings. + Via the TH (chip-tool), verify: + - that PhaseList attribute value contains either null or a list of strings. - If not null, receord the number of entries in the list as 'phase-list-size'; execute step 7. - If null, go to step 8. + If not null, receord the number of entries in the list as 'phase-list-size'; execute step 7. + If null, go to step 8. + + [1689674447.761859][17290:17292] CHIP:DMG: InteractionModelRevision = 1 + [1689674447.761865][17290:17292] CHIP:DMG: } + [1689674447.761938][17290:17292] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0000 DataVersion: 2102885775 + [1689674447.761972][17290:17292] CHIP:TOO: PhaseList: null + [1689674447.762041][17290:17292] CHIP:EM: <<< [E:58737i S:13847 M:251354926 (Ack:137738036)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674447.762055][17290:17292] CHIP:IN: (S) Sending msg 251354926 on secure session with LSID: 13847 + [1689674447.762109][17290:17292] CHIP:EM: Flushed pending ack for MessageCounter:137738036 on exchange 58737i disabled: true - label: "Step 9: TH reads from the DUT the CurrentPhase attribute" PICS: RVCOPSTATE.S.A0001 verification: | - ./chip-tool roboticvacuumoperationalstate read currentphase 1 1 - - Via the TH (chip-tool), verify: - - that the CurrentPhase attribute value contains contains a uint8 value - - that the value is between 0 and 'phase-list-size - 1'. + ./chip-tool rvcoperationalstate read current-phase 1 1 + + Via the TH (chip-tool), verify: + - that the CurrentPhase attribute value contains contains a uint8 value + - that the value is between 0 and 'phase-list-size - 1'. + + [1689674497.950563][17299:17301] CHIP:DMG: } + [1689674497.950635][17299:17301] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0001 DataVersion: 2102885775 + [1689674497.950664][17299:17301] CHIP:TOO: CurrentPhase: null + [1689674497.950737][17299:17301] CHIP:EM: <<< [E:64019i S:52010 M:245677798 (Ack:138696372)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674497.950752][17299:17301] CHIP:IN: (S) Sending msg 245677798 on secure session with LSID: 52010 + [1689674497.950798][17299:17301] CHIP:EM: Flushed pending ack for MessageCounter:138696372 on exchange 64019i + [1689674497.950899][17299:17299] CHIP:CTL: Shutting down the commissioner disabled: true - label: @@ -115,72 +193,142 @@ tests: of time less than the expected duration of the operation that has been started" verification: | - + TH waits for a vendor defined wait time, this being a period of time less than the expected duration of the operation that has been started disabled: true - label: "Step 11: TH reads from the DUT the CountdownTime attribute" PICS: RVCOPSTATE.S.A0002 verification: | - ./chip-tool roboticvacuumoperationalstate read countdowntime 1 1 + ./chip-tool rvcoperationalstate read countdown-time 1 1 - Via the TH (chip-tool), verify: - - that CountdownTime attribute contains either null our a uint32 value - - if non-null, verify that the value is in the range 1 to 259200 - - that the value is approximately 'initialcountdown-time minus the vendor defined wait time' + + Via the TH (chip-tool), verify: + - that CountdownTime attribute contains either null our a uint32 value + - if non-null, verify that the value is in the range 1 to 259200 + - that the value is approximately 'initialcountdown-time minus the vendor defined wait time' + + + [1689674623.673661][17320:17322] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0002 DataVersion: 2102885775 + [1689674623.673697][17320:17322] CHIP:TOO: CountdownTime: null + [1689674623.673755][17320:17322] CHIP:EM: <<< [E:42152i S:37580 M:19654175 (Ack:176515710)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674623.673768][17320:17322] CHIP:IN: (S) Sending msg 19654175 on secure session with LSID: 37580 + [1689674623.673795][17320:17322] CHIP:EM: Flushed pending ack for MessageCounter:176515710 on exchange 42152i disabled: true - label: "Step 12: TH sends Start command to the DUT" PICS: RVCOPSTATE.S.C02.Rsp && RVCOPSTATE.S.C04.Tx verification: | - ./chip-tool roboticvacuumoperationalstate start 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) + ./chip-tool rvcoperationalstate start 1 1 + + Via the TH (chip-tool), verify: + - the response is an instance of OperationalCommandResponse + - The ErrorStateID field is set to 0x00 (NoError) + + [1689674637.555734][17326:17328] CHIP:DMG: + [1689674637.555742][17326:17328] CHIP:DMG: InteractionModelRevision = 1 + [1689674637.555751][17326:17328] CHIP:DMG: }, + [1689674637.555784][17326:17328] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0060 Command=0x0000_0004 + [1689674637.555805][17326:17328] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Command 0x0000_0004 + [1689674637.555853][17326:17328] CHIP:TOO: OperationalCommandResponse: { + [1689674637.555862][17326:17328] CHIP:TOO: commandResponseState: { + [1689674637.555872][17326:17328] CHIP:TOO: ErrorStateID: 0 + [1689674637.555883][17326:17328] CHIP:TOO: } + [1689674637.555891][17326:17328] CHIP:TOO: } + [1689674637.555913][17326:17328] CHIP:DMG: ICR moving to [AwaitingDe] + [1689674637.555956][17326:17328] CHIP:EM: <<< [E:28742i S:49023 M:139320570 (Ack:91983883)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674637.555971][17326:17328] CHIP:IN: (S) Sending msg 139320570 on secure session with LSID: 49023 + [1689674637.556001][17326:17328] CHIP:EM: Flushed pending ack for MessageCounter:91983883 on exchange 28742i disabled: true - label: "Step 13: TH sends Stop command to the DUT" PICS: RVCOPSTATE.S.C01.Rsp && RVCOPSTATE.S.C04.Tx verification: | - ./chip-tool roboticvacuumoperationalstate stop 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) + ./chip-tool rvcoperationalstate stop 1 1 + + Via the TH (chip-tool), verify: + - the response is an instance of OperationalCommandResponse + - The ErrorStateID field is set to 0x00 (NoError) + + [1689674653.322963][17330:17332] CHIP:DMG: }, + [1689674653.322994][17330:17332] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0060 Command=0x0000_0004 + [1689674653.323014][17330:17332] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Command 0x0000_0004 + [1689674653.323058][17330:17332] CHIP:TOO: OperationalCommandResponse: { + [1689674653.323066][17330:17332] CHIP:TOO: commandResponseState: { + [1689674653.323076][17330:17332] CHIP:TOO: ErrorStateID: 0 + [1689674653.323085][17330:17332] CHIP:TOO: } + [1689674653.323094][17330:17332] CHIP:TOO: } + [1689674653.323113][17330:17332] CHIP:DMG: ICR moving to [AwaitingDe] + [1689674653.323154][17330:17332] CHIP:EM: <<< [E:62878i S:64455 M:173921517 (Ack:216732582)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674653.323168][17330:17332] CHIP:IN: (S) Sending msg 173921517 on secure session with LSID: 64455 + [1689674653.323195][17330:17332] CHIP:EM: Flushed pending ack for MessageCounter:216732582 on exchange 62878i + [1689674653.323284][17330:17330] CHIP:CTL: Shutting down the commissioner disabled: true - label: "Step 14: TH reads from the DUT the OperationalState attribute" PICS: RVCOPSTATE.S.A0004 verification: | - ./chip-tool roboticvacuumoperationalstate read operationalstate 1 1 - - Via the TH (chip-tool), verify: - - the response has an operationalstateID field that is set to 0x00 (Stopped) + ./chip-tool rvcoperationalstate read operational-state 1 1 + + Via the TH (chip-tool), verify: + - the response has an OperationalStateID field that is set to 0x00 (Stopped) + + [1689674675.459656][17333:17335] CHIP:DMG: } + [1689674675.459738][17333:17335] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Attribute 0x0000_0004 DataVersion: 2102885775 + [1689674675.459772][17333:17335] CHIP:TOO: OperationalState: { + [1689674675.459790][17333:17335] CHIP:TOO: OperationalStateID: 0 + [1689674675.459799][17333:17335] CHIP:TOO: } + [1689674675.459869][17333:17335] CHIP:EM: <<< [E:17771i S:16165 M:1572532 (Ack:102448631)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674675.459886][17333:17335] CHIP:IN: (S) Sending msg 1572532 on secure session with LSID: 16165 + [1689674675.459930][17333:17335] CHIP:EM: Flushed pending ack for MessageCounter:102448631 on exchange 17771i disabled: true - label: "Step 15: TH sends Stop command to the DUT" PICS: RVCOPSTATE.S.C01.Rsp && RVCOPSTATE.S.C04.Tx verification: | - ./chip-tool roboticvacuumoperationalstate stop 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x00 (NoError) + ./chip-tool rvcoperationalstate stop 1 1 + + Via the TH (chip-tool), verify: + - the response is an instance of OperationalCommandResponse + - The ErrorStateID field is set to 0x00 (NoError) + + [1689674689.588712][17337:17339] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0060 Command=0x0000_0004 + [1689674689.588722][17337:17339] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Command 0x0000_0004 + [1689674689.588745][17337:17339] CHIP:TOO: OperationalCommandResponse: { + [1689674689.588749][17337:17339] CHIP:TOO: commandResponseState: { + [1689674689.588757][17337:17339] CHIP:TOO: ErrorStateID: 0 + [1689674689.588762][17337:17339] CHIP:TOO: } + [1689674689.588765][17337:17339] CHIP:TOO: } + [1689674689.588775][17337:17339] CHIP:DMG: ICR moving to [AwaitingDe] + [1689674689.588802][17337:17339] CHIP:EM: <<< [E:63921i S:35027 M:16881995 (Ack:220265764)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674689.588810][17337:17339] CHIP:IN: (S) Sending msg 16881995 on secure session with LSID: 35027 disabled: true - label: "Step 16: Manually put the DUT into a state wherein it cannot receive a Start Command" verification: | - + Manually put the DUT into a state wherein it cannot receive a Start Command disabled: true - label: "Step 17: TH sends Start command to the DUT" PICS: RVCOPSTATE.S.C02.Rsp && RVCOPSTATE.S.C04.Tx verification: | - ./chip-tool roboticvacuumoperationalstate start 1 1 - - Via the TH (chip-tool), verify: - - the response is an instance of OperationalCommandResponse - - The ErrorStateID field is set to 0x01 (UnableToStartOrResume) + ./chip-tool rvcoperationalstate start 1 1 + + Via the TH (chip-tool), verify: + - the response is an instance of OperationalCommandResponse + - The ErrorStateID field is set to 0x01 (UnableToStartOrResume) + + [1689674700.385183][17340:17342] CHIP:DMG: }, + [1689674700.385214][17340:17342] CHIP:DMG: Received Command Response Data, Endpoint=1 Cluster=0x0000_0060 Command=0x0000_0004 + [1689674700.385233][17340:17342] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0061 Command 0x0000_0004 + [1689674700.385266][17340:17342] CHIP:TOO: OperationalCommandResponse: { + [1689674700.385274][17340:17342] CHIP:TOO: commandResponseState: { + [1689674700.385281][17340:17342] CHIP:TOO: ErrorStateID: 1 + [1689674700.385289][17340:17342] CHIP:TOO: } + [1689674700.385295][17340:17342] CHIP:TOO: } + [1689674700.385311][17340:17342] CHIP:DMG: ICR moving to [AwaitingDe] + [1689674700.385361][17340:17342] CHIP:EM: <<< [E:55029i S:46795 M:80501191 (Ack:176711722)] (S) Msg TX to 1:0000000000000001 [BFDE] --- Type 0000:10 (SecureChannel:StandaloneAck) + [1689674700.385375][17340:17342] CHIP:IN: (S) Sending msg 80501191 on secure session with LSID: 46795 + [1689674700.385419][17340:17342] CHIP:EM: Flushed pending ack for MessageCounter:176711722 on exchange 55029i disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml deleted file mode 100644 index 5e699c00a4ce9b..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_1_2.yaml +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 87.2.1. [TC-RVCRUNM-1.2] Cluster attributes with DUT as Server - -PICS: - - RVCRUNM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Preconditions" - verification: | - This test case is verified after the device is provisioned. Pls provision device first, Pass appropriate nodeID in the below command - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: RVCRUNM.S.A0000 - verification: | - ./chip-tool rvcrunmode read supported-modes 1 1 - - Verify that the DUT response contains list of ModeOptionsStruct entries. - - Verify that the list has at least 2 and at most 255 entries - - Verify that each ModeOptionsStruct entry has a unique Mode field value and Label field value - - If ModeOptionsStruct entry’s ModeTags field is not empty, then Verify the values of the Value fields that are not larger than 16 bits, for each Value field: Is the semantic tag value a defined common tag value (Auto(0x0000), Quick(0x0001), Quiet(0x0002), LowNoise(0x0003), LowEnergy(0x0004), Vacation(0x0005), Min(0x0006), Max(0x0007), Night(0x0008), Day(0x0009)) a defined cluster derived tag value (Idle(0x4000), Cleaning(0x4001)) or in the MfgTags (0x8000 to 0xBFFF) range - - If the Value field is in the MfgTags (0x8000 to 0xBFFF) range, the TagName field is a string with a length between 1 and 64 - - Verify that at least one ModeOptionsStruct entry includes the Idle(0x4000) mode tag in the ModeTags field - - Verify that at least one ModeOptionsStruct entry includes the Cleaning(0x4001) mode tag in the ModeTags field - - Verify that none of the ModeOptionsStruct entries include both the Idle(0x4000) mode tag and the Cleaning(0x4001) mode tag in the ModeTags field - - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690177496.793840][6284:6286] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 551764487 - [1690177496.794090][6284:6286] CHIP:TOO: SupportedModes: 3 entries - [1690177496.794285][6284:6286] CHIP:TOO: [1]: { - [1690177496.794343][6284:6286] CHIP:TOO: Label: Idle - [1690177496.794396][6284:6286] CHIP:TOO: Mode: 0 - [1690177496.794457][6284:6286] CHIP:TOO: ModeTags: 1 entries - [1690177496.794573][6284:6286] CHIP:TOO: [1]: { - [1690177496.794631][6284:6286] CHIP:TOO: Value: 16384 - [1690177496.794682][6284:6286] CHIP:TOO: } - [1690177496.794737][6284:6286] CHIP:TOO: } - [1690177496.794809][6284:6286] CHIP:TOO: [2]: { - [1690177496.794861][6284:6286] CHIP:TOO: Label: Cleaning - [1690177496.794910][6284:6286] CHIP:TOO: Mode: 1 - [1690177496.794967][6284:6286] CHIP:TOO: ModeTags: 1 entries - [1690177496.795031][6284:6286] CHIP:TOO: [1]: { - [1690177496.795085][6284:6286] CHIP:TOO: Value: 16385 - [1690177496.795135][6284:6286] CHIP:TOO: } - [1690177496.795186][6284:6286] CHIP:TOO: } - [1690177496.795257][6284:6286] CHIP:TOO: [3]: { - [1690177496.795309][6284:6286] CHIP:TOO: Label: Mapping - [1690177496.795358][6284:6286] CHIP:TOO: Mode: 2 - [1690177496.795415][6284:6286] CHIP:TOO: ModeTags: 1 entries - [1690177496.795478][6284:6286] CHIP:TOO: [1]: { - [1690177496.795531][6284:6286] CHIP:TOO: Value: 16384 - [1690177496.795581][6284:6286] CHIP:TOO: } - [1690177496.795632][6284:6286] CHIP:TOO: } - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer from supported_modes_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690177606.359517][6295:6297] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 551764487 - [1690177606.359639][6295:6297] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 4: TH reads from the DUT the OnMode attribute." - PICS: RVCRUNM.S.A0003 - verification: | - ./chip-tool rvcrunmode read on-mode 1 1 - - Verify on TH(chip-tool) logs, OnMode attribute value is an integer and the value is from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here OnMode attribute value is Null - - [1690177656.364979][6304:6306] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0003 DataVersion: 551764487 - [1690177656.365109][6304:6306] CHIP:TOO: OnMode: null - disabled: true - - - label: "Step 5: TH reads from the DUT the StartUpMode attribute." - PICS: RVCRUNM.S.A0002 - verification: | - ./chip-tool rvcrunmode read start-up-mode 1 1 - - Verify on TH(chip-tool) logs, StartUpMode attribute value is an integer and value is from supported_modes_dut or null, below is the sample log provided for the raspi platform, Here StartUpMode attribute value is Null - - [1690177698.954736][6311:6313] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 551764487 - [1690177698.954865][6311:6313] CHIP:TOO: StartUpMode: null - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml deleted file mode 100644 index 3e96b215b81fa6..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_2_1.yaml +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 87.3.1. [TC-RVCRUNM-2.1] Change to Mode functionality with DUT as Server - -PICS: - - RVCRUNM.S - -config: - nodeId: "0x12344321" - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the SupportedModes attribute." - PICS: RVCRUNM.S.A0000 - verification: | - ./chip-tool rvcrunmode read supported-modes 1 1 - - Verify that the DUT response contains list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut on the TH (Chip-tool) and below is the sample log provided for the raspi platform: - - [1690177742.429087][6315:6317] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 551764487 - [1690177742.429341][6315:6317] CHIP:TOO: SupportedModes: 3 entries - [1690177742.429483][6315:6317] CHIP:TOO: [1]: { - [1690177742.429540][6315:6317] CHIP:TOO: Label: Idle - [1690177742.429595][6315:6317] CHIP:TOO: Mode: 0 - [1690177742.429658][6315:6317] CHIP:TOO: ModeTags: 1 entries - [1690177742.429732][6315:6317] CHIP:TOO: [1]: { - [1690177742.429791][6315:6317] CHIP:TOO: Value: 16384 - [1690177742.429842][6315:6317] CHIP:TOO: } - [1690177742.429892][6315:6317] CHIP:TOO: } - [1690177742.429967][6315:6317] CHIP:TOO: [2]: { - [1690177742.430020][6315:6317] CHIP:TOO: Label: Cleaning - [1690177742.430070][6315:6317] CHIP:TOO: Mode: 1 - [1690177742.430188][6315:6317] CHIP:TOO: ModeTags: 1 entries - [1690177742.430263][6315:6317] CHIP:TOO: [1]: { - [1690177742.430320][6315:6317] CHIP:TOO: Value: 16385 - [1690177742.430374][6315:6317] CHIP:TOO: } - [1690177742.430427][6315:6317] CHIP:TOO: } - [1690177742.430501][6315:6317] CHIP:TOO: [3]: { - [1690177742.430555][6315:6317] CHIP:TOO: Label: Mapping - [1690177742.430605][6315:6317] CHIP:TOO: Mode: 2 - [1690177742.430664][6315:6317] CHIP:TOO: ModeTags: 1 entries - [1690177742.430729][6315:6317] CHIP:TOO: [1]: { - [1690177742.430784][6315:6317] CHIP:TOO: Value: 16384 - [1690177742.430901][6315:6317] CHIP:TOO: } - [1690177742.430966][6315:6317] CHIP:TOO: } - disabled: true - - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut - - Select a value which is NOT in supported_modes_dut and save it as invalid_mode_th, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690177776.069002][6321:6323] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 551764487 - [1690177776.069137][6321:6323] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 4: TH sends a ChangeToMode command to the DUT with NewMode set - to old_current_mode_dut" - PICS: RVCRUNM.S.C00.Rsp - verification: | - ./chip-tool rvcrunmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690177967.451381][6333:6335] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690177967.451491][6333:6335] CHIP:TOO: ChangeToModeResponse: { - [1690177967.451542][6333:6335] CHIP:TOO: status: 0 - [1690177967.451590][6333:6335] CHIP:TOO: } - disabled: true - - - label: - "Step 5: Manually put the device in a state from which it will FAIL to - transition to PIXIT.RVCRUNM.MODE_CHANGE_FAIL" - PICS: RVCRUNM.S.M.CAN_TEST_MODE_FAILURE - verification: | - Manual operation required - disabled: true - - - label: "Step 6: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 - - [1690202974.725219][18214:18216] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2507484088 - [1690202974.725506][18214:18216] CHIP:TOO: CurrentMode: 1 - disabled: true - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to PIXIT.RVCRUNM.MODE_CHANGE_FAIL" - PICS: RVCRUNM.S.M.CAN_TEST_MODE_FAILURE && RVCRUNM.S.C00.Rsp - verification: | - ./chip-tool rvcrunmode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a GenericFailure(0x02) status response and StatusText field has a length between 1 to 64, below is the sample log provided for the raspi platform: - - [1690178461.944185][6368:6370] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690178461.944369][6368:6370] CHIP:TOO: ChangeToModeResponse: { - [1690178461.944457][6368:6370] CHIP:TOO: status: 2 - [1690178461.944517][6368:6370] CHIP:TOO: statusText: Change to the mapping mode is only allowed from idle - [1690178461.944578][6368:6370] CHIP:TOO: } - disabled: true - - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool), CurrentMode attribute value is an integer value and equal to old_current_mode_dut below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 - - [1690203073.106487][18256:18258] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915104 - [1690203073.106525][18256:18258] CHIP:TOO: CurrentMode: 1 - disabled: true - - - label: - "Step 9: Manually put the device in a state from which it will - SUCCESSFULLY transition to PIXIT.RVCRUNM.MODE_CHANGE_OK" - verification: | - Manual operation required - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value, - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 1 - - [1690203090.571985][18263:18265] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915104 - [1690203090.571996][18263:18265] CHIP:TOO: CurrentMode: 1 - disabled: true - - - label: - "Step 11: TH sends a ChangeToMode command to the DUT with NewMode set - to PIXIT.RVCRUNM.MODE_CHANGE_OK" - PICS: RVCRUNM.S.C00.Rsp - verification: | - ./chip-tool rvcrunmode change-to-mode 0 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690178355.021382][6358:6360] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690178355.021533][6358:6360] CHIP:TOO: ChangeToModeResponse: { - [1690178355.021692][6358:6360] CHIP:TOO: status: 0 - [1690178355.021750][6358:6360] CHIP:TOO: } - disabled: true - - - label: "Step 12: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 11, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690203144.862081][18275:18277] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915105 - [1690203144.862121][18275:18277] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: - "Step 13: TH sends a ChangeToMode command to the DUT with NewMode set - to invalid_mode_th" - PICS: RVCRUNM.S.C00.Rsp - verification: | - ./chip-tool rvcrunmode change-to-mode 5 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a UnsupportedMode(0x01) status response and below is the sample log provided for the raspi platform: - - [1690178736.566529][6381:6383] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690178736.566677][6381:6383] CHIP:TOO: ChangeToModeResponse: { - [1690178736.566761][6381:6383] CHIP:TOO: status: 1 - [1690178736.566816][6381:6383] CHIP:TOO: } - disabled: true - - - label: "Step 14: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - Verify on TH(chip-tool) logs, CurrentMode attribute value is an integer value and same as step 12, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690203158.762178][18282:18284] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 468915105 - [1690203158.762194][18282:18284] CHIP:TOO: CurrentMode: 0 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml index bfd9e262eeabf2..5bb88f11b6943d 100644 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_1.yaml @@ -11,159 +11,119 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 87.4.1. [TC-RVCRUNM-3.1] On Mode functionality with DUT as Server PICS: - - RVCRUNM.S + - RVCRUNM.S.A0003 + - RVCRUNM.S.F00 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "RVC Run Mode" + endpoint: 1 -tests: - - label: "Precondition" - verification: | - 1. RVC Run Mode and OnOff clusters are available on the same endpoint - - 2. The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - disabled: true - - - label: "Note" - verification: | - To execute this test case set onmode to any integer value because as default it value has null. - - ./chip-tool rvcrunmode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690178870.051558][6396:6398] CHIP:DMG: StatusIB = - [1690178870.051652][6396:6398] CHIP:DMG: { - [1690178870.051727][6396:6398] CHIP:DMG: status = 0x00 (SUCCESS), - [1690178870.051799][6396:6398] CHIP:DMG: }, - disabled: true + ConfigureOnMode: + type: int8u + defaultValue: 0 + new_mode_th: + type: int8u + defaultValue: 1 +tests: - label: "Step 1: Commission DUT to TH (can be skipped if done in a preceding test)." - verification: | - - disabled: true + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Precondition: TH writes from the DUT the OnMode attribute." + PICS: RVCRUNM.S.A0003 && RVCRUNM.S.F00 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: ConfigureOnMode - label: "Step 2: TH reads from the DUT the OnMode attribute." PICS: RVCRUNM.S.A0003 && RVCRUNM.S.F00 - verification: | - ./chip-tool rvcrunmode read on-mode 1 1 - - On TH(chip-tool), Verify that OnMode attribute value is an integer - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - [1690265382.010747][30073:30075] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0003 DataVersion: 172461204 - [1690265382.010769][30073:30075] CHIP:TOO: OnMode: 0 - disabled: true + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - label: "Step 3: TH reads from the DUT the CurrentMode attribute." PICS: RVCRUNM.S.A0001 && RVCRUNM.S.F00 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 - - NOTE: If on_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut + constraints: + type: int8u + minValue: 0 + maxValue: 254 - [1690179152.516820][6454:6456] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2795852718 - [1690179152.516952][6454:6456] CHIP:TOO: CurrentMode: 0 - disabled: true + - label: + "If on_mode_dut is equal to old_current_mode_dut proceed to step 4. + Else proceed to step 6." + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + runIf: IsExpectedValue PICS: RVCRUNM.S.A0000 && RVCRUNM.S.F00 - verification: | - ./chip-tool rvcrunmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th. below is the sample log provided for the raspi platform: - - [1690179211.761627][6462:6464] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 2795852718 - [1690179211.761873][6462:6464] CHIP:TOO: SupportedModes: 3 entries - [1690179211.762019][6462:6464] CHIP:TOO: [1]: { - [1690179211.762079][6462:6464] CHIP:TOO: Label: Idle - [1690179211.762131][6462:6464] CHIP:TOO: Mode: 0 - [1690179211.762193][6462:6464] CHIP:TOO: ModeTags: 1 entries - [1690179211.762265][6462:6464] CHIP:TOO: [1]: { - [1690179211.762324][6462:6464] CHIP:TOO: Value: 16384 - [1690179211.762376][6462:6464] CHIP:TOO: } - [1690179211.762429][6462:6464] CHIP:TOO: } - [1690179211.762502][6462:6464] CHIP:TOO: [2]: { - [1690179211.762555][6462:6464] CHIP:TOO: Label: Cleaning - [1690179211.762605][6462:6464] CHIP:TOO: Mode: 1 - [1690179211.762664][6462:6464] CHIP:TOO: ModeTags: 1 entries - [1690179211.762729][6462:6464] CHIP:TOO: [1]: { - [1690179211.762785][6462:6464] CHIP:TOO: Value: 16385 - [1690179211.762843][6462:6464] CHIP:TOO: } - [1690179211.762892][6462:6464] CHIP:TOO: } - [1690179211.762966][6462:6464] CHIP:TOO: [3]: { - [1690179211.763019][6462:6464] CHIP:TOO: Label: Mapping - [1690179211.763069][6462:6464] CHIP:TOO: Mode: 2 - [1690179211.763127][6462:6464] CHIP:TOO: ModeTags: 1 entries - [1690179211.763193][6462:6464] CHIP:TOO: [1]: { - [1690179211.763248][6462:6464] CHIP:TOO: Value: 16384 - [1690179211.763299][6462:6464] CHIP:TOO: } - [1690179211.763351][6462:6464] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 - label: "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th" + runIf: IsExpectedValue PICS: RVCRUNM.S.C00.Rsp && RVCRUNM.S.F00 - verification: | - ./chip-tool rvcrunmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690179263.329118][6471:6473] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690179263.329338][6471:6473] CHIP:TOO: ChangeToModeResponse: { - [1690179263.329435][6471:6473] CHIP:TOO: status: 0 - [1690179263.329489][6471:6473] CHIP:TOO: } - disabled: true - - - label: "Step 6: TH sends a Off command to the DUT" + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6:TH sends a Off command to the DUT" PICS: OO.S.C00.Rsp && RVCRUNM.S.F00 - verification: | - ./chip-tool onoff off 1 1 + cluster: "On/Off" + command: "Off" - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118656][20709:20711] CHIP:DMG: StatusIB = - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true - - - label: "Step 7: TH sends a On command to the DUT" + - label: "Step 7:TH sends a On command to the DUT" PICS: OO.S.C01.Rsp && RVCRUNM.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055514][20729:20731] CHIP:DMG: StatusIB = - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "On" - label: "Step 8: TH reads from the DUT the CurrentMode attribute." PICS: RVCRUNM.S.A0001 && RVCRUNM.S.F00 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 - - [1690179336.313000][6489:6491] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 2795852720 - [1690179336.313132][6489:6491] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml deleted file mode 100644 index 7ad4b2d59f0880..00000000000000 --- a/src/app/tests/suites/certification/Test_TC_RVCRUNM_3_2.yaml +++ /dev/null @@ -1,223 +0,0 @@ -# Copyright (c) 2023 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default - -name: 87.4.2. [TC-RVCRUNM-3.2] Startup Mode functionality with DUT as Server - -PICS: - - RVCRUNM.S - -config: - nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 - -tests: - - label: "Precondition" - verification: | - !RVCRUNM.S.F00(DEPONOFF) | OnOff cluster’s StartUpOnOff attribute is NULL | StartUpOnOff is 0 | OnMode is NULL - disabled: true - - - label: "Note" - verification: | - To Execute the TC-RVCRUNM-3.2 test case using reboot in raspi device we followed the below suggested way: - - To run a reboot test case on raspi, run the app with --KVS flag with a file in local directory and pass that file to the command to launch the app. Steps - - step-1: create a file using touch command , something like touch mytest.txt - step-2: chmod 777 mytest.txt - step-3: launch the app ./chip-all-clusters-app --KVS ./mytest.txt - - if you launch the app with the above commands and provision the app, even when you reboot the app with 'sudo reboot' , next time you launch the app with 'sudo ./out/all-clusters-app/chip-all-clusters-app --KVS ./mytest.txt' , you can run read/write attribs and commands without reprovisioning the device. - disabled: true - - - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the StartUpMode attribute." - PICS: RVCRUNM.S.A0002 - verification: | - ./chip-tool rvcrunmode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer. - - Save the value as startup_mode_dut - - If startup_mode_dut is null proceed to step 3. Else save startup_mode_dut as new_start_up_mode_th and proceed to step 5. - and below is the sample log provided for the raspi platform: - - Here StartUpMode value is null proced to step3 - - [1690543468.611591][2895:2897] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 2245114918 - [1690543468.611648][2895:2897] CHIP:TOO: StartUpMode: null - disabled: true - - - label: "Step 3: TH reads from the DUT the SupportedModes attribute." - PICS: RVCRUNM.S.A0000 - verification: | - ./chip-tool rvcrunmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut and save the value as new_start_up_mode_th, below is the sample log provided for the raspi platform: - - [1690179857.830697][14130:14132] CHIP:DMG: } - [1690179857.831035][14130:14132] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 290070852 - [1690179857.831058][14130:14132] CHIP:TOO: SupportedModes: 3 entries - [1690179857.831069][14130:14132] CHIP:TOO: [1]: { - [1690179857.831072][14130:14132] CHIP:TOO: Label: Idle - [1690179857.831077][14130:14132] CHIP:TOO: Mode: 0 - [1690179857.831082][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831090][14130:14132] CHIP:TOO: [1]: { - [1690179857.831093][14130:14132] CHIP:TOO: Value: 16384 - [1690179857.831096][14130:14132] CHIP:TOO: } - [1690179857.831099][14130:14132] CHIP:TOO: } - [1690179857.831104][14130:14132] CHIP:TOO: [2]: { - [1690179857.831107][14130:14132] CHIP:TOO: Label: Cleaning - [1690179857.831109][14130:14132] CHIP:TOO: Mode: 1 - [1690179857.831112][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831115][14130:14132] CHIP:TOO: [1]: { - [1690179857.831118][14130:14132] CHIP:TOO: Value: 16385 - [1690179857.831121][14130:14132] CHIP:TOO: } - [1690179857.831124][14130:14132] CHIP:TOO: } - [1690179857.831128][14130:14132] CHIP:TOO: [3]: { - [1690179857.831131][14130:14132] CHIP:TOO: Label: Mapping - [1690179857.831133][14130:14132] CHIP:TOO: Mode: 2 - [1690179857.831135][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831138][14130:14132] CHIP:TOO: [1]: { - [1690179857.831141][14130:14132] CHIP:TOO: Value: 16384 - [1690179857.831143][14130:14132] CHIP:TOO: } - [1690179857.831146][14130:14132] CHIP:TOO: } - disabled: true - - - label: - "Step 4: TH writes to the DUT the StartUpMode attribute with the - new_start_up_mode_th value" - PICS: RVCRUNM.S.A0002 - verification: | - ./chip-tool rvcrunmode write start-up-mode 0 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690179737.189558][14110:14112] CHIP:DMG: StatusIB = - [1690179737.189576][14110:14112] CHIP:DMG: { - [1690179737.189592][14110:14112] CHIP:DMG: status = 0x00 (SUCCESS), - [1690179737.189607][14110:14112] CHIP:DMG: }, - - ./chip-tool rvcrunmode read start-up-mode 1 1 - - On TH(chip-tool), Verify that StartUpMode attribute value is 0 and below is the sample log provided for the raspi platform - - [1692181154.909850][3899:3901] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 1431406601 - [1692181154.909907][3899:3901] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 5: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value - - Save the value as old_current_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - NOTE: If startup_mode_dut is equal to old_current_mode_dut proceed to step 6. Else proceed to step 8. - - [1690180034.919766][14170:14172] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 1228902958 - [1690180034.919778][14170:14172] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 6: TH reads from the DUT the SupportedModes attribute." - PICS: RVCRUNM.S.A0000 - verification: | - ./chip-tool rvcrunmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from startup_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690179857.830697][14130:14132] CHIP:DMG: } - [1690179857.831035][14130:14132] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0000 DataVersion: 290070852 - [1690179857.831058][14130:14132] CHIP:TOO: SupportedModes: 3 entries - [1690179857.831069][14130:14132] CHIP:TOO: [1]: { - [1690179857.831072][14130:14132] CHIP:TOO: Label: Idle - [1690179857.831077][14130:14132] CHIP:TOO: Mode: 0 - [1690179857.831082][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831090][14130:14132] CHIP:TOO: [1]: { - [1690179857.831093][14130:14132] CHIP:TOO: Value: 16384 - [1690179857.831096][14130:14132] CHIP:TOO: } - [1690179857.831099][14130:14132] CHIP:TOO: } - [1690179857.831104][14130:14132] CHIP:TOO: [2]: { - [1690179857.831107][14130:14132] CHIP:TOO: Label: Cleaning - [1690179857.831109][14130:14132] CHIP:TOO: Mode: 1 - [1690179857.831112][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831115][14130:14132] CHIP:TOO: [1]: { - [1690179857.831118][14130:14132] CHIP:TOO: Value: 16385 - [1690179857.831121][14130:14132] CHIP:TOO: } - [1690179857.831124][14130:14132] CHIP:TOO: } - [1690179857.831128][14130:14132] CHIP:TOO: [3]: { - [1690179857.831131][14130:14132] CHIP:TOO: Label: Mapping - [1690179857.831133][14130:14132] CHIP:TOO: Mode: 2 - [1690179857.831135][14130:14132] CHIP:TOO: ModeTags: 1 entries - [1690179857.831138][14130:14132] CHIP:TOO: [1]: { - [1690179857.831141][14130:14132] CHIP:TOO: Value: 16384 - [1690179857.831143][14130:14132] CHIP:TOO: } - [1690179857.831146][14130:14132] CHIP:TOO: } - disabled: true - - - label: - "Step 7: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" - PICS: RVCRUNM.S.C00.Rsp - verification: | - ./chip-tool rvcrunmode change-to-mode 1 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690179905.782387][14141:14143] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Command 0x0000_0001 - [1690179905.782401][14141:14143] CHIP:TOO: ChangeToModeResponse: { - [1690179905.782405][14141:14143] CHIP:TOO: status: 0 - [1690179905.782408][14141:14143] CHIP:TOO: } - disabled: true - - - label: "Step 8: Physically power cycle the device" - verification: | - Physically power cycle the device. - disabled: true - - - label: "Step 9: TH reads from the DUT the StartUpMode attribute." - PICS: RVCRUNM.S.A0002 - verification: | - ./chip-tool rvcrunmode read start-up-mode 1 1 - - On TH(chip-tool), Verify StartUpMode attribute value is an integer. - - Save the value as new_start_up_mode_dut and is equal to new_start_up_mode_th, below is the sample log provided for the raspi platform: - - Here StartUpMode value is 0 - - [1690544350.025546][2955:2957] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0002 DataVersion: 3877802510 - [1690544350.025630][2955:2957] CHIP:TOO: StartUpMode: 0 - disabled: true - - - label: "Step 10: TH reads from the DUT the CurrentMode attribute." - PICS: RVCRUNM.S.A0001 - verification: | - ./chip-tool rvcrunmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and is equal to new_start_up_mode_dut, below is the sample log provided for the raspi platform, Here CurrentMode attribute value is 0 - - [1690180034.919766][14170:14172] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0054 Attribute 0x0000_0001 DataVersion: 1228902958 - [1690180034.919778][14170:14172] CHIP:TOO: CurrentMode: 0 - disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_3_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_3_1.yaml index 3bd0f23cbcbe8d..f9b351f67019e2 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_3_1.yaml @@ -26,6 +26,7 @@ config: tests: - label: "Precondition" verification: | + 1. Underlying transport is reliable, either implicitly (i.e.: TCP) or explicitly (i.e.: MRP) execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT ./chip-all-clusters-app --trace_decode 1 @@ -117,7 +118,7 @@ tests: "Step 2: Responder validates the destination identifier contained in the message." verification: | - If the destination identifier matches a candidate destination id (as generated by the process in spec section 4.13.2.4), the responder proceeds to generate a Sigma 2 message. + disabled: true - label: @@ -198,14 +199,14 @@ tests: decrypts and verifies the message data, node operational certificate (NOC), and signature data." verification: | - If the verification succeeds, the initiator moves to the next step to send a Sigma3 message. + disabled: true - label: "Step 5: Initiator constructs and sends a TLV-encoded Sigma3 message containing encrypted integrity data." verification: | - Verify that the message is properly formatted: 1. I Flag is set to 1 2. S flag and DIZ fields of message flags are set to 0 3. Encryption Type of security flags is set to 0 4. The message payload follows the sigma-3-struct TLV encoding format 5. The Session Key Type field is set to 0 6. The Protocol ID field is set to 0 and Protocol Opcode field is set to 50 (0x32) Verify that the responder receives the message. + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_SC_3_2.yaml b/src/app/tests/suites/certification/Test_TC_SC_3_2.yaml index 92f9d547f20280..dcff7e274ca3de 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_3_2.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 3.3.2. [TC-SC-3.2] CASE Session Resumption [DUT_Responder] - REMOVEDPICS +name: 3.3.2. [TC-SC-3.2] CASE Session Resumption [DUT_Responder] - REMOVED PICS: - MCORE.ROLE.COMMISSIONEE @@ -24,47 +24,201 @@ config: endpoint: 0 tests: + - label: "Precondition" + verification: | + 1. Underlying transport is reliable, either implicitly (i.e.: TCP) or explicitly (i.e.: MRP) + 2. CASE was previously successfully completed between the initiator and responder and the previous session context is known by both nodes. + execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT + ./chip-all-clusters-app --trace_decode 1 + + Once DUT reach the commissionable state pls send below mentioned command on TH. Pls use equivalent command on the respective DUT + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + Verify the commissioning completed with success on TH(chip-tool) from DUT + [1650455358.501816][4366:4371] CHIP:TOO: Device commissioning completed with success + + # 1 Please use Interactive mode to Verify this test cases + Here the command to enter interactive mode:-- + ./chip-tool interactive start --trace_decode 1 + + #2. Close the session(all-clusters-app), by sending mentioned command + sessionmanagement send-close-session 1 --evict-local-session true + + After the session closed, wait until session resumtion for the previous subscribe request + once the session resumed succesfully then Verify the below test steps. + disabled: true + + - label: + "Step 1a: Send Read Request from Initiator (TH) to Responder (DUT) + Save the value as 'read response' Note: Example for Read Request could + be reading OnOff attribute value from OnOff Cluster" + verification: | + onoff read on-off 1 1 --trace_decode 1 + + + [1690205836.161742][5604:5607] CHIP:DMG: ReportDataMessage = + [1690205836.161751][5604:5607] CHIP:DMG: { + [1690205836.161758][5604:5607] CHIP:DMG: AttributeReportIBs = + [1690205836.161773][5604:5607] CHIP:DMG: [ + [1690205836.161781][5604:5607] CHIP:DMG: AttributeReportIB = + [1690205836.161796][5604:5607] CHIP:DMG: { + [1690205836.161804][5604:5607] CHIP:DMG: AttributeDataIB = + [1690205836.161816][5604:5607] CHIP:DMG: { + [1690205836.161828][5604:5607] CHIP:DMG: DataVersion = 0xf30c44a7, + [1690205836.161839][5604:5607] CHIP:DMG: AttributePathIB = + [1690205836.161850][5604:5607] CHIP:DMG: { + [1690205836.161862][5604:5607] CHIP:DMG: Endpoint = 0x1, + [1690205836.161873][5604:5607] CHIP:DMG: Cluster = 0x6, + [1690205836.161885][5604:5607] CHIP:DMG: Attribute = 0x0000_0000, + [1690205836.161896][5604:5607] CHIP:DMG: } + [1690205836.161911][5604:5607] CHIP:DMG: + [1690205836.161923][5604:5607] CHIP:DMG: Data = false, + [1690205836.161933][5604:5607] CHIP:DMG: }, + [1690205836.161949][5604:5607] CHIP:DMG: + [1690205836.161957][5604:5607] CHIP:DMG: }, + [1690205836.161973][5604:5607] CHIP:DMG: + [1690205836.161980][5604:5607] CHIP:DMG: ], + [1690205836.161995][5604:5607] CHIP:DMG: + [1690205836.162003][5604:5607] CHIP:DMG: SuppressResponse = true, + [1690205836.162038][5604:5607] CHIP:DMG: InteractionModelRevision = 1 + [1690205836.162048][5604:5607] CHIP:DMG: } + [1690205836.162552][5604:5607] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 4077667495 + [1690205836.162619][5604:5607] CHIP:TOO: OnOff: FALSE + disabled: true + + - label: + "Step 1b: Initiator (TH) sends a Close Session message to the + Responder (DUT)" + verification: | + sessionmanagement send-close-session 1 --evict-local-session true + + 281718.852349][27911:27911] CHIP:TOO: Command: sessionmanagement send-close-session 1 --evict-local-session true + [1690281718.852946][27911:27914] CHIP:CTL: Stopping commissioning discovery over DNS-SD + [1690281718.852990][27911:27914] CHIP:CTL: Setting attestation nonce to random value + disabled: true + + - label: + "Step 1c: Initiator triggers a CASE session resumption. This can be + accomplished in the TH using a read attribute command, which will + automatically trigger a session resumption before reading since it has + no active session." + verification: | + onoff read on-off 1 1 --trace-to json:log + disabled: true + - label: - "Step 1: Initiator constructs and sends a TLV-encoded Sigma1 message + "Step 2: Initiator constructs and sends a TLV-encoded Sigma1 message to Responder with resumption containing initiatorRandom initiatorSessionId destinationId resumptionID initiatorResumeMIC initiatorEphPubKey initiatorSessionParams" verification: | - On Initiator(chip-tool) verify that, Initiator(chip-tool) constructs and sends a TLV-encoded Sigma1 message to Responder with resumption containing - initiatorRandom - initiatorSessionId - destinationId - resumptionID - initiatorResumeMIC - initiatorEphPubKey - initiatorSessionParams - here is the log to verify on chip-tool - - 1683884120.041635][5134:5136] CHIP:DMG: Decrypted Payload (182 bytes) = - [1683884120.041641][5134:5136] CHIP:DMG: { - [1683884120.041647][5134:5136] CHIP:DMG: data = 153001202445b334fd30bc8c53955932724b371c085cbe9322cc9cd5a1f2e1094034a1462502faae300320adde97e1cb85749bebb3ed17b9ff3132eca00f7b374e482575322683ab460adc300441046c30cdef1fcbf383e11df64a3d6820ade9a6850b4eb401a99c4be5242ae5a0a0f5473b2ff098976de6bb2ae4e126138ebcc97cf44d8651ae0048ceed2681c8b9300610164874f435aa47c7505ca5ad59ba8974300710df3d4e94f1014d0e037c74eabce4accc18 - [1683884120.041655][5134:5136] CHIP:DMG: } - [1683884120.041660][5134:5136] CHIP:DMG: - [1683884120.041689][5134:5136] CHIP:DMG: Parameters = - [1683884120.041695][5134:5136] CHIP:DMG: { - [1683884120.041704][5134:5136] CHIP:DMG: InitiatorRandom (32) = 2445B334FD30BC8C53955932724B371C085CBE9322CC9CD5A1F2E1094034A146 - [1683884120.041711][5134:5136] CHIP:DMG: InitiatorSessionId = 44794 - [1683884120.041720][5134:5136] CHIP:DMG: DestinationId (32) = ADDE97E1CB85749BEBB3ED17B9FF3132ECA00F7B374E482575322683AB460ADC - [1683884120.041730][5134:5136] CHIP:DMG: InitiatorEphPubKey (65) = 046C30CDEF1FCBF383E11DF64A3D6820ADE9A6850B4EB401A99C4BE5242AE5A0A0F5473B2FF098976DE6BB2AE4E126138EBCC97CF44D8651AE0048CEED2681C8B9 - [1683884120.041766][5134:5136] CHIP:DMG: ResumptionID (16) = 164874F435AA47C7505CA5AD59BA8974 - [1683884120.041775][5134:5136] CHIP:DMG: InitiatorResumeMIC (16) = DF3D4E94F1014D0E037C74EABCE4ACCC - [1683884120.041782][5134:5136] CHIP:DMG: } - [1683884120.041787][5134:5136] CHIP:DMG: - [1683884120.041794][5134:5136] CHIP:DMG: - [1683884120.041883][5134:5136] CHIP:SC: Sent Sigma1 msg - - - On Responder(all-clusters-app), Verify that responder received the Sigma1 message from Initiator(chip-tool) - - [1683884120.042774][5117:5117] CHIP:IN: CASE Server received Sigma1 message . Starting handshake. EC 0x558aa452e2e0 - [1683884120.042783][5117:5117] CHIP:IN: CASE Server disabling CASE session setups - [1683884120.042798][5117:5117] CHIP:SC: Received Sigma1 msg - [1683884120.042819][5117:5117] CHIP:SC: Peer assigned session key ID 44794 + Sigma1 Message from Initiator: + "packetHeader" : + { + "flags" : 4, + "msgCounter" : 209808419, + "securityFlags" : 0, + "sessionId" : 0, + "sourceNodeId" : 13804960529544229277 + }, + "payload" : + { + "decoded" : + { + "case_sigma1" : + { + "destination_id" : "hex:1044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C", + "initiator_eph_pub_key" : "hex:04A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C6", + "initiator_random" : "hex:0F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC02988440", + "initiator_resume_mic" : "hex:38AA77A0C8DCF2BF748F6001968D431B", + "initiator_session_id" : "20432", + "resumption_id" : "hex:4B7113CED17477E981D74D68148235C8" + } + }, + "hex" : "153001200F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC029884402502D04F3003201044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C30044104A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C63006104B7113CED17477E981D74D68148235C830071038AA77A0C8DCF2BF748F6001968D431B18", + "size" : 182 + }, + "payloadHeader" : + { + "exchangeFlags" : 5, + "exchangeId" : 37964, + "initiator" : true, + "messageType" : 48, + "needsAck" : true, + "protocolId" : 0 + } + } + + Sigma2_Resume Message: + 1690296519.586605][34367:34370] CHIP:ATM: { + "event" : "MessageReceived", + "messageType" : "Unauthenticated", + "packetHeader" : + { + "destinationNodeId" : 13804960529544229277, + "flags" : 1, + "msgCounter" : 61852480, + "securityFlags" : 0, + "sessionId" : 0 + }, + "payload" : + "case_sigma1" : + { + "destination_id" : "hex:1044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C", + "initiator_eph_pub_key" : "hex:04A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C6", + "initiator_random" : "hex:0F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC02988440", + "initiator_resume_mic" : "hex:38AA77A0C8DCF2BF748F6001968D431B", + "initiator_session_id" : "20432", + "resumption_id" : "hex:4B7113CED17477E981D74D68148235C8" + } + }, + "hex" : "153001200F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC029884402502D04F3003201044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C30044104A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C63006104B7113CED17477E981D74D68148235C830071038AA77A0C8DCF2BF748F6001968D431B18", + "size" : 182 + }, + "payloadHeader" : + { + "exchangeFlags" : 5, + "exchangeId" : 37964, + "initiator" : true, + "messageType" : 48, + "needsAck" : true, + "protocolId" : 0 + } + } + + Sigma2_Resume Message: + 1690296519.586605][34367:34370] CHIP:ATM: { + "event" : "MessageReceived", + "messageType" : "Unauthenticated", + "packetHeader" : + { + "destinationNodeId" : 13804960529544229277, + "flags" : 1, + "msgCounter" : 61852480, + "securityFlags" : 0, + { + "decoded" : + { + "case_sigma2_resume" : + { + "responder_sessoion_id" : "45029", + "resumption_id" : "hex:D507CF90EEF665047D643F91FBBA3FC1", + "sigma2_resume_mic" : "hex:FB6A8A4000CF61E00E48BBD91A0D77C3" + } + }, + "hex" : "15300110D507CF90EEF665047D643F91FBBA3FC1300210FB6A8A4000CF61E00E48BBD91A0D77C32503E5AF18", + "size" : 44 + }, + "payloadHeader" : + { + "ackMessageCounter" : 209808419, + "exchangeFlags" : 6, + "exchangeId" : 37964, + "initiator" : false, + "messageType" : 51, + "needsAck" : true, + "protocolId" : 0 + } + } disabled: true - label: @@ -72,89 +226,126 @@ tests: following values resumptionID responderSessionID sigma2ResumeMIC responderMRPParams" verification: | - On initiator(chip-tool) verify that the Sigma2_Resume message and extracts the following values - resumptionID - responderSessionID - sigma2ResumeMIC - And - Verify that the message is properly formatted: - - I Flag is set to 1 - S flag and DIZ fields of message flags are set to 0 - Encryption Type of security flags is set to 0 - The Session Key Type field is set to 0 - The Protocol ID field is set to 0x0000 and - The Protocol Opcode field is set to 0x33 - resumptionID is of Octet String maximum of length 16 bytes - responderSessionID is of uint16 - sigma2ResumeMIC is of Octet String maximum of length 16 bytes - responderSessionParams is from any one of the following: - SESSION_IDLE_INTERVAL - Verify that it is of uint32 - SESSION_ACTIVE_INTERVAL - Verify that it is of uint32 - SESSION_ACTIVE_THRESHOLD - Verify that it is of uint16 - - here is the log to verify on chip-tool - - [1683884120.044173][5134:5136] CHIP:DMG: << from UDP:[fe80::e9f6:2c08:2794:357d%wlp0s20f3]:5540 | 8440488 | [Secure Channel (0) / Certificate Authenticated Session Establishment Sigma '2' Resume (0x33) / Session = 0 / Exchange = 29430] - [1683884120.044205][5134:5136] CHIP:DMG: Header Flags = - [1683884120.044210][5134:5136] CHIP:DMG: { - [1683884120.044219][5134:5136] CHIP:DMG: Message (0x01) = - [1683884120.044224][5134:5136] CHIP:DMG: { - [1683884120.044229][5134:5136] CHIP:DMG: DestinationNodeId = A8F9BB8984959B9C - [1683884120.044234][5134:5136] CHIP:DMG: } - [1683884120.044244][5134:5136] CHIP:DMG: Exchange (0x06) = - [1683884120.044248][5134:5136] CHIP:DMG: { - [1683884120.044253][5134:5136] CHIP:DMG: AckMsg = 265414754 - [1683884120.044258][5134:5136] CHIP:DMG: NeedsAck = true - [1683884120.044262][5134:5136] CHIP:DMG: } - [1683884120.044271][5134:5136] CHIP:DMG: } - [1683884120.044276][5134:5136] CHIP:DMG: - [1683884120.044287][5134:5136] CHIP:DMG: Encrypted Payload (70 bytes) = - [1683884120.044292][5134:5136] CHIP:DMG: { - [1683884120.044300][5134:5136] CHIP:DMG: data = 01000000a8ca80009c9b958489bbf9a80633f672000062e8d10f1530011098f83a1529d6cfa34f386cdbbbd842613002106223c9bf3f0d1fa0e4122f921711543a2503e59318 - [1683884120.044308][5134:5136] CHIP:DMG: buffer_ptr = 139986540250736 - [1683884120.044313][5134:5136] CHIP:DMG: } - [1683884120.044318][5134:5136] CHIP:DMG: - [1683884120.044327][5134:5136] CHIP:DMG: Decrypted Payload (44 bytes) = - [1683884120.044333][5134:5136] CHIP:DMG: { - [1683884120.044337][5134:5136] CHIP:DMG: data = 1530011098f83a1529d6cfa34f386cdbbbd842613002106223c9bf3f0d1fa0e4122f921711543a2503e59318 - [1683884120.044345][5134:5136] CHIP:DMG: } - [1683884120.044351][5134:5136] CHIP:DMG: - [1683884120.044371][5134:5136] CHIP:DMG: Parameters = - [1683884120.044377][5134:5136] CHIP:DMG: { - [1683884120.044385][5134:5136] CHIP:DMG: ResumptionID (16) = 98F83A1529D6CFA34F386CDBBBD84261 - [1683884120.044392][5134:5136] CHIP:DMG: Sigma2ResumeMIC (16) = 6223C9BF3F0D1FA0E4122F921711543A - [1683884120.044399][5134:5136] CHIP:DMG: ResponderSessionId = 37861 - [1683884120.044406][5134:5136] CHIP:DMG: } - [1683884120.044411][5134:5136] CHIP:DMG: - [1683884120.044419][5134:5136] CHIP:DMG: - [1683884120.044432][5134:5136] CHIP:DMG: Additional Fields = - [1683884120.044441][5134:5136] CHIP:DMG: { - [1683884120.044449][5134:5136] CHIP:DMG: peer_address = UDP:[fe80::e9f6:2c08:2794:357d%wlp0s20f3]:5540 - [1683884120.044455][5134:5136] CHIP:DMG: } - [1683884120.044461][5134:5136] CHIP:DMG: + Sigma1 Message from Initiator: + "packetHeader" : + { + "flags" : 4, + "msgCounter" : 209808419, + "securityFlags" : 0, + "sessionId" : 0, + "sourceNodeId" : 13804960529544229277 + }, + "payload" : + { + "decoded" : + { + "case_sigma1" : + { + "destination_id" : "hex:1044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C", + "initiator_eph_pub_key" : "hex:04A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C6", + "initiator_random" : "hex:0F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC02988440", + "initiator_resume_mic" : "hex:38AA77A0C8DCF2BF748F6001968D431B", + "initiator_session_id" : "20432", + "resumption_id" : "hex:4B7113CED17477E981D74D68148235C8" + } + }, + "hex" : "153001200F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC029884402502D04F3003201044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C30044104A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C63006104B7113CED17477E981D74D68148235C830071038AA77A0C8DCF2BF748F6001968D431B18", + "size" : 182 + }, + "payloadHeader" : + { + "exchangeFlags" : 5, + "exchangeId" : 37964, + "initiator" : true, + "messageType" : 48, + "needsAck" : true, + "protocolId" : 0 + } + } + + Sigma2_Resume Message: + 1690296519.586605][34367:34370] CHIP:ATM: { + "event" : "MessageReceived", + "messageType" : "Unauthenticated", + "packetHeader" : + { + "destinationNodeId" : 13804960529544229277, + "flags" : 1, + "msgCounter" : 61852480, + "securityFlags" : 0, + "sessionId" : 0 + }, + "payload" : + "case_sigma1" : + { + "destination_id" : "hex:1044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C", + "initiator_eph_pub_key" : "hex:04A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C6", + "initiator_random" : "hex:0F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC02988440", + "initiator_resume_mic" : "hex:38AA77A0C8DCF2BF748F6001968D431B", + "initiator_session_id" : "20432", + "resumption_id" : "hex:4B7113CED17477E981D74D68148235C8" + } + }, + "hex" : "153001200F8C93B3FACAA2DB4A0052772352C48E72D8DDC192C8177B8F8D26BC029884402502D04F3003201044CF83361D9C05477E32115AA78C1D42FD46F2C3CD8492E50EF390F709F42C30044104A3953CB2E653721B91C1765621B5F33341ABCD51C6EB8B6ED41B6ECF6FD66D1DE72283AEFF02091F81A9519A65BDCB1A8FE0C60B85DE9767B3FC3C67CDF8A3C63006104B7113CED17477E981D74D68148235C830071038AA77A0C8DCF2BF748F6001968D431B18", + "size" : 182 + }, + "payloadHeader" : + { + "exchangeFlags" : 5, + "exchangeId" : 37964, + "initiator" : true, + "messageType" : 48, + "needsAck" : true, + "protocolId" : 0 + } + } + + Sigma2_Resume Message: + 1690296519.586605][34367:34370] CHIP:ATM: { + "event" : "MessageReceived", + "messageType" : "Unauthenticated", + "packetHeader" : + { + "destinationNodeId" : 13804960529544229277, + "flags" : 1, + "msgCounter" : 61852480, + "securityFlags" : 0, + { + "decoded" : + { + "case_sigma2_resume" : + { + "responder_sessoion_id" : "45029", + "resumption_id" : "hex:D507CF90EEF665047D643F91FBBA3FC1", + "sigma2_resume_mic" : "hex:FB6A8A4000CF61E00E48BBD91A0D77C3" + } + }, + "hex" : "15300110D507CF90EEF665047D643F91FBBA3FC1300210FB6A8A4000CF61E00E48BBD91A0D77C32503E5AF18", + "size" : 44 + }, + "payloadHeader" : + { + "ackMessageCounter" : 209808419, + "exchangeFlags" : 6, + "exchangeId" : 37964, + "initiator" : false, + "messageType" : 51, + "needsAck" : true, + "protocolId" : 0 + } + } + disabled: true - label: "Step 4a: Initiator sends SigmaFinished message to Responder" verification: | - On Responder(all-clusters-app), verify that responder(all-clusters-app) received the SigmaFinished(The status report should be GeneralCode:SUCCESS, - ProtocolId:SECURE_CHANNEL, and ProtocolCode:SESSION_ESTABLISHMENT_SUCCESS). message from Initiator - - [1683884120.046690][5117:5117] CHIP:DMG: Parameters = - [1683884120.046692][5117:5117] CHIP:DMG: { - [1683884120.046694][5117:5117] CHIP:DMG: GeneralStatusCode = 0 - [1683884120.046696][5117:5117] CHIP:DMG: ProtocolId = 0 - [1683884120.046698][5117:5117] CHIP:DMG: ProtocolCode = 0 - [1683884120.046701][5117:5117] CHIP:DMG: } - [1683884120.046703][5117:5117] CHIP:DMG: - [1683884120.046706][5117:5117] CHIP:DMG: - [1683884120.046711][5117:5117] CHIP:DMG: Additional Fields = - [1683884120.046713][5117:5117] CHIP:DMG: { - [1683884120.046715][5117:5117] CHIP:DMG: peer_address = UDP:[fe80::e9f6:2c08:2794:357d%wlp0s20f3]:38377 - [1683884120.046718][5117:5117] CHIP:DMG: } - [1683884120.046720][5117:5117] CHIP:DMG: - [1683884120.046725][5117:5117] CHIP:EM: >>> [E:29430r S:0 M:265414755 (Ack:8440488)] (U) Msg RX from 0:A8F9BB8984959B9C [0000] --- Type 0000:40 (SecureChannel:StatusReport) - [1683884120.046729][5117:5117] CHIP:EM: Found matching exchange: 29430r, Delegate: 0x558aa3e3ef18 - [1683884120.046735][5117:5117] CHIP:EM: Rxd Ack; Removing MessageCounter:8440488 from Retrans Table on exchange 29430r - [1683884120.046743][5117:5117] CHIP:SC: Success status report received. Session was established + + disabled: true + + - label: + "Step 4b: Verify that the responder sends response to Read Request + with the value that is same as 'read response'" + verification: | + [1690283831.857744][28587:28591] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0006 Attribute 0x0000_0000 DataVersion: 2791059975 + [1690283831.857751][28587:28591] CHIP:TOO: OnOff: FALSE disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_3_3.yaml b/src/app/tests/suites/certification/Test_TC_SC_3_3.yaml index 36bc5c59272c42..f6b17380499be0 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_3_3.yaml @@ -26,10 +26,10 @@ config: tests: - label: "Precondition" verification: | - execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT - ./chip-all-clusters-app --trace_decode 1 - - Once DUT reach the commissionable state pls send below mentioned command on TH. Pls use equivalent command on the respective DUT + 1. Underlying transport is reliable, either implicitly (i.e.: TCP) or explicitly (i.e.: MRP) + 2. CASE was previously successfully completed between the initiator and responder and the previous session context is known by both nodes. + 3. resumptionID of the previous session is saved for future user. + "execute the below mentioned command to put DUT into a commissionable state, Pls use equivalent command on the respective DUT./chip-all-clusters-app --trace_decode 1Once DUT reach the commissionable state pls send below mentioned command on TH. Pls use equivalent command on the respective DUT ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 Verify the commissioning completed with success on TH(chip-tool) from DUT [1650455358.501816][4366:4371] CHIP:TOO: Device commissioning completed with success @@ -48,7 +48,32 @@ tests: disabled: true - label: - "Step 2b: Responder receives the Sigma1 message and extracts the + "Step 1a: Verify that the Initiator sends the Sigma1 message to + Responder" + verification: | + Verify that the Initiator(all-clusters-app) sends the Sigma1 message to Responder(chip-tool) + + [1683973647.719965][21642:21644] CHIP:DMG: + [1683973647.720054][21642:21644] CHIP:SC: Sent Sigma1 msg + [1683973647.720063][21642:21644] CHIP:DIS: OperationalSessionSetup[1:0000000000000001]: State change 3 --> 4 + [1683973647.723548][21642:21644] CHIP:DMG: << from UDP:[fe80::e9f6:2c08:2794:357d%wlp0s20f3]:5540 | 113416098 | [Secure Channel (0) / Certificate Authenticated Session Establishment Sigma '2' (0x31) / Session = 0 / Exchange = 39248] + disabled: true + + - label: "Step 1b: Verify that the Responder receives the Sigma1 message" + verification: | + Verify that the Responder(chip-tool) receives the Sigma1 message + + [1683973647.720880][21637:21637] CHIP:EM: >>> [E:39248r S:0 M:63601755] (U) Msg RX from 0:A5F871EB0B6E3FF9 [0000] --- Type 0000:30 (SecureChannel:CASE_Sigma1) + [1683973647.720900][21637:21637] CHIP:EM: Handling via exchange: 39248r, Delegate: 0x56251895eee0 + [1683973647.720920][21637:21637] CHIP:IN: CASE Server received Sigma1 message . Starting handshake. EC 0x562518c5ed60 + [1683973647.720926][21637:21637] CHIP:IN: CASE Server disabling CASE session setups + [1683973647.720936][21637:21637] CHIP:SC: Received Sigma1 msg + [1683973647.720954][21637:21637] CHIP:SC: Peer assigned session key ID 49338 + [1683973647.721189][21637:21637] CHIP:SC: CASE matched destination ID: fabricIndex 1, NodeID 0x0000000000000001 + disabled: true + + - label: + "Step 1c: Responder receives the Sigma1 message and extracts the following initiatorRandom initiatorSessionId destinationId resumptionID initiatorResumeMIC initiatorEphPubKey initiatorSEDParams" verification: | @@ -73,10 +98,10 @@ tests: resumptionID is of Octet String maximum of length 16 bytes responderSessionID is of uint16 sigma2ResumeMIC is of Octet String maximum of length 16 bytes - responderSessionParams is from any one of the following: - SESSION_IDLE_INTERVAL - Verify that it is of uint32 - SESSION_ACTIVE_INTERVAL - Verify that it is of uint32 - SESSION_ACTIVE_THRESHOLD - Verify that it is of uint16 + responderSEDParams is from any one of the following: + SLEEPY_IDLE_INTERVAL - Verify that it is of uint32 + SLEEPY_ACTIVE_INTERVAL - Verify that it is of uint32 + [1683973658.044236][21637:21637] CHIP:EM: Rxd Ack; Removing MessageCounter:113416101 from Retrans Table on exchange 32995r [1683973662.299442][21637:21637] CHIP:DMG: << from UDP:[fe80::e9f6:2c08:2794:357d%wlp0s20f3]:41363 | 167307433 | [Secure Channel (0) / Certificate Authenticated Session Establishment Sigma '1' (0x30) / Session = 0 / Exchange = 32997] @@ -124,7 +149,7 @@ tests: disabled: true - label: - "Step 2c: Responder sends a TLV-encoded Sigma2_Resume message to + "Step 2: Responder sends a TLV-encoded Sigma2_Resume message to Initiator containing resumptionID responderSessionID sigma2ResumeMIC responderMRPParams" verification: | @@ -182,8 +207,8 @@ tests: disabled: true - label: - "Step 3a: Responder receives the SigmaFinished message and extracts - the following 1.ProtocolId 2.ProtocolCode" + "Step 3a: Verify that the Initiator sends a SigmaFinished message to + Responder" verification: | On Responder(chip-tool), verify that responder(chip-tool) received the SigmaFinished(The status report should be GeneralCode:SUCCESS, ProtocolId:SECURE_CHANNEL, and ProtocolCode:SESSION_ESTABLISHMENT_SUCCESS). message from Initiator @@ -215,8 +240,8 @@ tests: disabled: true - label: - "Step 3b: Verify that the Initiator sends a SigmaFinished message to - Responder" + "Step 3b: Responder receives the SigmaFinished message and extracts + the following ProtocolId ProtocolCode" verification: | On Responder(chip-tool), verify that responder(chip-tool) received the SigmaFinished(The status report should be GeneralCode:SUCCESS, ProtocolId:SECURE_CHANNEL, and ProtocolCode:SESSION_ESTABLISHMENT_SUCCESS). message from Initiator diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml index 6e261e2bcc6226..298b831b262f41 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_10.yaml @@ -19,7 +19,7 @@ name: PICS: - MCORE.ROLE.COMMISSIONEE - - MCORE.SC.SIT_ICD + - MCORE.SC.SED config: nodeId: 0x12344321 @@ -27,15 +27,24 @@ config: endpoint: 0 tests: - - label: "DUT is instructed to advertise its service" + - label: "Precondition" + verification: | + 1. Nodes are joined in the same Fabric + 2. DUT is a sleepy device (MCORE.SC.SED) + disabled: true + + - label: "Step 1: DUT is instructed to advertise its service" verification: | 1. Provision the DUT by TH (Chip-tool) disabled: true - - label: "TH scans for DNS-SD advertising" + - label: "Step 2: TH scans for DNS-SD advertising" verification: | avahi-browse -rt _matter._tcp - Verify on the TH(Chip-tool) Log: + On the TH(Chip-tool) Log: Verify the DUT is advertising for: + -SII key is higher than the SLEEPY_IDLE_INTERVAL default value (> 300 milliseconds) + - SII key and SAI key is less than 3600000 (1hour in milliseconds) + + eth0 IPv6 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local + eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local = eth0 IPv4 3A235FF3FA2DAC10-0000000000000055 _matter._tcp local @@ -48,7 +57,4 @@ tests: address = [fd11:22::4b31:9932:cffe:b41a] port = [5540] txt = ["T=0" "SAI=300" "SII=5000"] - - - SII key is higher than the SESSION_IDLE_INTERVAL default value (> 300 milliseconds) - - SII key and SAI key is less than 3600000 (1hour in milliseconds) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml index 58623d4fd9e8d6..c375d547ca8aa0 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml @@ -26,7 +26,12 @@ config: tests: - label: "Note" verification: | - Chip-tool command used below are an example to verify the DUT as commissioner test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command + Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. + disabled: true. + + - label: "Precondition" + verification: | + 1. TH is not commissioned disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml index 97d7c8f2dde9a6..b56ec65e95334e 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 15.4.3. [TC-SC-4.3] Discovery [DUT as Commissionee] +name: 3.4.3. [TC-SC-4.3] Discovery [DUT as Commissionee] PICS: - MCORE.ROLE.COMMISSIONEE @@ -24,22 +24,27 @@ config: endpoint: 0 tests: + - label: "Note" + verification: | + Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. + disabled: true. + - label: - "DUT is commissioned to TH and DUT is instructed to advertise its - operational service (_matter._tcp)." + "Step 1: DUT is commissioned to TH and DUT is instructed to advertise + its operational service (_matter._tcp)." verification: | 1. Provision the DUT by TH (Chip-tool) disabled: true - - label: "Scan for DNS-SD advertising" + - label: "Step 2: Scan for DNS-SD advertising" PICS: - MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR && + MCORE.COM.WIFI && MCORE.COM.ETH && MCORE.COM.THR && MCORE.ICD && MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && - MCORE.SC.T_KEY + MCORE.SC.SAT_OP_DISCOVERY_KEY && MCORE.SC.T_KEY verification: | avahi-browse -rt _matter._tcp - Verify the advertisement on the TH Log: + Verify the device is advertising _matterc._udp service like below output in TH terminal Log: (Verify for the DUT's actual values (like vendor ID, PID ..etc) as mentioned in the expected outcome of the test plan, The below log contains the data from the reference raspi accessory) + veth721e1d9 IPv6 433B62F8F07F4327-0000000000000001 _matter._tcp local = veth721e1d9 IPv6 433B62F8F07F4327-0000000000000001 _matter._tcp local diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml index 3d8149bf59eea5..5ee31fb6d3eec8 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 15.4.4. [TC-SC-4.4] Discovery [DUT as Controller] +name: 3.4.4.[TC-SC-4.4] Discovery [DUT as Controller] PICS: - MCORE.ROLE.CONTROLLER @@ -27,6 +27,11 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. + disabled: true. + + - label: "Precondition" + verification: | + 1. Nodes are joined in the same Fabric disabled: true - label: "Step 1: TH starts commissioning process with DUT" diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml index 5225245d42f368..a3ba4b4f41ab1d 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_5.yaml @@ -25,8 +25,8 @@ config: tests: - label: - "TH is instructed to start advertising two or more services using - DNS-SD" + "Step 1: TH is instructed to start advertising two or more services + using DNS-SD" verification: | 1. On the raspi controller, publish matter service, using below command @@ -34,8 +34,8 @@ tests: disabled: true - label: - "By any means, DUT is instructed to perform an unicast UDP query to - the DNS-SD Discovery Proxy on TH for services" + "Step 2: By any means, DUT is instructed to perform an unicast UDP + query to the DNS-SD Discovery Proxy on TH for services" PICS: MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.T_KEY @@ -58,14 +58,16 @@ tests: txt = ["T=0" "SAI=300" "SII=5000"] disabled: true - - label: "TH performs a change in one of the services configured at step 1" + - label: + "Step 3: TH performs a change in one of the services configured at + step 1" verification: | 1. On the raspi controller, publish matter service chanding the T value 1, using below command $avahi-publish-service 87E1B004E235A130-8FC7772401CD0696 _matter._tcp 22222 SII=3000 SAI=4000 T=1 disabled: true - - label: "DUT must receive a notification with new data" + - label: "Step 4: DUT must receive a notification with new data" PICS: MCORE.SC.SII_OP_DISCOVERY_KEY && MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.T_KEY diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml index f415e7319103ef..a165c5be37518f 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml @@ -13,12 +13,11 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: - 3.4.6. [TC-SC-4.6] Commissioner Discovery - Commissioner [DUT - - Commissioner] +name: 3.4.6. [TC-SC-4.6]Commissioner Discovery [DUT as Commissioner] PICS: - MCORE.ROLE.COMMISSIONER + - MCORE.DD.COMM_DISCOVERY config: nodeId: 0x12344321 @@ -29,6 +28,12 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as commissioner test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. + disabled: true. + + - label: "Precondition" + verification: | + 1. DUT is connected to the IP network or supports SoftAP + 2. DUT and TH support Commissioner Discovery disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml index 7f0835e770fc28..7a856b2ee2ced1 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_7.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 15.4.7. [TC-SC-4.7] Commissioner Discovery [DUT as Commissionee] +name: 3.4.7.[TC-SC-4.7] Commissioner Discovery [DUT as Commissionee] PICS: - MCORE.ROLE.COMMISSIONEE @@ -25,6 +25,12 @@ config: endpoint: 0 tests: + - label: "Precondition" + verification: | + 1. DUT is connected to the IP network + 2. DUT and TH support Commissioner Discovery + disabled: true + - label: "Step 1: TH is instructed to start advertising its presence as a commissioner in the network" diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_9.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_9.yaml index eebb5cc840b5bb..b5a00a75d6715a 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_9.yaml @@ -27,6 +27,17 @@ config: endpoint: 0 tests: + - label: "Precondition" + verification: | + 1. TH_CR1 is a Commissioner, working over Ethernet or Wi-Fi transport, able to commission DUT into a given Fabric and implementing RFC-4191 + 2. TH_CR2 is a Commissioner/Controller Thread 1.3 device (only on Thread, not on Wi-Fi or Ethernet), joined to the PAN of the BR and already commissioned on the same Fabric + 3. DUT_CE is a Commissionee Ethernet or Wi-Fi device and implementing RFC-4191 + 4. DUT_CE will adopt an address on the GUA prefix e.g. 2001:12ab::/64 and use it as default route (::/0) + 5. DUT_CE sees the RA w/ RIO and adds the off-mesh prefix preferred route, so that any messages for that off-mesh prefix routes there INSTEAD of the default gateway + 6. BR is a Thread 1.3 border router, with link to DUT over Wi-Fi or Ethernet, in the same VLAN + 7. RT is a Wi-Fi or Ethernet router advertising a default route (i,e, against ::/0 prefix) with a GUA prefix advertised. That prefix MUST also route to the public internet to avoid the different entities bailing out of having this prefix because it’s an invalid environment detected to be artificial. + disabled: true + - label: "Step 1: Using TH_CR1, commission the DUT_CE onto the Matter network" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml index 2e36ed9d956c2e..98cf2a39efbaf0 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_6_1.yaml @@ -14,7 +14,7 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 18.2.1. [TC-SC-6.1] Adding member to a group - DUT as Admin and TH as Group + 26.4.1. [TC-SC-6.1] Adding member to a group - DUT as Admin and TH as Group Member [DUT-Client] PICS: @@ -38,7 +38,9 @@ tests: DUT supports Groups Cluster disabled: true - - label: "TH should have the ACL entry with the AuthMode as Group by DUT" + - label: + "Step 1a: TH should have the ACL entry with the AuthMode as Group by + DUT" verification: | ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null },{"fabricIndex": 1, "privilege": 4, "authMode": 3, "subjects": [1], "targets": null }]' 1 0 @@ -114,21 +116,27 @@ tests: disabled: true - label: - "DUT generates fabric-unique GroupID, GroupName, random key, EpochKey0 - and GroupKeySetID. Admin sets GroupKeySecurityPolicy = TrustFirst (0) - EpochStartTime0 = 0" + "Step 1b: DUT generates fabric-unique GroupID, GroupName, random key, + EpochKey0 and GroupKeySetID. Admin sets GroupKeySecurityPolicy = + TrustFirst (0) EpochStartTime0 = 1" verification: | - + Sample epoch key values that will be used in the forthcomming steps: + "epochKey0":"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1": + "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": + "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 + Sample Group Name: Grp1 + GroupKeySetID: 42 + GroupID = 1 disabled: true - label: - "DUT sends KeySetWrite command to GroupKeyManagement cluster to TH on - EP0" + "Step 2: DUT sends KeySetWrite command to GroupKeyManagement cluster + to TH on EP0" PICS: GRPKEY.C.C00.Tx verification: | ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": 42, "groupKeySecurityPolicy": 0, "epochKey0": - "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 2220000,"epochKey1": + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime0": 1,"epochKey1": "d1d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime1": 2220001,"epochKey2": "d2d1d2d3d4d5d6d7d8d9dadbdcdddedf", "epochStartTime2": 2220002 }' 1 0 @@ -136,59 +144,57 @@ tests: [1651471040.120912][4012:4012] CHIP:EM: Received message of type 0x8 with protocolId (0, 1) and MessageCounter:2398599 on exchange 35559r [1651471040.120980][4012:4012] CHIP:EM: Handling via exchange: 35559r, Delegate: 0xaaaaca97a088 - [1651471040.121098][4012:4012] CHIP:DMG: InvokeRequestMessage = - [1651471040.121146][4012:4012] CHIP:DMG: { - [1651471040.121188][4012:4012] CHIP:DMG: suppressResponse = false, - [1651471040.121238][4012:4012] CHIP:DMG: timedRequest = false, - [1651471040.121282][4012:4012] CHIP:DMG: InvokeRequests = - [1651471040.121346][4012:4012] CHIP:DMG: [ - [1651471040.121390][4012:4012] CHIP:DMG: CommandDataIB = - [1651471040.121453][4012:4012] CHIP:DMG: { - [1651471040.121501][4012:4012] CHIP:DMG: CommandPathIB = - [1651471040.121587][4012:4012] CHIP:DMG: { - [1651471040.121648][4012:4012] CHIP:DMG: EndpointId = 0x0, - [1651471040.121710][4012:4012] CHIP:DMG: ClusterId = 0x3f, - [1651471040.121775][4012:4012] CHIP:DMG: CommandId = 0x0, - [1651471040.121831][4012:4012] CHIP:DMG: }, - [1651471040.121891][4012:4012] CHIP:DMG: - [1651471040.121941][4012:4012] CHIP:DMG: CommandData = - [1651471040.122003][4012:4012] CHIP:DMG: { - [1651471040.122058][4012:4012] CHIP:DMG: 0x0 = - [1651471040.122116][4012:4012] CHIP:DMG: { - [1651471040.122171][4012:4012] CHIP:DMG: 0x0 = 42, - [1651471040.122222][4012:4012] CHIP:DMG: 0x1 = 0, - [1651471040.122276][4012:4012] CHIP:DMG: 0x2 = [ - [1651471040.122339][4012:4012] CHIP:DMG: 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - [1651471040.122390][4012:4012] CHIP:DMG: ] - [1651471040.122439][4012:4012] CHIP:DMG: 0x3 = 2220000, - [1651471040.122488][4012:4012] CHIP:DMG: 0x4 = [ - [1651471040.122543][4012:4012] CHIP:DMG: 0xd1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - [1651471040.122591][4012:4012] CHIP:DMG: ] - [1651471040.122639][4012:4012] CHIP:DMG: 0x5 = 2220001, - [1651471040.122684][4012:4012] CHIP:DMG: 0x6 = [ - [1651471040.122739][4012:4012] CHIP:DMG: 0xd2, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, - [1651471040.122791][4012:4012] CHIP:DMG: ] - [1651471040.122840][4012:4012] CHIP:DMG: 0x7 = 2220002, - [1651471040.122890][4012:4012] CHIP:DMG: }, - [1651471040.122937][4012:4012] CHIP:DMG: }, - [1651471040.122979][4012:4012] CHIP:DMG: }, - [1651471040.123032][4012:4012] CHIP:DMG: - [1651471040.123066][4012:4012] CHIP:DMG: ], - [1651471040.123115][4012:4012] CHIP:DMG: - [1651471040.123151][4012:4012] CHIP:DMG: InteractionModelRevision = 1 - [1651471040.123185][4012:4012] CHIP:DMG: }, - [1651471040.123286][4012:4012] CHIP:DMG: AccessControl: checking f=1 a=c s=0x000000000001B669 t= c=0x0000_003F e=0 p=a - [1651471040.123337][4012:4012] CHIP:DMG: AccessControl: allowed + [1693548451.902266][9666:9666] CHIP:DMG: InvokeRequestMessage = + [1693548451.902273][9666:9666] CHIP:DMG: { + [1693548451.902278][9666:9666] CHIP:DMG: suppressResponse = false, + [1693548451.902286][9666:9666] CHIP:DMG: timedRequest = false, + [1693548451.902293][9666:9666] CHIP:DMG: InvokeRequests = + [1693548451.902308][9666:9666] CHIP:DMG: [ + [1693548451.902314][9666:9666] CHIP:DMG: CommandDataIB = + [1693548451.902327][9666:9666] CHIP:DMG: { + [1693548451.902334][9666:9666] CHIP:DMG: CommandPathIB = + [1693548451.902342][9666:9666] CHIP:DMG: { + [1693548451.902349][9666:9666] CHIP:DMG: EndpointId = 0x0, + [1693548451.902357][9666:9666] CHIP:DMG: ClusterId = 0x3f, + [1693548451.902365][9666:9666] CHIP:DMG: CommandId = 0x0, + [1693548451.902371][9666:9666] CHIP:DMG: }, + [1693548451.902380][9666:9666] CHIP:DMG: + [1693548451.902389][9666:9666] CHIP:DMG: CommandFields = + [1693548451.902397][9666:9666] CHIP:DMG: { + [1693548451.902405][9666:9666] CHIP:DMG: 0x0 = + [1693548451.902413][9666:9666] CHIP:DMG: { + [1693548451.902422][9666:9666] CHIP:DMG: 0x0 = 42, + [1693548451.902431][9666:9666] CHIP:DMG: 0x1 = 0, + [1693548451.902439][9666:9666] CHIP:DMG: 0x2 = [ + [1693548451.902450][9666:9666] CHIP:DMG: 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1693548451.902460][9666:9666] CHIP:DMG: ] (16 bytes) + [1693548451.902471][9666:9666] CHIP:DMG: 0x3 = 1, + [1693548451.902479][9666:9666] CHIP:DMG: 0x4 = [ + [1693548451.902491][9666:9666] CHIP:DMG: 0xd1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1693548451.902500][9666:9666] CHIP:DMG: ] (16 bytes) + [1693548451.902509][9666:9666] CHIP:DMG: 0x5 = 2220001, + [1693548451.902517][9666:9666] CHIP:DMG: 0x6 = [ + [1693548451.902527][9666:9666] CHIP:DMG: 0xd2, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, + [1693548451.902536][9666:9666] CHIP:DMG: ] (16 bytes) + [1693548451.902544][9666:9666] CHIP:DMG: 0x7 = 2220002, + [1693548451.902553][9666:9666] CHIP:DMG: }, + [1693548451.902560][9666:9666] CHIP:DMG: }, + [1693548451.902567][9666:9666] CHIP:DMG: }, + [1693548451.902581][9666:9666] CHIP:DMG: + [1693548451.902587][9666:9666] CHIP:DMG: ], + [1693548451.902599][9666:9666] CHIP:DMG: + [1693548451.902606][9666:9666] CHIP:DMG: InteractionModelRevision = 10 + [1693548451.902613][9666:9666] CHIP:DMG: }, disabled: true - label: - "DUT binds GroupID with GroupKeySetID in the GroupKeyMap attribute - list on GroupKeyManagement cluster" + "Step 3: DUT binds GroupID with GroupKeySetID in the GroupKeyMap + attribute list on GroupKeyManagement cluster" PICS: GRPKEY.C.A0000 verification: | ./chip-tool groupkeymanagement write group-key-map '[{"groupId": 1, "groupKeySetID": 42, "fabricIndex": 1}]' 1 0 - Verify TH recieves GroupKeyMap attribute on TH(Reference app)log: + Verify TH recieves the binding of GroupKeySetID with the GroupID on TH(Reference app)log: [1659350562.020669][5824:5824] CHIP:EM: Received message of type 0x6 with protocolId (0, 1) and MessageCounter:167021683 on exchange 31153r [1659350562.020897][5824:5824] CHIP:EM: Handling via exchange: 31153r, Delegate: 0xaaaacb304f08 @@ -240,7 +246,7 @@ tests: [1659350562.022661][5824:5824] CHIP:DMG: AccessControl: allowed disabled: true - - label: "DUT sends AddGroup Command to TH on EP0" + - label: "Step 4: DUT sends AddGroup Command to TH on EP0" PICS: G.C.C00.Tx verification: | ./chip-tool groups add-group 0x0001 grp1 1 0 @@ -280,8 +286,8 @@ tests: disabled: true - label: - "DUT sends ViewGroup command with the GroupID and GroupName to the - Group cluster on the TH on EP0" + "Step 5: DUT sends ViewGroup command with the GroupID and GroupName to + the Group cluster on the TH on EP0" PICS: G.C.C01.Tx verification: | ./chip-tool groups view-group 0x0001 1 0 @@ -319,7 +325,7 @@ tests: [1651471144.502628][4012:4012] CHIP:DMG: AccessControl: allowed disabled: true - - label: "DUT sends KeySetRead Command to TH" + - label: "Step 6: DUT sends KeySetRead Command to TH" PICS: GRPKEY.C.C01.Tx verification: | ./chip-tool groupkeymanagement key-set-read 42 1 0 @@ -358,8 +364,8 @@ tests: disabled: true - label: - "DUT reads GroupKeyMap Attribute from the GroupKeyManagement cluster - from TH" + "Step 7: DUT reads GroupKeyMap Attribute from the GroupKeyManagement + cluster from TH" PICS: GRPKEY.C.A0000 verification: | ./chip-tool groupkeymanagement read group-key-map 1 0 @@ -394,7 +400,8 @@ tests: disabled: true - label: - "DUT reads GroupTable attribute from GroupKeyManagement cluster on TH" + "Step 8: DUT reads GroupTable attribute from GroupKeyManagement + cluster on TH" PICS: GRPKEY.C.A0001 verification: | ./chip-tool groupkeymanagement read group-table 1 0 diff --git a/src/app/tests/suites/certification/Test_TC_SU_2_8.yaml b/src/app/tests/suites/certification/Test_TC_SU_2_8.yaml index bfc2d01eb5e6d5..a7a4ed9582f5fd 100644 --- a/src/app/tests/suites/certification/Test_TC_SU_2_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_SU_2_8.yaml @@ -24,13 +24,20 @@ config: endpoint: 0 tests: - - label: "DUT sends a QueryImage command to TH1/OTA-P." + - label: "Step 1: DUT sends a QueryImage command to TH1/OTA-P." verification: | - ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 3735928559, "endpoint": 0}]' 0x0000001234567890 0 + ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 123, "endpoint": 0}]' 321 0 - where 0x1234567890 is OTA Requestor node ID and 0xDEADBEEF is OTA Provider node ID + where 321 is OTA Requestor node ID and 123 is OTA Provider node ID - Verify on the OTA Provider logs receives QueryImage: + Verify on the OTA Provider logs receives QueryImage with following fields: + - VendorId - Should match the value reported by the Basic Information Cluster VendorID attribute of the DUT. + - ProductId - Should match the value reported by the Basic Information Cluster ProductID attribute of the DUT. + - HardwareVersion - If present, verify that it matches the value reported by the Basic Information Cluster HardwareVersion attribute of the DUT. + - SoftwareVersion - Should match the value reported by the Basic Information Cluster SoftwareVersion attribute of the DUT. + - Verify the field ProtocolsSupported lists the BDX Synchronous protocol. + - Verify the default value of RequestorCanConsent is set to False unless DUT sets it to True. + - If the Location field is present, verify that the value is same as Basic Information Cluster Location Attribute of the DUT. [1645743053317] [97806:20280749] CHIP: [ZCL] OTA Provider received QueryImage [1645743053317] [97806:20280749] CHIP: [ZCL] VendorID: 0xfff1 @@ -45,13 +52,28 @@ tests: disabled: true - label: - "DUT sends a QueryImage command to TH1/OTA-P. TH1/OTA-P does not - respond with QueryImageResponse." + "Step 2: DUT sends a QueryImage command to TH1/OTA-P. TH1/OTA-P does + not respond with QueryImageResponse." PICS: MCORE.OTA.Retry verification: | - ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 3735928559, "endpoint": 0}]' 0x0000001234567890 0 + ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 123, "endpoint": 0}]' 321 0 - ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 2, "providerNodeID": 1, "endpoint": 0}]' 0x858 0 --commissioner-name beta + Verify SUCCESS status response On TH(chip-tool) log: + + [1686302244.664128][30278:30280] CHIP:DMG: StatusIB = + [1686302244.664157][30278:30280] CHIP:DMG: { + [1686302244.664198][30278:30280] CHIP:DMG: status = 0x00 (SUCCESS), + [1686302244.664228][30278:30280] CHIP:DMG: }, + + + ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 2, "providerNodeID": 222, "endpoint": 0}]' 321 0 --commissioner-name beta + + Verify SUCCESS status response On TH(chip-tool) log: + + [1686302244.664128][30278:30280] CHIP:DMG: StatusIB = + [1686302244.664157][30278:30280] CHIP:DMG: { + [1686302244.664198][30278:30280] CHIP:DMG: status = 0x00 (SUCCESS), + [1686302244.664228][30278:30280] CHIP:DMG: }, Kill Default OTA Provider for fabric index 1 before DUT sends a query @@ -59,8 +81,9 @@ tests: disabled: true - label: - "DUT sends a QueryImage command to TH2/OTA-P. TH2/OTA-P sends a - QueryImageResponse back to the DUT. Status is set to UpdateAvailable." + "Step 3: DUT sends a QueryImage command to TH2/OTA-P. TH2/OTA-P sends + a QueryImageResponse back to the DUT. Status is set to + UpdateAvailable." verification: | ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 2, "providerNodeID": 1, "endpoint": 0}]' 0x858 0 --commissioner-name beta diff --git a/src/app/tests/suites/certification/Test_TC_SU_3_3.yaml b/src/app/tests/suites/certification/Test_TC_SU_3_3.yaml index 82ca0138375e5a..fe03bc98caeb3d 100644 --- a/src/app/tests/suites/certification/Test_TC_SU_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SU_3_3.yaml @@ -26,13 +26,13 @@ config: tests: - label: - "OTA-R/TH sends a QueryImage Command to the DUT. Protocol supported - should only list 'BDX'. DUT responds with the QueryImageResponse to - the OTA-R/TH." + "Step 1: OTA-R/TH sends a QueryImage Command to the DUT. Protocol + supported should only list 'BDX'. DUT responds with the + QueryImageResponse to the OTA-R/TH." verification: | - ./chip-tool otasoftwareupdaterequestor announce-otaprovider 0xDEADBEEF 0 0 0 0x1234567890 0 + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 123 0 0 0 321 0 - where 0x1234567890 is OTA Requestor node ID and 0xDEADBEEF is OTA Provider node ID + Where 321 is OTA Requestor node ID and 123 is OTA Provider node ID Verify on the OTA Requestor logs receives QueryImageResponse @@ -53,8 +53,8 @@ tests: disabled: true - label: - "TH sends a QueryImage command to the DUT. RequestorCanConsent is set - to True by TH. DUT responds with a QueryImageResponse with + "Step 2: TH sends a QueryImage command to the DUT. RequestorCanConsent + is set to True by TH. DUT responds with a QueryImageResponse with UserConsentNeeded field set to True." PICS: OTAP.S.M.UserConsentNeeded verification: | @@ -63,12 +63,16 @@ tests: out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/test.bin -c + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 123 0 0 0 321 0 + + Where 321 is OTA Requestor node ID and 123 is OTA Provider node ID + Verify that the DUT does not try to obtain User Consent from the user prior to transfer of software update image. disabled: true - label: - "TH sends a QueryImage command to the DUT. RequestorCanConsent is set - to True by TH. DUT responds with a QueryImageResponse with + "Step 3: TH sends a QueryImage command to the DUT. RequestorCanConsent + is set to True by TH. DUT responds with a QueryImageResponse with UserConsentNeeded field set to False." PICS: OTAP.S.M.UserConsentNeeded verification: | @@ -78,17 +82,21 @@ tests: out/chip-ota-provider-app --discriminator 22 --secured-device-port 5565 --KVS /tmp/chip_kvs_provider --filepath /tmp/test.bin + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 123 0 0 0 321 0 + + Where 321 is OTA Requestor node ID and 123 is OTA Provider node ID + Verify that the DUT tries to obtain User Consent from the user prior to transfer of software update image. disabled: true - label: - "During the transfer of the image from the DUT, force fail the + "Step 4: During the transfer of the image from the DUT, force fail the transfer before it completely transfers the image. Wait for the Idle timeout. Initiate another QueryImage Command from OTA-R/TH to the DUT." verification: | - ./chip-tool otasoftwareupdaterequestor announce-otaprovider 0xDEADBEEF 0 0 0 0x1234567890 0 + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 123 0 0 0 321 0 - where 0x1234567890 is OTA Requestor node ID and 0xDEADBEEF is OTA Provider node ID + Where 321 is OTA Requestor node ID and 123 is OTA Provider node ID Kill the OTA Requestor App during the transfer of the image to the DUT before it completely transfers the image. @@ -97,22 +105,26 @@ tests: Relaunch the OTA Requestor App and initiate another query - ./chip-tool otasoftwareupdaterequestor announce-otaprovider 0xDEADBEEF 0 0 0 0x1234567890 0 + ./chip-tool otasoftwareupdaterequestor announce-otaprovider 123 0 0 0 321 0 + + Where 321 is OTA Requestor node ID and 123 is OTA Provider node ID Verify that a new transfer of software image is started from DUT when sending another QueryImage request disabled: true - label: - "During the transfer of the image from the DUT, force fail the + "Step 5: During the transfer of the image from the DUT, force fail the transfer before it completely transfers the image. Initiate another QueryImage Command from OTA-R/TH to the DUT. Set the RC[STARTOFS] bit and associated STARTOFS field in the ReceiveInit Message sent from the TH to indicate the resumption of a transfer previously aborted." verification: | - Out of scope for V1.0 + Out of scope disabled: true - - label: "Perform the OTA Update from DUT using vendor specific mechanism." + - label: + "Step 6: Perform the OTA Update from DUT using vendor specific + mechanism." PICS: MCORE.OTA.VendorSpecific verification: | Use vendor specific steps to initiate OTA Update and verify that the software image is transferred from the DUT diff --git a/src/app/tests/suites/certification/Test_TC_SU_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SU_4_1.yaml index 0b8c8c91838c1d..b1caaededa1224 100644 --- a/src/app/tests/suites/certification/Test_TC_SU_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SU_4_1.yaml @@ -24,6 +24,15 @@ config: endpoint: 0 tests: + - label: "Preconditions" + verification: | + 1 DUT - DUT as OTA-R device type. + 2 TH - Test harness1 as Administrator to perform read/write operations. + 3 TH2 - Test harness2 as OTA-P on first fabric. + 4 TH3 - Test harness3 as OTA-P on second fabric. + 5 TH4 - Test harness4 as second OTA-P on first fabric. + disabled: true + - label: "Step 1: TH sends a write request for the DefaultOTAProviders Attribute on the first fabric to the DUT. TH2 is set as the default diff --git a/src/app/tests/suites/certification/Test_TC_S_2_5.yaml b/src/app/tests/suites/certification/Test_TC_S_2_5.yaml index 552d5343fdb669..633e362149c9d1 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_5.yaml @@ -15,12 +15,23 @@ name: 132.2.5. [TC-S-2.5] RemainingCapacity functionality with DUT as Server +PICS: + - S.S + - S.S.F03 + config: nodeId: 0x12344321 cluster: "Basic Information" endpoint: 0 tests: + - label: "Precondition" + verification: | + - Commission DUT to TH + - A given fabric SHALL NOT consume more than half (rounded down towards 0) of the Scene Table entries (as indicated in the SceneTableSize attribute). + - MaxRemainingCapacity is SceneTableSize/2. + disabled: true + - label: "Step 0a: TH sends KeySetWrite command in the GroupKeyManagement cluster to DUT using a key that is pre-installed on the TH. @@ -76,7 +87,7 @@ tests: - label: "Step 2: TH sends a AddGroup command to DUT with the GroupID field set - to 0x0001." + to G1." PICS: G.S.C00.Rsp verification: | ./chip-tool groups add-group 0x0001 grp1 1 1 @@ -90,7 +101,7 @@ tests: - label: "Step 3: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C03.Rsp verification: | ./chip-tool scenes remove-all-scenes 0x0001 1 1 @@ -113,55 +124,11 @@ tests: disabled: true - label: - "Step 4b: TH sends a subscription request action for RemainingCapacity + "Step 4b: TH sends a subscription request action for FabricSceneInfo to the DUT." PICS: S.S.A0007 verification: | - ./chip-tool interactive start - - >> scenes subscribe remaining-capacity 10 100 1 1 - - [1688019515.541743][1731:1733] CHIP:DMG: ReportDataMessage = - [1688019515.541783][1731:1733] CHIP:DMG: { - [1688019515.541816][1731:1733] CHIP:DMG: SubscriptionId = 0x86424e60, - [1688019515.541848][1731:1733] CHIP:DMG: AttributeReportIBs = - [1688019515.541889][1731:1733] CHIP:DMG: [ - [1688019515.541920][1731:1733] CHIP:DMG: AttributeReportIB = - [1688019515.541961][1731:1733] CHIP:DMG: { - [1688019515.541995][1731:1733] CHIP:DMG: AttributeDataIB = - [1688019515.542032][1731:1733] CHIP:DMG: { - [1688019515.542071][1731:1733] CHIP:DMG: DataVersion = 0x5c66a0ed, - [1688019515.542109][1731:1733] CHIP:DMG: AttributePathIB = - [1688019515.542149][1731:1733] CHIP:DMG: { - [1688019515.542189][1731:1733] CHIP:DMG: Endpoint = 0x1, - [1688019515.542230][1731:1733] CHIP:DMG: Cluster = 0x5, - [1688019515.542273][1731:1733] CHIP:DMG: Attribute = 0x0000_0007, - [1688019515.542313][1731:1733] CHIP:DMG: } - [1688019515.542355][1731:1733] CHIP:DMG: - [1688019515.542396][1731:1733] CHIP:DMG: Data = 0, - [1688019515.542433][1731:1733] CHIP:DMG: }, - [1688019515.542474][1731:1733] CHIP:DMG: - [1688019515.542507][1731:1733] CHIP:DMG: }, - [1688019515.542546][1731:1733] CHIP:DMG: - [1688019515.542575][1731:1733] CHIP:DMG: ], - [1688019515.542614][1731:1733] CHIP:DMG: - [1688019515.542644][1731:1733] CHIP:DMG: InteractionModelRevision = 1 - [1688019515.542673][1731:1733] CHIP:DMG: } - [1688019515.542841][1731:1733] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 1550229741 - [1688019515.542905][1731:1733] CHIP:TOO: RemainingCapacity: 0 - [1688019515.542968][1731:1733] CHIP:DMG: MoveToState ReadClient[0xffffac012a80]: Moving to [AwaitingSu] - [1688019515.543104][1731:1733] CHIP:EM: <<< [E:47710i S:27355 M:73821372 (Ack:265285849)] (S) Msg TX to 1:0000000000000001 [2867] --- Type 0001:01 (IM:StatusResponse) - [1688019515.543154][1731:1733] CHIP:IN: (S) Sending msg 73821372 on secure session with LSID: 27355 - [1688019515.544315][1731:1733] CHIP:EM: >>> [E:47710i S:27355 M:265285850 (Ack:73821372)] (S) Msg RX from 1:0000000000000001 [2867] --- Type 0001:04 (IM:SubscribeResponse) - [1688019515.544359][1731:1733] CHIP:EM: Found matching exchange: 47710i, Delegate: 0xffffac012a90 - [1688019515.544401][1731:1733] CHIP:EM: Rxd Ack; Removing MessageCounter:73821372 from Retrans Table on exchange 47710i - [1688019515.544478][1731:1733] CHIP:DMG: SubscribeResponse is received - [1688019515.544530][1731:1733] CHIP:DMG: SubscribeResponseMessage = - [1688019515.544562][1731:1733] CHIP:DMG: { - [1688019515.544592][1731:1733] CHIP:DMG: SubscriptionId = 0x86424e60, - [1688019515.544625][1731:1733] CHIP:DMG: MaxInterval = 0x64, - [1688019515.544657][1731:1733] CHIP:DMG: InteractionModelRevision = 1 - [1688019515.544687][1731:1733] CHIP:DMG: } + disabled: true - label: @@ -173,8 +140,8 @@ tests: - label: "Step 5a: TH sends a AddScene command to DUT with the GroupID field - set to 0x0001, the SceneID field set to 0x01, the TransitionTime field - set to 0x0014 (20s) and no extension field sets." + set to G1, the SceneID field set to 0x01, the TransitionTime field set + to 0x0014 (20s) and no extension field sets." PICS: S.S.C00.Rsp verification: | ./chip-tool scenes add-scene 0x0001 0x1 0x0014 scene1 [] 1 1 @@ -194,8 +161,7 @@ tests: (MaxRemainingCapacity-1)." PICS: S.S.A0007 verification: | - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536935 - CHIP:TOO: RemainingCapacity: 7 + disabled: true - label: @@ -222,15 +188,14 @@ tests: (MaxRemainingCapacity-2)." PICS: S.S.A0007 verification: | - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536935 - CHIP:TOO: RemainingCapacity: 6 + disabled: true - label: "Step 7a: If RemainingCapacity is greater than 0, TH sends a AddScene - command to DUT with the GroupID field set to 0x0001, the SceneID field - set to 0x03, the TransitionTime field set to 0x0014 (20s) and no - extension field sets. If RemainingCapacity is 0, continue to Step 8a." + command to DUT with the GroupID field set to G1, the SceneID field set + to 0x03, the TransitionTime field set to 0x0014 (20s) and no extension + field sets. If RemainingCapacity is 0, continue to Step 8a." PICS: S.S.C00.Rsp verification: | ./chip-tool scenes add-scene 0x0001 0x3 0x0014 scene3 [] 1 1 @@ -243,12 +208,12 @@ tests: (MaxRemainingCapacity-3)." PICS: S.S.A0007 verification: | - ./chip-tool scenes add-scene 0x0001 0x3 0x0014 scene3 [] 1 1 + disabled: true - label: "Step 8a: TH sends a RemoveScene command to DUT with the GroupID field - set to 0x0001 and the SceneID field set to 0x01." + set to G1 and the SceneID field set to 0x01." PICS: S.S.C02.Rsp verification: | ./chip-tool scenes remove-scene 0x0001 0x1 1 1 @@ -268,13 +233,12 @@ tests: (MaxRemainingCapacity-2)." PICS: S.S.A0007 verification: | - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536935 - CHIP:TOO: RemainingCapacity: 6 + disabled: true - label: "Step 9a: TH sends a RemoveAllScenes command to DUT with the GroupID - field set to 0x0001." + field set to G1." PICS: S.S.C03.Rsp verification: | ./chip-tool scenes remove-all-scenes 0x0001 1 1 @@ -293,8 +257,7 @@ tests: (MaxRemainingCapacity)." PICS: S.S.A0007 verification: | - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536935 - CHIP:TOO: RemainingCapacity: 8 + disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_S_2_6.yaml b/src/app/tests/suites/certification/Test_TC_S_2_6.yaml index 54407196bc8f9d..14731c4692a6cf 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_6.yaml @@ -14,15 +14,26 @@ # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: - 132.2.6. [TC-S-2.6] RemainingCapacity functionality with DUT as Server - + 135.2.6. [TC-S-2.6] RemainingCapacity functionality with DUT as Server - Multi-Fabric +PICS: + - S.S + - S.S.F03 + config: nodeId: 0x12344321 cluster: "Basic Information" endpoint: 0 tests: + - label: "Precondition" + verification: | + - TH1, TH2, and TH3 should be on separate, distinct fabrics. + - A given fabric SHALL NOT consume more than half (rounded down towards 0) of the Scene Table entries (as indicated in the SceneTableSize attribute). + - MaxRemainingCapacity is SceneTableSize/2. + disabled: true + - label: "Step 1a: TH1 sends a RemoveAllScenes command to DUT with the GroupID field set to 0x0000." @@ -54,29 +65,11 @@ tests: disabled: true - label: - "Step 2b: TH1 sends a subscription request action for - RemainingCapacity to the DUT." + "Step 2b: TH1 sends a subscription request action for FabricSceneInfo + to the DUT." PICS: S.S.A0007 verification: | - ./chip-tool interactive start - >> scenes subscribe remaining-capacity 10 100 1 1 --keepSubscriptions 1 - - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 8 - CHIP:DMG: MoveToState ReadClient[0xffff94002990]: Moving to [AwaitingSu] - CHIP:EM: <<< [E:32066i S:31983 M:88286544 (Ack:232770518)] (S) Msg TX to 1:0000000000000001 [573B] --- Type 0001:01 (IM:StatusResponse) - CHIP:IN: (S) Sending msg 88286544 on secure session with LSID: 31983 - CHIP:EM: >>> [E:32066i S:31983 M:232770519 (Ack:88286544)] (S) Msg RX from 1:0000000000000001 [573B] --- Type 0001:04 (IM:SubscribeResponse) - CHIP:EM: Found matching exchange: 32066i, Delegate: 0xffff940029a0 - CHIP:EM: Rxd Ack; Removing MessageCounter:88286544 from Retrans Table on exchange 32066i - CHIP:DMG: SubscribeResponse is received - CHIP:DMG: SubscribeResponseMessage = - CHIP:DMG: { - CHIP:DMG: SubscriptionId = 0xf2e8c40c, - CHIP:DMG: MaxInterval = 0x64, - CHIP:DMG: InteractionModelRevision = 1 - CHIP:DMG: } disabled: true - label: @@ -112,16 +105,26 @@ tests: CHIP:TOO: } disabled: true + - label: + "Step 3b: Verify that the DUT sends a report data to TH1 for + FabricSceneInfo after the MinIntervalFloor time; store the + RemainingCapacity field from this fabric’s entry reported in + FabricSceneInfo into Remaining1stCapacity; verify Remaining1stCapacity + equals (MaxRemainingCapacity-1)." + PICS: S.S.A0007 + verification: | + + disabled: true + - label: "Step 4a: TH1 sends AddScene command to DUT with same GroupID and SceneID value starting at 2 and incrementing for each iteration for - RemainingCapacity1 more times until reported value to TH1 (after - MinIntervalFloor) for RemainingCapacity becomes 0." + Remaining1stCapacity more times until reported value to TH1 (after + MinIntervalFloor) for RemainingCapacity field from FabricSceneInfo + becomes 0." PICS: S.S.C00.Rsp && S.S.A0007 verification: | - ./chip-tool scenes add-scene 0x0000 0x2 0x0014 scene2 [] 1 1 - Repeat till RemainingCapacity is 0 disabled: true - label: @@ -151,21 +154,6 @@ tests: CHIP:TOO: groupID: 0 CHIP:TOO: sceneID: 1 CHIP:TOO: } - - TH2: - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 7 - TH3: - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 7 - - Repeat on TH2 till RemainingCapacity reaches 0 - TH2: - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 0 - TH3: - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 0 disabled: true - label: "Step 5b: Repeat Step 4b with TH2" @@ -213,9 +201,10 @@ tests: - label: "Step 7b: Verify that the DUT sends a report data to TH1 for - RemainingCapacity after the MinIntervalFloor time; store this value - into RemainingCapacity1; verify RemainingCapacity1 equals - (MaxRemainingCapacity)." + FabricSceneInfo after the MinIntervalFloor time; store the + RemainingCapacity field from this fabrics entry the reported in + FabricSceneInfo into Remaining1stCapacity; verify Remaining1stCapacity + equals (MaxRemainingCapacity)." PICS: S.S.A0007 verification: | CHIP:DMG: ReportDataMessage = @@ -246,7 +235,5 @@ tests: (MaxRemainingCapacity)." PICS: S.S.A0007 verification: | - TH2: - CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0005 Attribute 0x0000_0007 DataVersion: 2793536968 - CHIP:TOO: RemainingCapacity: 8 + disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml index 14e4014e3e2157..41c94bc0ad274a 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_1_1.yaml @@ -14,6 +14,9 @@ name: 219.1.1. [TC-TCCM-1.1] Global attributes with DUT as Server +PICS: + - TCCM.S + config: nodeId: 0x12344321 cluster: "Refrigerator And Temperature Controlled Cabinet Mode" diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml index 1f428f9c407901..b4d441dd131f98 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml @@ -15,6 +15,10 @@ name: 219.3.1. [TC-TCCM-3.1] On Mode functionality with DUT as Server +PICS: + - TCCM.S.A0003 + - TCCM.S.F00 + config: nodeId: 0x12344321 cluster: "Basic Information" diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml index a27a8f2400623a..29786eb28374e6 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_2.yaml @@ -16,7 +16,7 @@ name: 219.3.2. [TC-TCCM-3.2] Startup Mode functionality with DUT as Server PICS: - - TCCM.S + - TCCM.S.A0002 config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml index a7b94787d6ed7d..5be0c6eba7b28d 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_3.yaml @@ -18,7 +18,9 @@ name: Server PICS: - - TCCM.S + - TCCM.S.A0002 + - TCCM.S.A0003 + - TCCM.S.F00 config: nodeId: 0x12344321 diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml index 286f41e28396b0..bcdb79209c7a36 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml @@ -29,7 +29,7 @@ config: tests: - label: "Note" verification: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. + Note: This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. disabled: true - label: "Step 1: Commission DUT to TH" @@ -40,42 +40,44 @@ tests: - label: "Step 2: TH reads from the DUT the MinTemperature attribute" PICS: TCTL.S.A0001 verification: | - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value between MinTemperature and TCTL.S.A0002(MaxTemperature) inclusive. + ./chip-tool temperaturecontrol read min-temperature 1 1 + + On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 0 + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: MinTemperature: 0 [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 3: TH reads from the DUT the MaxTemperature attribute" PICS: TCTL.S.A0002 verification: | - ./chip-tool temperaturecontrol read min-temperature 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). + ./chip-tool temperaturecontrol read max-temperature 1 1 + + On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MinTemperature: 0 + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: MaxTemperature: 0 [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true - label: "Step 4: TH reads from the DUT the TemperatureSetpoint attribute" PICS: TCTL.S.A0000 verification: | - ./chip-tool temperaturecontrol read max-temperature 1 1 + ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). + On TH(chip-tool), Verify that the DUT response contains a temperature with value between MinTemperature and TCTL.S.A0002(MaxTemperature) inclusive. [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MaxTemperature: 0 + [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 + [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 0 [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml index 24dcc68557037d..3de0ce5190f3ac 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_3_2.yaml @@ -13,7 +13,7 @@ # limitations under the License. # Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 41.3.2. [TC-TSTAT-3.2] Functionality with client as DUT +name: 42.3.1. [TC-TSTAT-3.2] Functionality with client as DUT PICS: - TSTAT.C @@ -30,9 +30,9 @@ tests: disabled: true - label: - "DUT increases the temperature by sending a SetpointRaiseLower command - to the Test Harness, with a valid Mode argument (0, 1 or 2) and a - reasonable positive value that is supported by the DUT." + "Step 1: DUT increases the temperature by sending a SetpointRaiseLower + command to the Test Harness, with a valid Mode argument (0, 1 or 2) + and a reasonable positive value that is supported by the DUT." PICS: TSTAT.C.C00.Tx verification: | Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner/Client) @@ -122,9 +122,9 @@ tests: disabled: true - label: - "DUT lowers the temperature by sending a SetpointRaiseLower command to - the Test Harness, with a valid Mode argument (0, 1 or 2) and a - reasonable negative value that is supported by the DUT." + "Step 2: DUT lowers the temperature by sending a SetpointRaiseLower + command to the Test Harness, with a valid Mode argument (0, 1 or 2) + and a reasonable negative value that is supported by the DUT." PICS: TSTAT.C.C00.Tx verification: | Product maker needs to provide instructions for how to trigger the command on the DUT. For comparison, the DUT behavior for this test step can be simulated using chip-tool (when DUT is a commissioner/Client) @@ -212,7 +212,8 @@ tests: [1666952478.428206][5547:5547] CHIP:DMG: }, disabled: true - - label: "DUT sends a GetRelayStatusLog command to the Test Harness." + - label: + "Step 3: DUT sends a GetRelayStatusLog command to the Test Harness." PICS: TSTAT.C.C04.Tx verification: | The GetRelayStatusLogResponse command may not supported in Matter 1.0. diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml index 3d77641d7fd962..2ef928d704b76f 100644 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_1_1.yaml @@ -11,66 +11,130 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 256.1.1. [TC-WASHERCTRL-1.1] Global attributes with server as DUT +name: 186.1.1. [TC-WASHERCTRL-1.1] Global attributes with server as DUT PICS: - WASHERCTRL.S config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Controls" + endpoint: 1 tests: - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the ClusterRevision attribute" - verification: | - ./chip-tool laundrywashercontrols read cluster-revision 1 1 - - On TH(Chip-tool) Verify the cluster-revision value is 1 - disabled: true - - - label: "Step 3: TH reads from the DUT the FeatureMap attribute" - verification: | - ./chip-tool laundrywashercontrols read feature-map 1 1 - - On TH(chip-tool), verify that DUT sends FeatureMap attribute - Below is the example value which is observed in the RPI platform the value may be differ based on the dut implementation. - disabled: true - - - label: "Step 4: TH reads from the DUT the AttributeList attribute" - verification: | - ./chip-tool laundrywashercontrols read attribute-list 1 1 - - Verify we are getting supported attribute list sent in the above command on TH(chip-tool) log - Below is the example value which is observed in the RPI platform the value may be differ based on the dut implementation. - disabled: true + command: "readAttribute" + attribute: "ClusterRevision" + response: + value: 1 + constraints: + type: int16u - - label: "Step 5: TH reads from the DUT the (0xFFFA) EventList attribute" - verification: | - ./chip-tool laundrywashercontrols read event-list 1 1 - - ON TH(Chip-tool) verify the Event-list value is 0 entries - disabled: true + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute. If + WASHERCTRL.S.F00(SPIN) & WASHERCTRL.S.F01(RINSE) are false" + PICS: "!WASHERCTRL.S.F00 && !WASHERCTRL.S.F01" + command: "readAttribute" + attribute: "FeatureMap" + response: + value: 0 + constraints: + type: bitmap32 - - label: "Step 6: TH reads from the DUT the AcceptedCommandList attribute" - verification: | - ./chip-tool laundrywashercontrols read accepted-command-list 1 1 + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 0 set to + 1 if the DUT is capable of controlling the washer using the spin + attributes (WASHERCTRL.S.F00(SPIN) is true)" + PICS: WASHERCTRL.S.F00 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x1] - ON TH(Chip-tool) verify the Accepted-command-list value is 0 entries - disabled: true + - label: + "Step 3: TH reads from the DUT the FeatureMap attribute, bit 1 set to + 1 if the DUT supports rinse attributes (WASHERCTRL.S.F01(RINSE) is + true)" + PICS: WASHERCTRL.S.F01 + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x2] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65530, 65531, 65532, 65533] + + - label: "Step 4a: TH reads from the DUT the AttributeList attribute." + PICS: "!PICS_EVENT_LIST_ENABLED" + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [65528, 65529, 65531, 65532, 65533] - label: - "Step 7: TH reads from the DUT the (0xFFF8) GeneratedCommandList - attribute" - verification: | - ./chip-tool laundrywashercontrols read generated-command-list 1 1 + "Step 4b: Read the feature dependent(WASHERCTRL.S.F00) attributes in + AttributeList from DUT." + PICS: WASHERCTRL.S.F00 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [0, 1] - ON TH(Chip-tool) verify the Generated-command-list value is 0 entries - disabled: true + - label: + "Step 4c: Read the feature dependent(WASHERCTRL.S.F01) attributes in + AttributeList from DUT." + PICS: WASHERCTRL.S.F01 + command: "readAttribute" + attribute: "AttributeList" + response: + constraints: + type: list + contains: [2, 3] + + - label: "Step 5: TH reads EventList attribute from DUT" + PICS: PICS_EVENT_LIST_ENABLED + command: "readAttribute" + attribute: "EventList" + response: + value: [] + constraints: + type: list + + - label: "Step 6: TH reads AcceptedCommandList attribute from DUT" + command: "readAttribute" + attribute: "AcceptedCommandList" + response: + value: [] + constraints: + type: list + + - label: "Step 7: TH reads GeneratedCommandList attribute from DUT" + command: "readAttribute" + attribute: "GeneratedCommandList" + response: + value: [] + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_1.yaml index ddbf6913e957b0..cc33e0685fea1f 100644 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_1.yaml @@ -11,32 +11,102 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 185.2.1. [TC-WASHERCTRL-2.1] Optional Spin attributes with DUT as Server +name: 186.2.1. [TC-WASHERCTRL-2.1] Optional Spin attributes with DUT as Server PICS: - WASHERCTRL.S.F00 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Controls" + endpoint: 1 -tests: - - label: "Step 1: Commission DUT to TH" - verification: | + SpinSpeedCurrentValue: + type: int8u + defaultValue: 3 - disabled: true + unsupportedSpinSpeedCurrentValue: + type: int8u + defaultValue: 17 + +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the the SpinSpeeds attribute" PICS: WASHERCTRL.S.A0000 - verification: | - Verify that the DUT response contains a list of strings with a maximum number of 16. - disabled: true + command: "readAttribute" + attribute: "SpinSpeeds" + response: + constraints: + type: list + maxLength: 16 - label: "Step 3: TH reads from the DUT the the SpinSpeedCurrent attribute" PICS: WASHERCTRL.S.A0001 + command: "readAttribute" + attribute: "SpinSpeedCurrent" + response: + constraints: + type: int8u + minValue: 0 + + - label: + "Verify that the DUT response contains a uint8 with value between 0 + and numSpinSpeeds-1 inclusive." verification: | - Verify that the DUT response contains a uint8 with value between 0 and 15 inclusive. - disabled: true + On TH(Chip-tool), Verify the SpinSpeedCurrent attribute contains value is in the range of 0 and numSpinSpeeds-1. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && WASHERCTRL.S.A0001 + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Step 4: TH writes a supported SpinSpeedCurrent attribute that is a + valid index into the list of spin speeds (0 to numSpinSpeeds-1)" + PICS: WASHERCTRL.S.A0001 + command: "writeAttribute" + attribute: "SpinSpeedCurrent" + arguments: + value: SpinSpeedCurrentValue + + - label: "Wait 2 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 2000 + + - label: + "Step 5: after a few seconds, TH reads from the DUT the + SpinSpeedCurrent attribute" + PICS: WASHERCTRL.S.A0001 + command: "readAttribute" + attribute: "SpinSpeedCurrent" + response: + value: SpinSpeedCurrentValue + constraints: + type: int8u + + - label: + "Step 6: TH writes an unsupported SpinSpeedCurrent attribute that is + other than 0 to DUT" + PICS: WASHERCTRL.S.A0001 + command: "writeAttribute" + attribute: "SpinSpeedCurrent" + arguments: + value: unsupportedSpinSpeedCurrentValue + response: + error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_2.yaml index 891067997f6525..06b1b2445130df 100644 --- a/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WASHERCTRL_2_2.yaml @@ -11,32 +11,98 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default -name: 185.2.2. [TC-WASHERCTRL-2.2] Optional rinse attributes with DUT as Server +name: 186.2.2. [TC-WASHERCTRL-2.2] Optional rinse attributes with DUT as Server PICS: - - WASHERCTRL.S.F00 + - WASHERCTRL.S.F01 config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Laundry Washer Controls" + endpoint: 1 -tests: - - label: "Step 1: Commission DUT to TH" - verification: | + NumberOfRinsesValue: + type: enum8 + defaultValue: 1 + unsupportedNumberOfRinsesValue: + type: enum8 + defaultValue: 5 - disabled: true +tests: + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the the NumberOfRinses attribute" PICS: WASHERCTRL.S.A0002 - verification: | - Verify that the DUT response contains if not null, an enum with up to 4 values. - disabled: true + command: "readAttribute" + attribute: "NumberOfRinses" + response: + constraints: + type: enum8 + minValue: 0 + maxValue: 3 - label: "Step 3: TH reads from the DUT the the SupportedRinses attribute" PICS: WASHERCTRL.S.A0003 + command: "readAttribute" + attribute: "SupportedRinses" + response: + constraints: + type: list + maxLength: 4 + + - label: + "Step 4: TH writes a supported NumberOfRinses attribute to DUT within + the range of the SupportedRinses list" + PICS: WASHERCTRL.S.A0002 + command: "writeAttribute" + attribute: "NumberOfRinses" + arguments: + value: NumberOfRinsesValue + + - label: "Wait 2 seconds" + cluster: "DelayCommands" + command: "WaitForMs" + arguments: + values: + - name: "ms" + value: 2000 + + - label: + "Step 5: after a few seconds, TH reads from the DUT the NumberOfRinses + attribute" + PICS: WASHERCTRL.S.A0002 + command: "readAttribute" + attribute: "NumberOfRinses" + response: + value: NumberOfRinsesValue + + - label: "Step 6: Operate device to set the condition to read only" verification: | - Verify that the DUT response contains a list of enums each containing up to 4 values. - disabled: true + Manual operation required + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && WASHERCTRL.S.M.ManuallyControlled + arguments: + values: + - name: "message" + value: "Please enter 'y' for success" + - name: "expectedValue" + value: "y" + + - label: + "Step 7: TH writes an unsupported NumberOfRinses attribute to DUT + while DUT is not in a valid state." + PICS: WASHERCTRL.S.M.ManuallyControlled && WASHERCTRL.S.A0002 + command: "writeAttribute" + attribute: "NumberOfRinses" + arguments: + value: unsupportedNumberOfRinsesValue + response: + error: INVALID_IN_STATE diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml index 3359307064a0fb..bddc895d325ed8 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml @@ -108,15 +108,6 @@ tests: ######## UpOrOpen Command ####### ### Step 2x -> Check UpOrOpen Fast effects - - label: "Step 2: Subscribe to DUT reports on OperationalStatus attribute" - command: "subscribeAttribute" - attribute: "OperationalStatus" - minInterval: 4 - maxInterval: 5 - response: - constraints: - type: bitmap8 - ### MANDATORY Command - label: "Step 2a: TH sends UpOrOpen command to DUT" command: "UpOrOpen" @@ -164,7 +155,7 @@ tests: ### Depends on the FeatureMap # The value of bit 0..1 must be 01b & if (LF) value of bit 2..3 must be 01b else 00b & if (TL) value of bit 4..5 must be 01b else 00b # Only 3 possibilities are possible here : 05h = 5, 11h = 17 or 15h = 21 then check a range for simplicity [5 - 21] - - label: "Step 3a: TH reads OperationalStatus attribute's bit 0..1" + - label: "Step 3a1: TH reads OperationalStatus attribute's bit 0..1" PICS: WNCV.S.A000a command: "readAttribute" attribute: "OperationalStatus" @@ -176,7 +167,7 @@ tests: hasMasksClear: [0x2] - label: - "Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do + "Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in upcoming OperationalStatus read steps." PICS: WNCV.S.A000a cluster: "Unit Testing" @@ -186,7 +177,7 @@ tests: value: OperationalStatusValue - label: - "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + "Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" PICS: WNCV.S.A000a && WNCV.S.F00 cluster: "Unit Testing" command: "readAttribute" @@ -199,7 +190,7 @@ tests: hasMasksClear: [0x8] - label: - "Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + "Step 3a4: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" PICS: WNCV.S.A000a && !WNCV.S.F00 cluster: "Unit Testing" command: "readAttribute" @@ -211,7 +202,7 @@ tests: hasMasksClear: [0x4, 0x8] - label: - "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + "Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" PICS: WNCV.S.A000a && WNCV.S.F01 cluster: "Unit Testing" command: "readAttribute" @@ -224,7 +215,7 @@ tests: hasMasksClear: [0x20] - label: - "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + "Step 3a6: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" PICS: WNCV.S.A000a && !WNCV.S.F01 cluster: "Unit Testing" command: "readAttribute" @@ -236,7 +227,7 @@ tests: hasMasksClear: [0x10, 0x20] ### Depending on the DUT specs we might prefer a arguments here - - label: "Step 3a2: DUT updates its attributes" + - label: "Step 3a7: DUT updates its attributes" cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml index 7c710cf5be394f..ed3873b6ae10bc 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml @@ -108,15 +108,6 @@ tests: ######## DownOrClose Command ####### ### Step 2x -> Check DownOrClose Fast effects - - label: "Step 2: Subscribe to DUT reports on OperationalStatus attribute" - command: "subscribeAttribute" - attribute: "OperationalStatus" - minInterval: 4 - maxInterval: 5 - response: - constraints: - type: bitmap8 - ### MANDATORY Command - label: "Step 2a: TH sends DownOrClose command to DUT" command: "DownOrClose" @@ -164,7 +155,7 @@ tests: ### Depends on the FeatureMap # The value of bit 0..1 must be 10b & if (LF) value of bit 2..3 must be 10b else 00b & if (TL) value of bit 4..5 must be 10b else 00b # Only 3 possibilities are possible here : 0Ah = 10, 22h = 34 or 2Ah = 42 then check a range for simplicity [10 - 42] - - label: "Step 3a: TH reads OperationalStatus attribute's bit 0..1" + - label: "Step 3a1: TH reads OperationalStatus attribute's bit 0..1" PICS: WNCV.S.A000a command: "readAttribute" attribute: "OperationalStatus" @@ -176,7 +167,7 @@ tests: hasMasksClear: [0x1] - label: - "Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do + "Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in upcoming OperationalStatus read steps." PICS: WNCV.S.A000a cluster: "Unit Testing" @@ -186,7 +177,7 @@ tests: value: OperationalStatusValue - label: - "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + "Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" PICS: WNCV.S.A000a && WNCV.S.F00 cluster: "Unit Testing" command: "readAttribute" @@ -199,7 +190,7 @@ tests: hasMasksClear: [0x4] - label: - "Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" + "Step 3a4: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))" PICS: WNCV.S.A000a && !WNCV.S.F00 cluster: "Unit Testing" command: "readAttribute" @@ -211,7 +202,7 @@ tests: hasMasksClear: [0x4, 0x8] - label: - "Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + "Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" PICS: WNCV.S.A000a && WNCV.S.F01 cluster: "Unit Testing" command: "readAttribute" @@ -224,7 +215,7 @@ tests: hasMasksClear: [0x10] - label: - "Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" + "Step 3a6: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))" PICS: WNCV.S.A000a && !WNCV.S.F01 cluster: "Unit Testing" command: "readAttribute" @@ -236,7 +227,7 @@ tests: hasMasksClear: [0x10, 0x20] ### Depending on the DUT specs we might prefer a arguments here - - label: "Step 3a2: DUT updates its attributes" + - label: "Step 3a7: DUT updates its attributes" cluster: "DelayCommands" command: "WaitForMs" arguments: diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index e280baad7d579f..66b40dbe81572d 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1516,48 +1516,20 @@ DRLK.S.A0028.ReadOnly=1 DRLK.S.A002c.ReadOnly=1 #write attributes -DRLK.S.A0004.Write=0 -DRLK.S.A0005.Write=0 -DRLK.S.A0006.Write=0 -DRLK.S.A0021.Write=1 -DRLK.S.A0022.Write=0 -DRLK.S.A0023.Write=1 -DRLK.S.A0024.Write=1 -DRLK.S.A0025.Write=1 -DRLK.S.A0028.Write=0 -DRLK.S.A0029.Write=1 -DRLK.S.A002a.Write=1 -DRLK.S.A002b.Write=1 -DRLK.S.A002c.Write=1 -DRLK.S.A0030.Write=1 -DRLK.S.A0031.Write=1 -DRLK.S.A0032.Write=1 -DRLK.S.A0033.Write=1 -DRLK.S.A0035.Write=0 - -#ReadOnly attributes -DRLK.S.A0028.ReadOnly=1 -DRLK.S.A002c.ReadOnly=1 +DRLK.S.M.SimulateNotFullyLocked=1 +DRLK.S.M.DetectLockJammed=1 +DRLK.S.M.LanguageAttributeWritable=1 +DRLK.S.M.LEDSettingsAttributeWritable=1 +DRLK.S.M.AutoRelockTimeAttributeWritable=1 +DRLK.S.M.SoundVolumeAttributeWritable=1 +DRLK.S.M.OperatingModeAttributeWritable=1 +DRLK.S.M.EnableLocalProgrammingAttributeWritable=0 +DRLK.S.M.LocalProgrammingFeaturesAttributeWritable=0 +DRLK.S.M.WrongCodeEntryLimitAttributeWritable=1 +DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable=1 +DRLK.S.M.RequirePINForRemoteOperationAttributeWritable=1 +DRLK.S.M.ExpiringUserTimeOutAttributeWritable=0 -#write attributes -DRLK.S.A0004.Write=0 -DRLK.S.A0005.Write=0 -DRLK.S.A0006.Write=0 -DRLK.S.A0021.Write=1 -DRLK.S.A0022.Write=0 -DRLK.S.A0023.Write=1 -DRLK.S.A0024.Write=1 -DRLK.S.A0025.Write=1 -DRLK.S.A0028.Write=0 -DRLK.S.A0029.Write=1 -DRLK.S.A002a.Write=1 -DRLK.S.A002b.Write=1 -DRLK.S.A002c.Write=1 -DRLK.S.A0030.Write=1 -DRLK.S.A0031.Write=1 -DRLK.S.A0032.Write=1 -DRLK.S.A0033.Write=1 -DRLK.S.A0035.Write=0 DRLK.C=1 DRLK.C.F0a=0 @@ -2708,6 +2680,7 @@ WASHERCTRL.S.A0002=1 WASHERCTRL.S.A0003=1 WASHERCTRL.S.M.ManuallyControlledSpin=1 WASHERCTRL.S.M.ManuallyControlledRinse=1 +WASHERCTRL.S.M.ManuallyControlled=0 #RVC Run Mode RVCRUNM.S=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 90615d2a82ef29..91a6b7cf77efd5 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -108,6 +108,11 @@ "Test_TC_ULABEL_2_4" ], "LaundryWasherMode": ["Test_TC_LWM_1_1", "Test_TC_LWM_2_1"], + "LaundryWasherControl": [ + "Test_TC_WASHERCTRL_1_1", + "Test_TC_WASHERCTRL_2_1", + "Test_TC_WASHERCTRL_2_2" + ], "MediaControl": [ "Test_TC_LOWPOWER_1_1", "Test_TC_KEYPADINPUT_1_2", @@ -177,7 +182,6 @@ "RelativeHumidityMeasurement": ["Test_TC_RH_1_1", "Test_TC_RH_2_1"], "RoboticVacuumCleaner": [ "Test_TC_RVCCLEANM_1_1", - "Test_TC_RVCCLEANM_3_1", "Test_TC_RVCRUNM_1_1", "Test_TC_RVCOPSTATE_1_1" ], @@ -365,6 +369,7 @@ "UnitLocalization", "TimeFormatLocalization", "LaundryWasherMode", + "LaundryWasherControl", "MediaControl", "ModeSelect", "MultipleFabrics", diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index a2f917ac68c226..e797e989ad3f53 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -261,11 +261,7 @@ "LevelControl": [], "LaundryWasherMode": ["Test_TC_LWM_1_2", "Test_TC_LWM_3_2"], "OnOff": ["Test_TC_OO_2_3"], - "OperationalState": [ - "Test_TC_OPSTATE_2_1", - "Test_TC_OPSTATE_2_2", - "Test_TC_OPSTATE_2_3" - ], + "OperationalState": ["Test_TC_OPSTATE_2_2"], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], "SmokeCOAlarm": [], "RefrigeratorAlarm": [ @@ -275,11 +271,7 @@ ], "RVCCleanMode": ["Test_TC_RVCCLEANM_3_3"], "RVCOperationalState": ["Test_TC_RVCOPSTATE_2_2"], - "RVCRunMode": [ - "Test_TC_RVCRUNM_1_1", - "Test_TC_RVCRUNM_3_1", - "Test_TC_RVCRUNM_3_3" - ], + "RVCRunMode": ["Test_TC_RVCRUNM_3_3"], "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_2", "Test_TC_TCCM_2_1", @@ -317,13 +309,7 @@ "Test_TC_BRBINFO_2_2", "Test_TC_BRBINFO_3_1" ], - "WasherControls": [ - "Test_TC_WASHERCTRL_1_1", - "Test_TC_WASHERCTRL_2_1", - "Test_TC_WASHERCTRL_2_2", - "Test_TC_WASHERCTRL_3_1", - "Test_TC_WASHERCTRL_3_2" - ], + "LaundryWasherControl": [], "AccessControlEnforcement": [], "collection": [ "DeviceDiscovery", @@ -390,6 +376,6 @@ "UserLabel", "BridgedDeviceBasicInformation", "AccessControlEnforcement", - "WasherControls" + "LaundryWasherControl" ] } diff --git a/src/python_testing/drlk_2_x_common.py b/src/python_testing/drlk_2_x_common.py index bdc52cce1afd62..7ba07577b6b8b9 100644 --- a/src/python_testing/drlk_2_x_common.py +++ b/src/python_testing/drlk_2_x_common.py @@ -148,7 +148,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo requirePinForRemoteOperation_dut = False self.print_step("1", "TH writes the RequirePINforRemoteOperation attribute value as false on the DUT") attribute = attributes.RequirePINforRemoteOperation(False) - if self.check_pics("DRLK.S.A0033.Write"): + if self.check_pics("DRLK.S.M.RequirePINForRemoteOperationAttributeWritable"): await self.write_drlk_attribute_expect_success(attribute=attribute) else: await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) @@ -158,7 +158,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo requirePinForRemoteOperation_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.RequirePINforRemoteOperation) logging.info("Current RequirePINforRemoteOperation value is %s" % (requirePinForRemoteOperation_dut)) - if self.check_pics("DRLK.S.A0033.Write"): + if self.check_pics("DRLK.S.M.RequirePINForRemoteOperationAttributeWritable"): self.print_step("2a", "TH verifies that RequirePINforRemoteOperation is FALSE") asserts.assert_false(requirePinForRemoteOperation_dut, "RequirePINforRemoteOperation is expected to be FALSE") else: @@ -182,7 +182,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo if self.check_pics("DRLK.S.F00") and self.check_pics("DRLK.S.F07"): self.print_step("5", "TH writes the RequirePINforRemoteOperation attribute value as true on the DUT") attribute = attributes.RequirePINforRemoteOperation(True) - if self.check_pics("DRLK.S.A0033.Write"): + if self.check_pics("DRLK.S.M.RequirePINForRemoteOperationAttributeWritable"): await self.write_drlk_attribute_expect_success(attribute=attribute) else: await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) @@ -192,7 +192,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo requirePinForRemoteOperation_dut = await self.read_drlk_attribute_expect_success(attribute=attributes.RequirePINforRemoteOperation) logging.info("Current RequirePINforRemoteOperation value is %s" % (requirePinForRemoteOperation_dut)) - if self.check_pics("DRLK.S.A0033.Write"): + if self.check_pics("DRLK.S.M.RequirePINForRemoteOperationAttributeWritable"): self.print_step("6a", "TH verifies that RequirePINforRemoteOperation is TRUE") asserts.assert_true(requirePinForRemoteOperation_dut, "RequirePINforRemoteOperation is expected to be TRUE") @@ -216,7 +216,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo if self.check_pics("DRLK.S.F00") or self.check_pics("DRLK.S.F01"): self.print_step("10a", "TH writes the WrongCodeEntryLimit to any value between 1 and 255") attribute = attributes.WrongCodeEntryLimit(wrongCodeEntryLimit) - if self.check_pics("DRLK.S.A0030.Write"): + if self.check_pics("DRLK.S.M.WrongCodeEntryLimitAttributeWritable"): await self.write_drlk_attribute_expect_success(attribute=attribute) else: await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) @@ -228,7 +228,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo self.print_step("11a", "TH writes the UserCodeTemporaryDisableTime to any value between 1 and 255") attribute = attributes.UserCodeTemporaryDisableTime(userCodeTemporaryDisableTime) - if self.check_pics("DRLK.S.A0031.Write"): + if self.check_pics("DRLK.S.M.UserCodedTemporaryDisableTimeAttributeWritable"): await self.write_drlk_attribute_expect_success(attribute=attribute) else: await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) @@ -262,7 +262,7 @@ async def run_drlk_test_common(self, lockUnlockCommand, lockUnlockCmdRspPICS, lo if self.check_pics("DRLK.S.A0023"): self.print_step("15", "TH writes the AutoRelockTime attribute value on the DUT") attribute = attributes.AutoRelockTime(autoRelockTime) - if self.check_pics("DRLK.S.A0023.Write"): + if self.check_pics("DRLK.S.M.AutoRelockTimeAttributeWritable"): await self.write_drlk_attribute_expect_success(attribute=attribute) else: await self.write_drlk_attribute_expect_error(attribute=attribute, error=Status.UnsupportedWrite) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index da1a877800b832..5ed37c33b7a44e 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -134,6 +134,9 @@ class TestList : public Command { printf("Test_TC_LTIME_3_1\n"); printf("Test_TC_LWM_1_1\n"); printf("Test_TC_LWM_2_1\n"); + printf("Test_TC_WASHERCTRL_1_1\n"); + printf("Test_TC_WASHERCTRL_2_1\n"); + printf("Test_TC_WASHERCTRL_2_2\n"); printf("Test_TC_LOWPOWER_1_1\n"); printf("Test_TC_KEYPADINPUT_1_2\n"); printf("Test_TC_APPLAUNCHER_1_3\n"); @@ -196,7 +199,6 @@ class TestList : public Command { printf("Test_TC_RH_1_1\n"); printf("Test_TC_RH_2_1\n"); printf("Test_TC_RVCCLEANM_1_1\n"); - printf("Test_TC_RVCCLEANM_3_1\n"); printf("Test_TC_RVCRUNM_1_1\n"); printf("Test_TC_RVCOPSTATE_1_1\n"); printf("Test_TC_SMOKECO_1_1\n"); @@ -7299,10 +7301,6 @@ class Test_TC_BRBINFO_1_1 : public TestCommandBridge { break; case 1: ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads the ClusterRevision from DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT")) { - NextTest(); - return; - } err = TestStep2ThReadsTheClusterRevisionFromDut_1(); break; case 2: @@ -7590,11 +7588,27 @@ class Test_TC_BRBINFO_1_1 : public TestCommandBridge { CHIP_ERROR TestStep2ThReadsTheClusterRevisionFromDut_1() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterBridgedDeviceBasicInformation alloc] initWithDevice:device + endpointID:@(3) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision from DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 2U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep3ThReadsTheFeatureMapFromDut_2() @@ -67685,11 +67699,11 @@ class Test_TC_LWM_2_1 : public TestCommandBridge { } }; -class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { +class Test_TC_WASHERCTRL_1_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_LOWPOWER_1_1() - : TestCommandBridge("Test_TC_LOWPOWER_1_1") + Test_TC_WASHERCTRL_1_1() + : TestCommandBridge("Test_TC_WASHERCTRL_1_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -67699,7 +67713,7 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_LOWPOWER_1_1() {} + ~Test_TC_WASHERCTRL_1_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -67707,11 +67721,11 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WASHERCTRL_1_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WASHERCTRL_1_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -67728,45 +67742,91 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Read the global attribute: ClusterRevision\n"); - err = TestStep1ReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the ClusterRevision attribute\n"); + err = TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: Read the global attribute: FeatureMap\n"); - err = TestStep2ReadTheGlobalAttributeFeatureMap_2(); + ChipLogProgress(chipTool, + " ***** Test Step 2 : Step 3: TH reads from the DUT the FeatureMap attribute. If WASHERCTRL.S.F00(SPIN) & " + "WASHERCTRL.S.F01(RINSE) are false\n"); + if (ShouldSkip("!WASHERCTRL.S.F00 && !WASHERCTRL.S.F01")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeIfWasherctrlsf00spinWasherctrlsf01rinseAreFalse_2(); break; case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 3: TH reads from the DUT the FeatureMap attribute, bit 0 set to 1 if the DUT is capable " + "of controlling the washer using the spin attributes (WASHERCTRL.S.F00(SPIN) is true)\n"); + if (ShouldSkip("WASHERCTRL.S.F00")) { NextTest(); return; } - err = TestStep3ReadTheGlobalAttributeAttributeList_3(); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0SetTo1IfTheDutIsCapableOfControllingTheWasherUsingTheSpinAttributesWasherctrlsf00spinIsTrue_3(); break; case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3: Read the global attribute: AttributeList\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 3: TH reads from the DUT the FeatureMap attribute, bit 1 set to 1 if the DUT supports " + "rinse attributes (WASHERCTRL.S.F01(RINSE) is true)\n"); + if (ShouldSkip("WASHERCTRL.S.F01")) { NextTest(); return; } - err = TestStep3ReadTheGlobalAttributeAttributeList_4(); + err = TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit1SetTo1IfTheDutSupportsRinseAttributesWasherctrlsf01rinseIsTrue_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4: Read the global attribute: AcceptedCommandList\n"); - err = TestStep4ReadTheGlobalAttributeAcceptedCommandList_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4a: TH reads from the DUT the AttributeList attribute\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5: Read the global attribute: GeneratedCommandList\n"); - err = TestStep5ReadTheGlobalAttributeGeneratedCommandList_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4a: TH reads from the DUT the AttributeList attribute.\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aThReadsFromTheDutTheAttributeListAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read the global attribute: EventList\n"); + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 4b: Read the feature dependent(WASHERCTRL.S.F00) attributes in AttributeList from " + "DUT.\n"); + if (ShouldSkip("WASHERCTRL.S.F00")) { + NextTest(); + return; + } + err = TestStep4bReadTheFeatureDependentWASHERCTRLSF00AttributesInAttributeListFromDut_7(); + break; + case 8: + ChipLogProgress(chipTool, + " ***** Test Step 8 : Step 4c: Read the feature dependent(WASHERCTRL.S.F01) attributes in AttributeList from " + "DUT.\n"); + if (ShouldSkip("WASHERCTRL.S.F01")) { + NextTest(); + return; + } + err = TestStep4cReadTheFeatureDependentWASHERCTRLSF01AttributesInAttributeListFromDut_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: TH reads EventList attribute from DUT\n"); if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { NextTest(); return; } NextTest(); return; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6: TH reads AcceptedCommandList attribute from DUT\n"); + err = TestStep6ThReadsAcceptedCommandListAttributeFromDut_10(); + break; + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 7: TH reads GeneratedCommandList attribute from DUT\n"); + err = TestStep7ThReadsGeneratedCommandListAttributeFromDut_11(); + break; } if (CHIP_NO_ERROR != err) { @@ -67802,6 +67862,18 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 8: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -67815,7 +67887,7 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 8; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; @@ -67830,15 +67902,17 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestStep1ReadTheGlobalAttributeClusterRevision_1() + CHIP_ERROR TestStep2ThReadsFromTheDutTheClusterRevisionAttribute_1() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 1: Read the global attribute: ClusterRevision Error: %@", err); + NSLog(@"Step 2: TH reads from the DUT the ClusterRevision attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -67854,15 +67928,19 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2ReadTheGlobalAttributeFeatureMap_2() + CHIP_ERROR TestStep3ThReadsFromTheDutTheFeatureMapAttributeIfWasherctrlsf00spinWasherctrlsf01rinseAreFalse_2() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: Read the global attribute: FeatureMap Error: %@", err); + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute. If WASHERCTRL.S.F00(SPIN) & WASHERCTRL.S.F01(RINSE) " + @"are false Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -67878,81 +67956,174 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ReadTheGlobalAttributeAttributeList_3() + CHIP_ERROR + TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit0SetTo1IfTheDutIsCapableOfControllingTheWasherUsingTheSpinAttributesWasherctrlsf00spinIsTrue_3() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 0 set to 1 if the DUT is capable of controlling " + @"the washer using the spin attributes (WASHERCTRL.S.F00(SPIN) is true) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR + TestStep3ThReadsFromTheDutTheFeatureMapAttributeBit1SetTo1IfTheDutSupportsRinseAttributesWasherctrlsf01rinseIsTrue_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the FeatureMap attribute, bit 1 set to 1 if the DUT supports rinse attributes " + @"(WASHERCTRL.S.F01(RINSE) is true) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Read the global attribute: AttributeList Error: %@", err); + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); - VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65530UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsFromTheDutTheAttributeListAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads from the DUT the AttributeList attribute. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3ReadTheGlobalAttributeAttributeList_4() + CHIP_ERROR TestStep4bReadTheFeatureDependentWASHERCTRLSF00AttributesInAttributeListFromDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Read the global attribute: AttributeList Error: %@", err); + NSLog(@"Step 4b: Read the feature dependent(WASHERCTRL.S.F00) attributes in AttributeList from DUT. Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = value; - VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); - VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); - VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); - VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); - VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); - VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4cReadTheFeatureDependentWASHERCTRLSF01AttributesInAttributeListFromDut_8() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Read the feature dependent(WASHERCTRL.S.F01) attributes in AttributeList from DUT. Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ReadTheGlobalAttributeAcceptedCommandList_5() + CHIP_ERROR TestStep6ThReadsAcceptedCommandListAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: Read the global attribute: AcceptedCommandList Error: %@", err); + NSLog(@"Step 6: TH reads AcceptedCommandList attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(0))); } VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); @@ -67962,15 +68133,17 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ReadTheGlobalAttributeGeneratedCommandList_6() + CHIP_ERROR TestStep7ThReadsGeneratedCommandListAttributeFromDut_11() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 5: Read the global attribute: GeneratedCommandList Error: %@", err); + NSLog(@"Step 7: TH reads GeneratedCommandList attribute from DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -67987,21 +68160,23 @@ class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { } }; -class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { +class Test_TC_WASHERCTRL_2_1 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_KEYPADINPUT_1_2() - : TestCommandBridge("Test_TC_KEYPADINPUT_1_2") + Test_TC_WASHERCTRL_2_1() + : TestCommandBridge("Test_TC_WASHERCTRL_2_1") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("SpinSpeedCurrentValue", 0, UINT8_MAX, &mSpinSpeedCurrentValue); + AddArgument("unsupportedSpinSpeedCurrentValue", 0, UINT8_MAX, &mUnsupportedSpinSpeedCurrentValue); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_KEYPADINPUT_1_2() {} + ~Test_TC_WASHERCTRL_2_1() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -68009,11 +68184,11 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WASHERCTRL_2_1\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_1_2\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WASHERCTRL_2_1\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -68026,80 +68201,1017 @@ class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { // incorrect mTestIndex value observed when we get the response. switch (mTestIndex++) { case 0: - ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); - err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Read the global attribute: ClusterRevision\n"); - err = TestStep1ReadTheGlobalAttributeClusterRevision_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the the SpinSpeeds attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0000")) { + NextTest(); + return; + } + err = TestStep2ThReadsFromTheDutTheTheSpinSpeedsAttribute_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2a: Read the global attribute: FeatureMap\n"); - if (ShouldSkip(" !KEYPADINPUT.S.F00 && KEYPADINPUT.S.F01 && !KEYPADINPUT.S.F02 ")) { + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the the SpinSpeedCurrent attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0001")) { NextTest(); return; } - err = TestStep2aReadTheGlobalAttributeFeatureMap_2(); + err = TestStep3ThReadsFromTheDutTheTheSpinSpeedCurrentAttribute_2(); break; case 3: - ChipLogProgress( - chipTool, " ***** Test Step 3 : Step 2b: Given (KEYPADINPUT.S.F00(NV)) FeatureMap bit mask is set or not\n"); - if (ShouldSkip("KEYPADINPUT.S.F00")) { + ChipLogProgress(chipTool, + " ***** Test Step 3 : Verify that the DUT response contains a uint8 with value between 0 and numSpinSpeeds-1 " + "inclusive.\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && WASHERCTRL.S.A0001")) { NextTest(); return; } - err = TestStep2bGivenKeypadinputsf00nvFeatureMapBitMaskIsSetOrNot_3(); + err = TestVerifyThatTheDutResponseContainsAUint8WithValueBetween0AndNumSpinSpeeds1Inclusive_3(); break; case 4: - ChipLogProgress( - chipTool, " ***** Test Step 4 : Step 2c: Given (KEYPADINPUT.S.F01(LK)) FeatureMap bit mask is set or not\n"); - if (ShouldSkip("KEYPADINPUT.S.F01")) { + ChipLogProgress(chipTool, + " ***** Test Step 4 : Step 4: TH writes a supported SpinSpeedCurrent attribute that is a valid index into the list " + "of spin speeds (0 to numSpinSpeeds-1)\n"); + if (ShouldSkip("WASHERCTRL.S.A0001")) { NextTest(); return; } - err = TestStep2cGivenKeypadinputsf01lkFeatureMapBitMaskIsSetOrNot_4(); + err = TestStep4ThWritesASupportedSpinSpeedCurrentAttributeThatIsAValidIndexIntoTheListOfSpinSpeeds0ToNumSpinSpeeds1_4(); break; case 5: - ChipLogProgress( - chipTool, " ***** Test Step 5 : Step 2d: Given (KEYPADINPUT.S.F02(NK)) FeatureMap bit mask is set or not\n"); - if (ShouldSkip("KEYPADINPUT.S.F02")) { - NextTest(); - return; - } - err = TestStep2dGivenKeypadinputsf02nkFeatureMapBitMaskIsSetOrNot_5(); + ChipLogProgress(chipTool, " ***** Test Step 5 : Wait 2 seconds\n"); + err = TestWait2Seconds_5(); break; case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 3a: Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 6 : Step 5: after a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0001")) { NextTest(); return; } - err = TestStep3aReadTheGlobalAttributeAttributeList_6(); + err = TestStep5AfterAFewSecondsThReadsFromTheDutTheSpinSpeedCurrentAttribute_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 3a: Read the global attribute: AttributeList\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 6: TH writes an unsupported SpinSpeedCurrent attribute that is other than 0 to DUT\n"); + if (ShouldSkip("WASHERCTRL.S.A0001")) { NextTest(); return; } - err = TestStep3aReadTheGlobalAttributeAttributeList_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4: Read the global attribute: AcceptedCommandList\n"); - err = TestStep4ReadTheGlobalAttributeAcceptedCommandList_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: Read the global attribute: GeneratedCommandList\n"); - err = TestStep5ReadTheGlobalAttributeGeneratedCommandList_9(); + err = TestStep6ThWritesAnUnsupportedSpinSpeedCurrentAttributeThatIsOtherThan0ToDut_7(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6: Read the global attribute: EventList\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { - NextTest(); - return; - } - NextTest(); - return; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mSpinSpeedCurrentValue; + chip::Optional mUnsupportedSpinSpeedCurrentValue; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsFromTheDutTheTheSpinSpeedsAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSpinSpeedsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the the SpinSpeeds attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("spinSpeeds", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("spinSpeeds", value, 16)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheTheSpinSpeedCurrentAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSpinSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the the SpinSpeedCurrent attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("spinSpeedCurrent", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("spinSpeedCurrent", [value unsignedCharValue], 0U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheDutResponseContainsAUint8WithValueBetween0AndNumSpinSpeeds1Inclusive_3() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep4ThWritesASupportedSpinSpeedCurrentAttributeThatIsAValidIndexIntoTheListOfSpinSpeeds0ToNumSpinSpeeds1_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id spinSpeedCurrentArgument; + spinSpeedCurrentArgument = mSpinSpeedCurrentValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mSpinSpeedCurrentValue.Value()] + : [NSNumber numberWithUnsignedChar:3U]; + [cluster writeAttributeSpinSpeedCurrentWithValue:spinSpeedCurrentArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4: TH writes a supported SpinSpeedCurrent attribute that is a valid " + @"index into the list of spin speeds (0 to numSpinSpeeds-1) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait2Seconds_5() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep5AfterAFewSecondsThReadsFromTheDutTheSpinSpeedCurrentAttribute_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSpinSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: after a few seconds, TH reads from the DUT the SpinSpeedCurrent attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("SpinSpeedCurrent", actualValue)); + VerifyOrReturn(CheckValue( + "SpinSpeedCurrent", actualValue, mSpinSpeedCurrentValue.HasValue() ? mSpinSpeedCurrentValue.Value() : 3U)); + } + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("spinSpeedCurrent", "int8u", "int8u")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6ThWritesAnUnsupportedSpinSpeedCurrentAttributeThatIsOtherThan0ToDut_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id spinSpeedCurrentArgument; + spinSpeedCurrentArgument = mUnsupportedSpinSpeedCurrentValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mUnsupportedSpinSpeedCurrentValue.Value()] + : [NSNumber numberWithUnsignedChar:17U]; + [cluster writeAttributeSpinSpeedCurrentWithValue:spinSpeedCurrentArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 6: TH writes an unsupported SpinSpeedCurrent attribute that is " + @"other than 0 to DUT Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_CONSTRAINT_ERROR)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_WASHERCTRL_2_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_WASHERCTRL_2_2() + : TestCommandBridge("Test_TC_WASHERCTRL_2_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("NumberOfRinsesValue", 0, UINT8_MAX, &mNumberOfRinsesValue); + AddArgument("unsupportedNumberOfRinsesValue", 0, UINT8_MAX, &mUnsupportedNumberOfRinsesValue); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_WASHERCTRL_2_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_WASHERCTRL_2_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_WASHERCTRL_2_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the the NumberOfRinses attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0002")) { + NextTest(); + return; + } + err = TestStep2ThReadsFromTheDutTheTheNumberOfRinsesAttribute_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the the SupportedRinses attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0003")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheTheSupportedRinsesAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Step 4: TH writes a supported NumberOfRinses attribute to DUT within the range of the " + "SupportedRinses list\n"); + if (ShouldSkip("WASHERCTRL.S.A0002")) { + NextTest(); + return; + } + err = TestStep4ThWritesASupportedNumberOfRinsesAttributeToDutWithinTheRangeOfTheSupportedRinsesList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Wait 2 seconds\n"); + err = TestWait2Seconds_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Step 5: after a few seconds, TH reads from the DUT the NumberOfRinses attribute\n"); + if (ShouldSkip("WASHERCTRL.S.A0002")) { + NextTest(); + return; + } + err = TestStep5AfterAFewSecondsThReadsFromTheDutTheNumberOfRinsesAttribute_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6: Operate device to set the condition to read only\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && WASHERCTRL.S.M.ManuallyControlled")) { + NextTest(); + return; + } + err = TestStep6OperateDeviceToSetTheConditionToReadOnly_6(); + break; + case 7: + ChipLogProgress(chipTool, + " ***** Test Step 7 : Step 7: TH writes an unsupported NumberOfRinses attribute to DUT while DUT is not in a valid " + "state.\n"); + if (ShouldSkip("WASHERCTRL.S.M.ManuallyControlled && WASHERCTRL.S.A0002")) { + NextTest(); + return; + } + err = TestStep7ThWritesAnUnsupportedNumberOfRinsesAttributeToDutWhileDutIsNotInAValidState_7(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_IN_STATE)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mNumberOfRinsesValue; + chip::Optional mUnsupportedNumberOfRinsesValue; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsFromTheDutTheTheNumberOfRinsesAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfRinsesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the the NumberOfRinses attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("numberOfRinses", "enum8", "enum8")); + VerifyOrReturn(CheckConstraintMinValue("numberOfRinses", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("numberOfRinses", [value unsignedCharValue], 3U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheTheSupportedRinsesAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSupportedRinsesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the the SupportedRinses attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supportedRinses", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("supportedRinses", value, 4)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ThWritesASupportedNumberOfRinsesAttributeToDutWithinTheRangeOfTheSupportedRinsesList_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id numberOfRinsesArgument; + numberOfRinsesArgument = mNumberOfRinsesValue.HasValue() ? [NSNumber numberWithUnsignedChar:mNumberOfRinsesValue.Value()] + : [NSNumber numberWithUnsignedChar:1U]; + [cluster writeAttributeNumberOfRinsesWithValue:numberOfRinsesArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 4: TH writes a supported NumberOfRinses attribute to DUT within the " + @"range of the SupportedRinses list Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWait2Seconds_4() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; + value.ms = 2000UL; + return WaitForMs("alpha", value); + } + + CHIP_ERROR TestStep5AfterAFewSecondsThReadsFromTheDutTheNumberOfRinsesAttribute_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNumberOfRinsesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: after a few seconds, TH reads from the DUT the NumberOfRinses attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn( + CheckValue("NumberOfRinses", actualValue, mNumberOfRinsesValue.HasValue() ? mNumberOfRinsesValue.Value() : 1U)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep6OperateDeviceToSetTheConditionToReadOnly_6() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestStep7ThWritesAnUnsupportedNumberOfRinsesAttributeToDutWhileDutIsNotInAValidState_7() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLaundryWasherControls alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id numberOfRinsesArgument; + numberOfRinsesArgument = mUnsupportedNumberOfRinsesValue.HasValue() + ? [NSNumber numberWithUnsignedChar:mUnsupportedNumberOfRinsesValue.Value()] + : [NSNumber numberWithUnsignedChar:5U]; + [cluster writeAttributeNumberOfRinsesWithValue:numberOfRinsesArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Step 7: TH writes an unsupported NumberOfRinses attribute to DUT while DUT " + @"is not in a valid state. Error: %@", + err); + + VerifyOrReturn(CheckValue("status", + err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] + ? err.code + : EMBER_ZCL_STATUS_FAILURE) + : 0, + EMBER_ZCL_STATUS_INVALID_IN_STATE)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_LOWPOWER_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_LOWPOWER_1_1() + : TestCommandBridge("Test_TC_LOWPOWER_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_LOWPOWER_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_LOWPOWER_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_LOWPOWER_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Read the global attribute: ClusterRevision\n"); + err = TestStep1ReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: Read the global attribute: FeatureMap\n"); + err = TestStep2ReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep3ReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3: Read the global attribute: AttributeList\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep3ReadTheGlobalAttributeAttributeList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4: Read the global attribute: AcceptedCommandList\n"); + err = TestStep4ReadTheGlobalAttributeAcceptedCommandList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5: Read the global attribute: GeneratedCommandList\n"); + err = TestStep5ReadTheGlobalAttributeGeneratedCommandList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read the global attribute: EventList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 4: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 7: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 8; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep1ReadTheGlobalAttributeClusterRevision_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 1: Read the global attribute: ClusterRevision Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep2ReadTheGlobalAttributeFeatureMap_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: Read the global attribute: FeatureMap Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); + } + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ReadTheGlobalAttributeAttributeList_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(6))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65530UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[5], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ReadTheGlobalAttributeAttributeList_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: Read the global attribute: AttributeList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AttributeList", [actualValue count], static_cast(5))); + VerifyOrReturn(CheckValue("", actualValue[0], 65528UL)); + VerifyOrReturn(CheckValue("", actualValue[1], 65529UL)); + VerifyOrReturn(CheckValue("", actualValue[2], 65531UL)); + VerifyOrReturn(CheckValue("", actualValue[3], 65532UL)); + VerifyOrReturn(CheckValue("", actualValue[4], 65533UL)); + } + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4ReadTheGlobalAttributeAcceptedCommandList_5() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: Read the global attribute: AcceptedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep5ReadTheGlobalAttributeGeneratedCommandList_6() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: Read the global attribute: GeneratedCommandList Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(0))); + } + + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_KEYPADINPUT_1_2 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_KEYPADINPUT_1_2() + : TestCommandBridge("Test_TC_KEYPADINPUT_1_2") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_KEYPADINPUT_1_2() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_KEYPADINPUT_1_2\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_KEYPADINPUT_1_2\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 1: Read the global attribute: ClusterRevision\n"); + err = TestStep1ReadTheGlobalAttributeClusterRevision_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2a: Read the global attribute: FeatureMap\n"); + if (ShouldSkip(" !KEYPADINPUT.S.F00 && KEYPADINPUT.S.F01 && !KEYPADINPUT.S.F02 ")) { + NextTest(); + return; + } + err = TestStep2aReadTheGlobalAttributeFeatureMap_2(); + break; + case 3: + ChipLogProgress( + chipTool, " ***** Test Step 3 : Step 2b: Given (KEYPADINPUT.S.F00(NV)) FeatureMap bit mask is set or not\n"); + if (ShouldSkip("KEYPADINPUT.S.F00")) { + NextTest(); + return; + } + err = TestStep2bGivenKeypadinputsf00nvFeatureMapBitMaskIsSetOrNot_3(); + break; + case 4: + ChipLogProgress( + chipTool, " ***** Test Step 4 : Step 2c: Given (KEYPADINPUT.S.F01(LK)) FeatureMap bit mask is set or not\n"); + if (ShouldSkip("KEYPADINPUT.S.F01")) { + NextTest(); + return; + } + err = TestStep2cGivenKeypadinputsf01lkFeatureMapBitMaskIsSetOrNot_4(); + break; + case 5: + ChipLogProgress( + chipTool, " ***** Test Step 5 : Step 2d: Given (KEYPADINPUT.S.F02(NK)) FeatureMap bit mask is set or not\n"); + if (ShouldSkip("KEYPADINPUT.S.F02")) { + NextTest(); + return; + } + err = TestStep2dGivenKeypadinputsf02nkFeatureMapBitMaskIsSetOrNot_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 3a: Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep3aReadTheGlobalAttributeAttributeList_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 3a: Read the global attribute: AttributeList\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep3aReadTheGlobalAttributeAttributeList_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 4: Read the global attribute: AcceptedCommandList\n"); + err = TestStep4ReadTheGlobalAttributeAcceptedCommandList_8(); + break; + case 9: + ChipLogProgress(chipTool, " ***** Test Step 9 : Step 5: Read the global attribute: GeneratedCommandList\n"); + err = TestStep5ReadTheGlobalAttributeGeneratedCommandList_9(); + break; + case 10: + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 6: Read the global attribute: EventList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; } if (CHIP_NO_ERROR != err) { @@ -78344,7 +79456,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1: TH sends a GetSetupPIN command to the DUT with test values provided by the product " "maker.\n"); - if (ShouldSkip("ALOGIN.S.C00.Rsp")) { + if (ShouldSkip("ALOGIN.S.C00.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } @@ -78354,7 +79466,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 3 : Step 2: TH sends a Login command to the DUT with test values provided by the product " "maker.\n"); - if (ShouldSkip("ALOGIN.S.C02.Rsp")) { + if (ShouldSkip("ALOGIN.S.C02.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } @@ -78364,7 +79476,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 4 : Step 3: TH sends a Logout command to the DUT with test values provided by the product " "maker.\n"); - if (ShouldSkip("ALOGIN.S.C03.Rsp")) { + if (ShouldSkip("ALOGIN.S.C03.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } @@ -78489,6 +79601,7 @@ class Test_TC_ALOGIN_12_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintMinLength("setupPIN", values.setupPIN, 11)); { setupPIN = values.setupPIN; } @@ -92570,433 +93683,15 @@ class Test_TC_RVCCLEANM_1_1 : public TestCommandBridge { case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 9: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 10: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 11: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - } - - // Go on to the next test. - ContinueOnChipMainThread(CHIP_NO_ERROR); - } - - chip::System::Clock::Timeout GetWaitDuration() const override - { - return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); - } - -private: - std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; - - chip::Optional mNodeId; - chip::Optional mCluster; - chip::Optional mEndpoint; - chip::Optional mTimeout; - - CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() - { - - chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; - value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; - return WaitForCommissionee("alpha", value); - } - - CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); - } - - VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); - } - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep3GivenRvccleanmsf00deponoffEnsureFeaturemapHasTheCorrectBitSet_3() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: Given RVCCLEANM.S.F00(DEPONOFF) ensure featuremap has the correct bit set Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_4() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_5() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4bThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_6() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4b: TH reads the optional attribute(StartUpMode) in AttributeList from the DUT Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4cReadTheFeatureDependentRVCCLEANMSF00DeponoffAndOptionalAttributeOnModeIsInAttributeListFromTheDut_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: Read the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF) and optional attribute(OnMode) is in " - @"AttributeList from the DUT Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep4cReadTheFeatureDependentRVCCLEANMSF00DeponoffAndOptionalAttributeOnModeIsNotInAttributeListFromTheDut_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4c: Read the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF) and optional attribute(OnMode) is not in " - @"AttributeList from the DUT Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); - VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); - - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep6ReadTheGlobalAttributeAcceptedCommandListCheckIfItContainsId0x0ChangeToMode_10() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6: Read the global attribute AcceptedCommandList. Check if it contains id 0x0 (ChangeToMode) Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); - } - - VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandListCheckIfItContainsId0x1ChangeToModeResponse_11() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7: Read the global attribute: GeneratedCommandList. Check if it contains id 0x1 (ChangeToModeResponse) " - @"Error: %@", - err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - { - id actualValue = value; - VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); - VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); - } - - VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); - NextTest(); - }]; - - return CHIP_NO_ERROR; - } -}; - -class Test_TC_RVCCLEANM_3_1 : public TestCommandBridge { -public: - // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_RVCCLEANM_3_1() - : TestCommandBridge("Test_TC_RVCCLEANM_3_1") - , mTestIndex(0) - { - AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); - AddArgument("cluster", &mCluster); - AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); - AddArgument("new_mode_th", 0, UINT8_MAX, &mNewModeTh); - AddArgument("timeout", 0, UINT16_MAX, &mTimeout); - } - // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - - ~Test_TC_RVCCLEANM_3_1() {} - - /////////// TestCommand Interface ///////// - void NextTest() override - { - CHIP_ERROR err = CHIP_NO_ERROR; - - if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_RVCCLEANM_3_1\n"); - } - - if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_RVCCLEANM_3_1\n"); - SetCommandExitStatus(CHIP_NO_ERROR); - return; - } - - Wait(); - - // Ensure we increment mTestIndex before we start running the relevant - // command. That way if we lose the timeslice after we send the message - // but before our function call returns, we won't end up with an - // incorrect mTestIndex value observed when we get the response. - switch (mTestIndex++) { - case 0: - ChipLogProgress( - chipTool, " ***** Test Step 0 : Step 1: Commission DUT to TH (can be skipped if done in a preceding test).\n"); - err = TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0(); - break; - case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Precondition: TH writes from the DUT the OnMode attribute.\n"); - if (ShouldSkip("RVCCLEANM.S.A0003 && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestPreconditionThWritesFromTheDutTheOnModeAttribute_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: TH reads from the DUT the OnMode attribute.\n"); - if (ShouldSkip("RVCCLEANM.S.A0003 && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep2ThReadsFromTheDutTheOnModeAttribute_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH reads from the DUT the CurrentMode attribute.\n"); - if (ShouldSkip("RVCCLEANM.S.A0001 && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep3ThReadsFromTheDutTheCurrentModeAttribute_3(); - break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: TH reads from the DUT the SupportedModes attribute.\n"); - if (ShouldSkip("RVCCLEANM.S.A0000 && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep4ThReadsFromTheDutTheSupportedModesAttribute_4(); - break; - case 5: - ChipLogProgress(chipTool, - " ***** Test Step 5 : Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th\n"); - if (ShouldSkip("RVCCLEANM.S.C00.Rsp && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep5ThSendsAChangeToModeCommandToTheDutWithNewModeSetToNewModeTh_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 6:TH sends a Off command to the DUT\n"); - if (ShouldSkip("OO.S.C00.Rsp && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep6thSendsAOffCommandToTheDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 7:TH sends a On command to the DUT\n"); - if (ShouldSkip("OO.S.C01.Rsp && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep7thSendsAOnCommandToTheDut_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 8: TH reads from the DUT the CurrentMode attribute.\n"); - if (ShouldSkip("RVCCLEANM.S.A0001 && RVCCLEANM.S.F00")) { - NextTest(); - return; - } - err = TestStep8ThReadsFromTheDutTheCurrentModeAttribute_8(); - break; - } - - if (CHIP_NO_ERROR != err) { - ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); - SetCommandExitStatus(err); - } - } - - void OnStatusUpdate(const chip::app::StatusIB & status) override - { - switch (mTestIndex - 1) { - case 0: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 1: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 2: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 3: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 4: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 5: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 6: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 7: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 8: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; + case 9: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 10: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -93010,15 +93705,14 @@ class Test_TC_RVCCLEANM_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 9; + const uint16_t mTestCount = 12; chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; - chip::Optional mNewModeTh; chip::Optional mTimeout; - CHIP_ERROR TestStep1CommissionDutToThCanBeSkippedIfDoneInAPrecedingTest_0() + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() { chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; @@ -93026,75 +93720,94 @@ class Test_TC_RVCCLEANM_3_1 : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestPreconditionThWritesFromTheDutTheOnModeAttribute_1() + CHIP_ERROR TestStep2ThReadsTheClusterRevisionAttributeFromTheDut_1() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - id onModeArgument; - onModeArgument = [NSNumber numberWithUnsignedChar:0U]; - [cluster writeAttributeOnModeWithValue:onModeArgument - completion:^(NSError * _Nullable err) { - NSLog(@"Precondition: TH writes from the DUT the OnMode attribute. Error: %@", err); + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads the ClusterRevision attribute from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - NextTest(); - }]; + { + id actualValue = value; + VerifyOrReturn(CheckValue("ClusterRevision", actualValue, 1U)); + } + + VerifyOrReturn(CheckConstraintType("clusterRevision", "int16u", "int16u")); + NextTest(); + }]; return CHIP_NO_ERROR; } - NSNumber * _Nullable on_mode_dut; - CHIP_ERROR TestStep2ThReadsFromTheDutTheOnModeAttribute_2() + CHIP_ERROR TestStep3ThReadsTheFeatureMapAttributeFromTheDut_2() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: TH reads from the DUT the OnMode attribute. Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the FeatureMap attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (value != nil) { - - VerifyOrReturn(CheckConstraintType("onMode", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("onMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("onMode", [value unsignedCharValue], 254U)); - } { - on_mode_dut = value; + id actualValue = value; + VerifyOrReturn(CheckValue("FeatureMap", actualValue, 0UL)); } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); NextTest(); }]; return CHIP_NO_ERROR; } - NSNumber * _Nonnull old_current_mode_dut; - CHIP_ERROR TestStep3ThReadsFromTheDutTheCurrentModeAttribute_3() + CHIP_ERROR TestStep3GivenRvccleanmsf00deponoffEnsureFeaturemapHasTheCorrectBitSet_3() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3: TH reads from the DUT the CurrentMode attribute. Error: %@", err); + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: Given RVCCLEANM.S.F00(DEPONOFF) ensure featuremap has the correct bit set Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("currentMode", "int8u", "int8u")); - VerifyOrReturn(CheckConstraintMinValue("currentMode", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("currentMode", [value unsignedCharValue], 254U)); - { - old_current_mode_dut = value; - } + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_4() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65530UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); NextTest(); }]; @@ -93102,108 +93815,147 @@ class Test_TC_RVCCLEANM_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4ThReadsFromTheDutTheSupportedModesAttribute_4() + CHIP_ERROR TestStep4aThReadsTheAttributeListAttributeFromTheDut_5() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 4: TH reads from the DUT the SupportedModes attribute. Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4a: TH reads the AttributeList attribute from the DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("supportedModes", "list", "list")); - VerifyOrReturn(CheckConstraintMinLength("supportedModes", value, 2)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 0UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65528UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65529UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65531UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65532UL)); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 65533UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5ThSendsAChangeToModeCommandToTheDutWithNewModeSetToNewModeTh_5() + CHIP_ERROR TestStep4bThReadsTheOptionalAttributeStartUpModeInAttributeListFromTheDut_6() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - __auto_type * params = [[MTRRVCCleanModeClusterChangeToModeParams alloc] init]; - params.newMode - = mNewModeTh.HasValue() ? [NSNumber numberWithUnsignedChar:mNewModeTh.Value()] : [NSNumber numberWithUnsignedChar:1U]; - [cluster - changeToModeWithParams:params - completion:^(MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 5: TH sends a ChangeToMode command to the DUT with NewMode set to new_mode_th Error: %@", - err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4b: TH reads the optional attribute(StartUpMode) in AttributeList from the DUT Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 2UL)); - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep6thSendsAOffCommandToTheDut_6() + CHIP_ERROR TestStep4cReadTheFeatureDependentRVCCLEANMSF00DeponoffAndOptionalAttributeOnModeIsInAttributeListFromTheDut_7() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster offWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 6:TH sends a Off command to the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Read the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF) and optional attribute(OnMode) is in " + @"AttributeList from the DUT Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintContains("attributeList", value, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7thSendsAOnCommandToTheDut_7() + CHIP_ERROR TestStep4cReadTheFeatureDependentRVCCLEANMSF00DeponoffAndOptionalAttributeOnModeIsNotInAttributeListFromTheDut_8() { MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster onWithCompletion:^(NSError * _Nullable err) { - NSLog(@"Step 7:TH sends a On command to the DUT Error: %@", err); + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4c: Read the Feature dependent(RVCCLEANM.S.F00 - DEPONOFF) and optional attribute(OnMode) is not in " + @"AttributeList from the DUT Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckConstraintType("attributeList", "list", "list")); + VerifyOrReturn(CheckConstraintExcludes("attributeList", value, 3UL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep8ThReadsFromTheDutTheCurrentModeAttribute_8() + CHIP_ERROR TestStep6ReadTheGlobalAttributeAcceptedCommandListCheckIfItContainsId0x0ChangeToMode_10() { MTRBaseDevice * device = GetDevice("alpha"); __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 8: TH reads from the DUT the CurrentMode attribute. Error: %@", err); + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: Read the global attribute AcceptedCommandList. Check if it contains id 0x0 (ChangeToMode) Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("AcceptedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 0UL)); + } + + VerifyOrReturn(CheckConstraintType("acceptedCommandList", "list", "list")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep7ReadTheGlobalAttributeGeneratedCommandListCheckIfItContainsId0x1ChangeToModeResponse_11() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterRVCCleanMode alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 7: Read the global attribute: GeneratedCommandList. Check if it contains id 0x1 (ChangeToModeResponse) " + @"Error: %@", + err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("CurrentMode", actualValue, on_mode_dut)); + VerifyOrReturn(CheckValue("GeneratedCommandList", [actualValue count], static_cast(1))); + VerifyOrReturn(CheckValue("", actualValue[0], 1UL)); } + VerifyOrReturn(CheckConstraintType("generatedCommandList", "list", "list")); NextTest(); }]; @@ -108805,185 +109557,176 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { err = TestStep1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Report: Step 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = TestReportStep2SubscribeToDutReportsOnOperationalStatusAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = TestStep2SubscribeToDutReportsOnOperationalStatusAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2a: TH sends UpOrOpen command to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2a: TH sends UpOrOpen command to DUT\n"); if (ShouldSkip("WNCV.S.C00.Rsp")) { NextTest(); return; } - err = TestStep2aThSendsUpOrOpenCommandToDut_9(); + err = TestStep2aThSendsUpOrOpenCommandToDut_7(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: DUT updates its attributes\n"); - err = TestStep2bDutUpdatesItsAttributes_10(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2b: DUT updates its attributes\n"); + err = TestStep2bDutUpdatesItsAttributes_8(); break; - case 11: + case 9: ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 9 : Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b")) { NextTest(); return; } - err = TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + err = TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_9(); break; - case 12: + case 10: ChipLogProgress(chipTool, - " ***** Test Step 12 : Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 10 : Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c")) { NextTest(); return; } - err = TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_12(); + err = TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_10(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 2e: TH leave the device moving for 2 seconds\n"); - err = TestStep2eThLeaveTheDeviceMovingFor2Seconds_13(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH leave the device moving for 2 seconds\n"); + err = TestStep2eThLeaveTheDeviceMovingFor2Seconds_11(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3a: TH reads OperationalStatus attribute's bit 0..1\n"); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a1: TH reads OperationalStatus attribute's bit 0..1\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit01_14(); + err = TestStep3a1ThReadsOperationalStatusAttributesBit01_12(); break; - case 15: + case 13: ChipLogProgress(chipTool, - " ***** Test Step 15 : Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " + " ***** Test Step 13 : Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " "upcoming OperationalStatus read steps.\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15(); + err = TestStep3a2WriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_13(); break; - case 16: + case 14: ChipLogProgress( - chipTool, " ***** Test Step 16 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + chipTool, " ***** Test Step 14 : Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16(); + err = TestStep3a3ThChecksOperationalStatusValueBit23Wncvsf00lf_14(); break; - case 17: + case 15: ChipLogProgress( - chipTool, " ***** Test Step 17 : Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + chipTool, " ***** Test Step 15 : Step 3a4: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThCheckOperationalStatusValueBit23Wncvsf00lf_17(); + err = TestStep3a4ThCheckOperationalStatusValueBit23Wncvsf00lf_15(); break; - case 18: + case 16: ChipLogProgress( - chipTool, " ***** Test Step 18 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + chipTool, " ***** Test Step 16 : Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18(); + err = TestStep3a5ThChecksOperationalStatusValueBit45Wncvsf01tl_16(); break; - case 19: + case 17: ChipLogProgress( - chipTool, " ***** Test Step 19 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + chipTool, " ***** Test Step 17 : Step 3a6: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_19(); + err = TestStep3a6ThChecksOperationalStatusValueBit45Wncvsf01tl_17(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Step 3a2: DUT updates its attributes\n"); - err = TestStep3a2DutUpdatesItsAttributes_20(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Step 3a7: DUT updates its attributes\n"); + err = TestStep3a7DutUpdatesItsAttributes_18(); break; - case 21: + case 19: ChipLogProgress(chipTool, - " ***** Test Step 21 : Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 19 : Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e")) { NextTest(); return; } - err = TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_21(); + err = TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_19(); break; - case 22: + case 20: ChipLogProgress(chipTool, - " ***** Test Step 22 : Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + " ***** Test Step 20 : Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008")) { NextTest(); return; } - err = TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_22(); + err = TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_20(); break; - case 23: + case 21: ChipLogProgress(chipTool, - " ***** Test Step 23 : Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 21 : Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f")) { NextTest(); return; } - err = TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_23(); + err = TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_21(); break; - case 24: + case 22: ChipLogProgress(chipTool, - " ***** Test Step 24 : Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + " ***** Test Step 22 : Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009")) { NextTest(); return; } - err = TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_24(); + err = TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_22(); break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Step 4a: TH sends a StopMotion command to DUT\n"); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Step 4a: TH sends a StopMotion command to DUT\n"); if (ShouldSkip("WNCV.S.C02.Rsp")) { NextTest(); return; } - err = TestStep4aThSendsAStopMotionCommandToDut_25(); + err = TestStep4aThSendsAStopMotionCommandToDut_23(); break; - case 26: + case 24: ChipLogProgress( - chipTool, " ***** Test Step 26 : Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); - err = TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_26(); + chipTool, " ***** Test Step 24 : Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_24(); break; - case 27: + case 25: ChipLogProgress(chipTool, - " ***** Test Step 27 : Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + " ***** Test Step 25 : Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_27(); + err = TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_25(); break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Step 5a: TH waits for x seconds attributes update on the device\n"); - err = TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_28(); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Step 5a: TH waits for x seconds attributes update on the device\n"); + err = TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_26(); break; - case 29: + case 27: ChipLogProgress(chipTool, - " ***** Test Step 29 : Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 27 : Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b")) { NextTest(); return; } - err = TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_29(); + err = TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_27(); break; - case 30: + case 28: ChipLogProgress(chipTool, - " ***** Test Step 30 : Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 28 : Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c")) { NextTest(); return; } - err = TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_30(); + err = TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_28(); break; } @@ -109083,12 +109826,6 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -109102,7 +109839,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 29; chip::Optional mNodeId; chip::Optional mCluster; @@ -109252,63 +109989,8 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; - - CHIP_ERROR TestReportStep2SubscribeToDutReportsOnOperationalStatusAttribute_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - test_Test_TC_WNCV_3_1_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Step 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); - testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled = true; - }; - - NextTest(); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2SubscribeToDutReportsOnOperationalStatusAttribute_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - uint16_t minIntervalArgument = 4U; - uint16_t maxIntervalArgument = 5U; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(minIntervalArgument) - maxInterval:@(maxIntervalArgument)]; - params.filterByFabric = true; - params.replaceExistingSubscriptions = true; - [cluster subscribeAttributeOperationalStatusWithParams:params - subscriptionEstablished:^{ - VerifyOrReturn( - testSendClusterTest_TC_WNCV_3_1_7_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (test_Test_TC_WNCV_3_1_OperationalStatus_Reported != nil) { - ResponseHandler callback = test_Test_TC_WNCV_3_1_OperationalStatus_Reported; - test_Test_TC_WNCV_3_1_OperationalStatus_Reported = nil; - callback(value, err); - } - }]; - - return CHIP_NO_ERROR; - } - CHIP_ERROR TestStep2aThSendsUpOrOpenCommandToDut_9() + CHIP_ERROR TestStep2aThSendsUpOrOpenCommandToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109326,7 +110008,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bDutUpdatesItsAttributes_10() + CHIP_ERROR TestStep2bDutUpdatesItsAttributes_8() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -109334,7 +110016,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + CHIP_ERROR TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109358,7 +110040,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_12() + CHIP_ERROR TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109382,7 +110064,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor2Seconds_13() + CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor2Seconds_11() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -109391,7 +110073,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { } NSNumber * _Nonnull OperationalStatusValue; - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit01_14() + CHIP_ERROR TestStep3a1ThReadsOperationalStatusAttributesBit01_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109399,7 +110081,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 0..1 Error: %@", err); + NSLog(@"Step 3a1: TH reads OperationalStatus attribute's bit 0..1 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -109414,7 +110096,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15() + CHIP_ERROR TestStep3a2WriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109425,7 +110107,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { bitmap8Argument = [OperationalStatusValue copy]; [cluster writeAttributeBitmap8WithValue:bitmap8Argument completion:^(NSError * _Nullable err) { - NSLog(@"Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits " + NSLog(@"Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits " @"checks in upcoming OperationalStatus read steps. Error: %@", err); @@ -109437,7 +110119,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16() + CHIP_ERROR TestStep3a3ThChecksOperationalStatusValueBit23Wncvsf00lf_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109445,7 +110127,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + NSLog(@"Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -109461,7 +110143,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThCheckOperationalStatusValueBit23Wncvsf00lf_17() + CHIP_ERROR TestStep3a4ThCheckOperationalStatusValueBit23Wncvsf00lf_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109469,7 +110151,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + NSLog(@"Step 3a4: TH check OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -109485,7 +110167,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18() + CHIP_ERROR TestStep3a5ThChecksOperationalStatusValueBit45Wncvsf01tl_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109493,7 +110175,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + NSLog(@"Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -109509,7 +110191,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_19() + CHIP_ERROR TestStep3a6ThChecksOperationalStatusValueBit45Wncvsf01tl_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109517,7 +110199,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + NSLog(@"Step 3a6: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -109533,7 +110215,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3a2DutUpdatesItsAttributes_20() + CHIP_ERROR TestStep3a7DutUpdatesItsAttributes_18() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -109541,7 +110223,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_21() + CHIP_ERROR TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109569,7 +110251,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_22() + CHIP_ERROR TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109596,7 +110278,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_23() + CHIP_ERROR TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109624,7 +110306,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_24() + CHIP_ERROR TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109651,7 +110333,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThSendsAStopMotionCommandToDut_25() + CHIP_ERROR TestStep4aThSendsAStopMotionCommandToDut_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109669,7 +110351,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_26() + CHIP_ERROR TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_24() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -109677,7 +110359,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_27() + CHIP_ERROR TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_25() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109700,7 +110382,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_28() + CHIP_ERROR TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_26() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -109708,7 +110390,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_29() + CHIP_ERROR TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109735,7 +110417,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_30() + CHIP_ERROR TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -109855,185 +110537,176 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { err = TestStep1fIfPaTlThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_6(); break; case 7: - ChipLogProgress( - chipTool, " ***** Test Step 7 : Report: Step 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = TestReportStep2SubscribeToDutReportsOnOperationalStatusAttribute_7(); - break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2: Subscribe to DUT reports on OperationalStatus attribute\n"); - err = TestStep2SubscribeToDutReportsOnOperationalStatusAttribute_8(); - break; - case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 2a: TH sends DownOrClose command to DUT\n"); + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 2a: TH sends DownOrClose command to DUT\n"); if (ShouldSkip("WNCV.S.C01.Rsp")) { NextTest(); return; } - err = TestStep2aThSendsDownOrCloseCommandToDut_9(); + err = TestStep2aThSendsDownOrCloseCommandToDut_7(); break; - case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 2b: DUT updates its attributes\n"); - err = TestStep2bDutUpdatesItsAttributes_10(); + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 2b: DUT updates its attributes\n"); + err = TestStep2bDutUpdatesItsAttributes_8(); break; - case 11: + case 9: ChipLogProgress(chipTool, - " ***** Test Step 11 : Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 9 : Step 2c: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b")) { NextTest(); return; } - err = TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11(); + err = TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_9(); break; - case 12: + case 10: ChipLogProgress(chipTool, - " ***** Test Step 12 : Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 10 : Step 2d: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c")) { NextTest(); return; } - err = TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_12(); + err = TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_10(); break; - case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 2e: TH leave the device moving for 2 seconds\n"); - err = TestStep2eThLeaveTheDeviceMovingFor2Seconds_13(); + case 11: + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH leave the device moving for 2 seconds\n"); + err = TestStep2eThLeaveTheDeviceMovingFor2Seconds_11(); break; - case 14: - ChipLogProgress(chipTool, " ***** Test Step 14 : Step 3a: TH reads OperationalStatus attribute's bit 0..1\n"); + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a1: TH reads OperationalStatus attribute's bit 0..1\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aThReadsOperationalStatusAttributesBit01_14(); + err = TestStep3a1ThReadsOperationalStatusAttributesBit01_12(); break; - case 15: + case 13: ChipLogProgress(chipTool, - " ***** Test Step 15 : Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " + " ***** Test Step 13 : Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits checks in " "upcoming OperationalStatus read steps.\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15(); + err = TestStep3a2WriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_13(); break; - case 16: + case 14: ChipLogProgress( - chipTool, " ***** Test Step 16 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + chipTool, " ***** Test Step 14 : Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); if (ShouldSkip("WNCV.S.A000a && WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16(); + err = TestStep3a3ThChecksOperationalStatusValueBit23Wncvsf00lf_14(); break; - case 17: + case 15: ChipLogProgress( - chipTool, " ***** Test Step 17 : Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); + chipTool, " ***** Test Step 15 : Step 3a4: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF))\n"); if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F00")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_17(); + err = TestStep3a4ThChecksOperationalStatusValueBit23Wncvsf00lf_15(); break; - case 18: + case 16: ChipLogProgress( - chipTool, " ***** Test Step 18 : Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + chipTool, " ***** Test Step 16 : Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); if (ShouldSkip("WNCV.S.A000a && WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18(); + err = TestStep3a5ThChecksOperationalStatusValueBit45Wncvsf01tl_16(); break; - case 19: + case 17: ChipLogProgress( - chipTool, " ***** Test Step 19 : Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); + chipTool, " ***** Test Step 17 : Step 3a6: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL))\n"); if (ShouldSkip("WNCV.S.A000a && !WNCV.S.F01")) { NextTest(); return; } - err = TestStep3aThChesksOperationalStatusValueBit45Wncvsf01tl_19(); + err = TestStep3a6ThChesksOperationalStatusValueBit45Wncvsf01tl_17(); break; - case 20: - ChipLogProgress(chipTool, " ***** Test Step 20 : Step 3a2: DUT updates its attributes\n"); - err = TestStep3a2DutUpdatesItsAttributes_20(); + case 18: + ChipLogProgress(chipTool, " ***** Test Step 18 : Step 3a7: DUT updates its attributes\n"); + err = TestStep3a7DutUpdatesItsAttributes_18(); break; - case 21: + case 19: ChipLogProgress(chipTool, - " ***** Test Step 21 : Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 19 : Step 3b: If (PA & LF) TH reads CurrentPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000e")) { NextTest(); return; } - err = TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_21(); + err = TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_19(); break; - case 22: + case 20: ChipLogProgress(chipTool, - " ***** Test Step 22 : Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); + " ***** Test Step 20 : Step 3c: If (PA & LF) TH reads CurrentPositionLiftPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A0008")) { NextTest(); return; } - err = TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_22(); + err = TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_20(); break; - case 23: + case 21: ChipLogProgress(chipTool, - " ***** Test Step 23 : Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 21 : Step 3d: If (PA & TL) TH reads CurrentPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000f")) { NextTest(); return; } - err = TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_23(); + err = TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_21(); break; - case 24: + case 22: ChipLogProgress(chipTool, - " ***** Test Step 24 : Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); + " ***** Test Step 22 : Step 3e: If (PA & LF) TH reads CurrentPositionTiltPercentage optional attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A0009")) { NextTest(); return; } - err = TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_24(); + err = TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_22(); break; - case 25: - ChipLogProgress(chipTool, " ***** Test Step 25 : Step 4a: TH sends a StopMotion command to DUT\n"); + case 23: + ChipLogProgress(chipTool, " ***** Test Step 23 : Step 4a: TH sends a StopMotion command to DUT\n"); if (ShouldSkip("WNCV.S.C02.Rsp")) { NextTest(); return; } - err = TestStep4aThSendsAStopMotionCommandToDut_25(); + err = TestStep4aThSendsAStopMotionCommandToDut_23(); break; - case 26: + case 24: ChipLogProgress( - chipTool, " ***** Test Step 26 : Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); - err = TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_26(); + chipTool, " ***** Test Step 24 : Step 4b: TH waits for 3 seconds the end of inertial movement(s) on the device\n"); + err = TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_24(); break; - case 27: + case 25: ChipLogProgress(chipTool, - " ***** Test Step 27 : Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); + " ***** Test Step 25 : Step 4c: Verify DUT update OperationalStatus attribute to TH after a StopMotion\n"); if (ShouldSkip("WNCV.S.A000a")) { NextTest(); return; } - err = TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_27(); + err = TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_25(); break; - case 28: - ChipLogProgress(chipTool, " ***** Test Step 28 : Step 5a: TH waits for x seconds attributes update on the device\n"); - err = TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_28(); + case 26: + ChipLogProgress(chipTool, " ***** Test Step 26 : Step 5a: TH waits for x seconds attributes update on the device\n"); + err = TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_26(); break; - case 29: + case 27: ChipLogProgress(chipTool, - " ***** Test Step 29 : Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); + " ***** Test Step 27 : Step 5b: If (PA & LF) TH reads TargetPositionLiftPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F00 && WNCV.S.F02 && WNCV.S.A000b")) { NextTest(); return; } - err = TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_29(); + err = TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_27(); break; - case 30: + case 28: ChipLogProgress(chipTool, - " ***** Test Step 30 : Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); + " ***** Test Step 28 : Step 5c: If (PA & TL) TH reads TargetPositionTiltPercent100ths attribute from DUT\n"); if (ShouldSkip("WNCV.S.F01 && WNCV.S.F04 && WNCV.S.A000c")) { NextTest(); return; } - err = TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_30(); + err = TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_28(); break; } @@ -110133,12 +110806,6 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 29: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 30: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -110152,7 +110819,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 31; + const uint16_t mTestCount = 29; chip::Optional mNodeId; chip::Optional mCluster; @@ -110302,63 +110969,8 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - bool testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = false; - ResponseHandler _Nullable test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - - CHIP_ERROR TestReportStep2SubscribeToDutReportsOnOperationalStatusAttribute_7() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - test_Test_TC_WNCV_3_2_OperationalStatus_Reported = ^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Report: Step 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - - VerifyOrReturn(CheckConstraintType("operationalStatus", "bitmap8", "bitmap8")); - testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled = true; - }; - - NextTest(); - return CHIP_NO_ERROR; - } - - CHIP_ERROR TestStep2SubscribeToDutReportsOnOperationalStatusAttribute_8() - { - - MTRBaseDevice * device = GetDevice("alpha"); - __auto_type * cluster = [[MTRBaseClusterWindowCovering alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; - VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); - - uint16_t minIntervalArgument = 4U; - uint16_t maxIntervalArgument = 5U; - __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(minIntervalArgument) - maxInterval:@(maxIntervalArgument)]; - params.filterByFabric = true; - params.replaceExistingSubscriptions = true; - [cluster subscribeAttributeOperationalStatusWithParams:params - subscriptionEstablished:^{ - VerifyOrReturn( - testSendClusterTest_TC_WNCV_3_2_7_WaitForReport_Fulfilled, SetCommandExitStatus(CHIP_ERROR_INCORRECT_STATE)); - NextTest(); - } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 2: Subscribe to DUT reports on OperationalStatus attribute Error: %@", err); - - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - if (test_Test_TC_WNCV_3_2_OperationalStatus_Reported != nil) { - ResponseHandler callback = test_Test_TC_WNCV_3_2_OperationalStatus_Reported; - test_Test_TC_WNCV_3_2_OperationalStatus_Reported = nil; - callback(value, err); - } - }]; - - return CHIP_NO_ERROR; - } - CHIP_ERROR TestStep2aThSendsDownOrCloseCommandToDut_9() + CHIP_ERROR TestStep2aThSendsDownOrCloseCommandToDut_7() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110376,7 +110988,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2bDutUpdatesItsAttributes_10() + CHIP_ERROR TestStep2bDutUpdatesItsAttributes_8() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -110384,7 +110996,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_11() + CHIP_ERROR TestStep2cIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_9() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110408,7 +111020,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_12() + CHIP_ERROR TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110432,7 +111044,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor2Seconds_13() + CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor2Seconds_11() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -110441,7 +111053,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { } NSNumber * _Nonnull OperationalStatusValue; - CHIP_ERROR TestStep3aThReadsOperationalStatusAttributesBit01_14() + CHIP_ERROR TestStep3a1ThReadsOperationalStatusAttributesBit01_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110449,7 +111061,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH reads OperationalStatus attribute's bit 0..1 Error: %@", err); + NSLog(@"Step 3a1: TH reads OperationalStatus attribute's bit 0..1 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110464,7 +111076,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aWriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_15() + CHIP_ERROR TestStep3a2WriteAttributeBitmap8WithOperationalStatusValueToDoTheBitsChecksInUpcomingOperationalStatusReadSteps_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110475,7 +111087,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { bitmap8Argument = [OperationalStatusValue copy]; [cluster writeAttributeBitmap8WithValue:bitmap8Argument completion:^(NSError * _Nullable err) { - NSLog(@"Step 3a: Write attribute BITMAP8 with OperationalStatusValue to do the bits " + NSLog(@"Step 3a2: Write attribute BITMAP8 with OperationalStatusValue to do the bits " @"checks in upcoming OperationalStatus read steps. Error: %@", err); @@ -110487,7 +111099,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_16() + CHIP_ERROR TestStep3a3ThChecksOperationalStatusValueBit23Wncvsf00lf_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110495,7 +111107,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + NSLog(@"Step 3a3: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110511,7 +111123,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit23Wncvsf00lf_17() + CHIP_ERROR TestStep3a4ThChecksOperationalStatusValueBit23Wncvsf00lf_15() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110519,7 +111131,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); + NSLog(@"Step 3a4: TH checks OperationalStatus value bit 2..3 (WNCV.S.F00(LF)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110535,7 +111147,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChecksOperationalStatusValueBit45Wncvsf01tl_18() + CHIP_ERROR TestStep3a5ThChecksOperationalStatusValueBit45Wncvsf01tl_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110543,7 +111155,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + NSLog(@"Step 3a5: TH checks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110559,7 +111171,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3aThChesksOperationalStatusValueBit45Wncvsf01tl_19() + CHIP_ERROR TestStep3a6ThChesksOperationalStatusValueBit45Wncvsf01tl_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110567,7 +111179,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 3a: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); + NSLog(@"Step 3a6: TH chesks OperationalStatus value bit 4..5 (WNCV.S.F01(TL)) Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -110583,7 +111195,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3a2DutUpdatesItsAttributes_20() + CHIP_ERROR TestStep3a7DutUpdatesItsAttributes_18() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -110591,7 +111203,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_21() + CHIP_ERROR TestStep3bIfPaLfThReadsCurrentPositionLiftPercent100thsAttributeFromDut_19() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110619,7 +111231,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_22() + CHIP_ERROR TestStep3cIfPaLfThReadsCurrentPositionLiftPercentageOptionalAttributeFromDut_20() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110646,7 +111258,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_23() + CHIP_ERROR TestStep3dIfPaTlThReadsCurrentPositionTiltPercent100thsAttributeFromDut_21() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110674,7 +111286,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_24() + CHIP_ERROR TestStep3eIfPaLfThReadsCurrentPositionTiltPercentageOptionalAttributeFromDut_22() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110701,7 +111313,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4aThSendsAStopMotionCommandToDut_25() + CHIP_ERROR TestStep4aThSendsAStopMotionCommandToDut_23() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110719,7 +111331,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_26() + CHIP_ERROR TestStep4bThWaitsFor3SecondsTheEndOfInertialMovementsOnTheDevice_24() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -110727,7 +111339,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_27() + CHIP_ERROR TestStep4cVerifyDutUpdateOperationalStatusAttributeToThAfterAStopMotion_25() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110750,7 +111362,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_28() + CHIP_ERROR TestStep5aThWaitsForXSecondsAttributesUpdateOnTheDevice_26() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; @@ -110758,7 +111370,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return WaitForMs("alpha", value); } - CHIP_ERROR TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_29() + CHIP_ERROR TestStep5bIfPaLfThReadsTargetPositionLiftPercent100thsAttributeFromDut_27() { MTRBaseDevice * device = GetDevice("alpha"); @@ -110785,7 +111397,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_30() + CHIP_ERROR TestStep5cIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_28() { MTRBaseDevice * device = GetDevice("alpha"); @@ -170510,7 +171122,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { case 5: ChipLogProgress( chipTool, " ***** Test Step 5 : Step 1a: TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - if (ShouldSkip("DRLK.S.A0023.Write && PICS_SDK_CI_ONLY")) { + if (ShouldSkip("DRLK.S.M.AutoRelockTimeAttributeWritable && PICS_SDK_CI_ONLY")) { NextTest(); return; } @@ -170519,7 +171131,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { case 6: ChipLogProgress( chipTool, " ***** Test Step 6 : Step 1b: TH writes AutoRelockTime attribute value as 60 seconds on the DUT\n"); - if (ShouldSkip("DRLK.S.A0023.Write && PICS_SKIP_SAMPLE_APP")) { + if (ShouldSkip("DRLK.S.M.AutoRelockTimeAttributeWritable && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } @@ -170528,7 +171140,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { case 7: ChipLogProgress( chipTool, " ***** Test Step 7 : Step 1c: TH writes AutoRelockTime attribute value as 10 seconds on the DUT\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY && !DRLK.S.A0023.Write")) { + if (ShouldSkip("PICS_SDK_CI_ONLY && !DRLK.S.M.AutoRelockTimeAttributeWritable")) { NextTest(); return; } @@ -170537,7 +171149,7 @@ class Test_TC_DRLK_2_4 : public TestCommandBridge { case 8: ChipLogProgress( chipTool, " ***** Test Step 8 : Step 1d: TH writes AutoRelockTime attribute value as 60 seconds on the DUT\n"); - if (ShouldSkip("PICS_SKIP_SAMPLE_APP && !DRLK.S.A0023.Write")) { + if (ShouldSkip("PICS_SKIP_SAMPLE_APP && !DRLK.S.M.AutoRelockTimeAttributeWritable")) { NextTest(); return; } @@ -178817,6 +179429,9 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), @@ -178879,7 +179494,6 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), - make_unique(), make_unique(), make_unique(), make_unique(), From 7239ed189a5e129c2f7b6e6b642107a9a7bc8dd8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 14:58:30 -0400 Subject: [PATCH 24/96] Add per-controller control over operational advertising to Matter.framework. (#29018) --- .../CHIP/MTRDeviceControllerFactory.mm | 3 +- .../MTRDeviceControllerStartupParameters.h | 6 + .../CHIP/MTRDeviceControllerStartupParams.mm | 1 + .../CHIPTests/MTRCertificateValidityTests.m | 1 - .../CHIPTests/MTRControllerAdvertisingTests.m | 297 ++++++++++++++++++ .../Matter.xcodeproj/project.pbxproj | 4 + 6 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 97785a45a9db99..a11a7d30135e46 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -851,11 +851,12 @@ - (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupP return [self _startDeviceController:startupParameters fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { + auto advertiseOperational = self.advertiseOperational && startupParameters.shouldAdvertiseOperational; auto * params = [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller fabricTable:fabricTable keystore:self->_keystore - advertiseOperational:self.advertiseOperational + advertiseOperational:advertiseOperational params:startupParameters error:fabricError]; if (params != nil) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h index b592849f066974..7b365948b61080 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h @@ -46,6 +46,12 @@ MTR_NEWLY_AVAILABLE */ @property (nonatomic, copy, nullable) NSArray * certificationDeclarationCertificates; +/** + * Whether the controller should advertise its operational identity. Defaults + * to NO. + */ +@property (nonatomic, assign) BOOL shouldAdvertiseOperational; + /** * Set an MTROperationalCertificateIssuer to call (on the provided queue) when * operational certificates need to be provided during commissioning. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index c4ad49dda014cd..57c9270a682b08 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -264,6 +264,7 @@ - (instancetype)initWithStorageDelegate:(id) _productAttestationAuthorityCertificates = nil; _certificationDeclarationCertificates = nil; + _shouldAdvertiseOperational = NO; _ipk = ipk; _vendorID = vendorID; diff --git a/src/darwin/Framework/CHIPTests/MTRCertificateValidityTests.m b/src/darwin/Framework/CHIPTests/MTRCertificateValidityTests.m index 34fd5d5814d254..7a66d299e19e71 100644 --- a/src/darwin/Framework/CHIPTests/MTRCertificateValidityTests.m +++ b/src/darwin/Framework/CHIPTests/MTRCertificateValidityTests.m @@ -251,7 +251,6 @@ - (void)initStack:(MTRTestCertificateIssuer *)certificateIssuer __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] initWithStorage:storage]; factoryParams.port = @(kLocalPort); - factoryParams.shouldStartServer = YES; BOOL ok = [factory startControllerFactory:factoryParams error:nil]; XCTAssertTrue(ok); diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m new file mode 100644 index 00000000000000..1276e0ce845bca --- /dev/null +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2023 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 + +// system dependencies +#import +#import + +#import "MTRFabricInfoChecker.h" +#import "MTRTestKeys.h" +#import "MTRTestPerControllerStorage.h" + +static const uint16_t kTestVendorId = 0xFFF1u; +static const uint16_t kTimeoutInSeconds = 3; + +static NSString * NodeIDAsString(NSNumber * nodeID) { return [NSString stringWithFormat:@"%016llX", nodeID.unsignedLongLongValue]; } + +@interface MTRControllerAdvertisingTestsOperationalBrowser : NSObject +@property NSSet * discoveredNodes; + +- (instancetype)initWithExpectation:(XCTestExpectation *)expectation nodeIDToExpect:(NSNumber *)nodeIDToExpect; +- (void)discoveredNodeID:(NSString *)nodeID onCompressedFabricID:(NSString *)compressedFabricID; +@end + +static void OnBrowse(DNSServiceRef aServiceRef, DNSServiceFlags aFlags, uint32_t aInterfaceId, DNSServiceErrorType aError, + const char * aName, const char * aType, const char * aDomain, void * aContext) +{ + XCTAssertTrue(aError == kDNSServiceErr_NoError); + + if (!(aFlags & kDNSServiceFlagsAdd)) { + return; + } + + // 16 chars for compressed fabric id, 16 chars for node id, and the dash. + XCTAssertTrue(strlen(aName) == 33); + + NSString * compressedFabricID = [[NSString alloc] initWithBytes:aName length:16 encoding:NSUTF8StringEncoding]; + NSString * nodeID = [[NSString alloc] initWithBytes:aName + 17 length:16 encoding:NSUTF8StringEncoding]; + + __auto_type * self = (__bridge MTRControllerAdvertisingTestsOperationalBrowser *) aContext; + [self discoveredNodeID:nodeID onCompressedFabricID:compressedFabricID]; +} + +static const char kLocalDot[] = "local."; +static const char kOperationalType[] = "_matter._tcp"; +static const DNSServiceFlags kBrowseFlags = 0; + +@implementation MTRControllerAdvertisingTestsOperationalBrowser { + DNSServiceRef _browseRef; + // Key is compressed fabric id, value is the set of discovered node IDs. + NSMutableDictionary *> * _allDiscoveredNodes; + + XCTestExpectation * _expectation; + NSString * _nodeIDToExpect; +} + +- (instancetype)initWithExpectation:(XCTestExpectation *)expectation nodeIDToExpect:(NSNumber *)nodeIDToExpect +{ + XCTAssertNotNil([super init]); + + _allDiscoveredNodes = [[NSMutableDictionary alloc] init]; + _expectation = expectation; + _nodeIDToExpect = NodeIDAsString(nodeIDToExpect); + + __auto_type err = DNSServiceBrowse( + &_browseRef, kBrowseFlags, kDNSServiceInterfaceIndexAny, kOperationalType, kLocalDot, OnBrowse, (__bridge void *) self); + XCTAssertTrue(err == kDNSServiceErr_NoError); + + err = DNSServiceSetDispatchQueue(_browseRef, dispatch_get_main_queue()); + XCTAssertTrue(err == kDNSServiceErr_NoError); + + return self; +} + +- (void)discoveredNodeID:(NSString *)nodeID onCompressedFabricID:(NSString *)compressedFabricID +{ + if (_allDiscoveredNodes[compressedFabricID] == nil) { + _allDiscoveredNodes[compressedFabricID] = [[NSMutableSet alloc] init]; + } + [_allDiscoveredNodes[compressedFabricID] addObject:nodeID]; + + // It would be nice to check the compressedFabricID, but computing the right + // expected value for it is a pain. + if ([nodeID isEqualToString:_nodeIDToExpect]) { + _discoveredNodes = [NSSet setWithSet:_allDiscoveredNodes[compressedFabricID]]; + // Stop our browse so we get no more notifications. + DNSServiceRefDeallocate(_browseRef); + _browseRef = NULL; + [_expectation fulfill]; + } +} + +- (void)dealloc +{ + if (_browseRef) { + DNSServiceRefDeallocate(_browseRef); + } +} + +@end + +@interface MTRControllerAdvertisingTests : XCTestCase +@end + +@implementation MTRControllerAdvertisingTests { + dispatch_queue_t _storageQueue; +} + ++ (void)tearDown +{ +} + +- (void)setUp +{ + // Per-test setup, runs before each test. + [super setUp]; + [self setContinueAfterFailure:NO]; + + _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + + [self startFactory]; +} + +- (void)tearDown +{ + // Per-test teardown, runs after each test. + [self stopFactory]; + _storageQueue = nil; + [super tearDown]; +} + +- (void)startFactory +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; + factoryParams.shouldStartServer = YES; + + NSError * error; + BOOL ok = [factory startControllerFactory:factoryParams error:&error]; + XCTAssertNil(error); + XCTAssertTrue(ok); + + XCTAssertTrue(factory.isRunning); +} + +- (void)stopFactory +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + [factory stopControllerFactory]; + XCTAssertFalse(factory.isRunning); +} + +// Test helpers + +- (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys + operationalKeys:(MTRTestKeys *)operationalKeys + fabricID:(NSNumber *)fabricID + nodeID:(NSNumber *)nodeID + storage:(MTRTestPerControllerStorage *)storage + advertiseOperational:(BOOL)advertiseOperational + error:(NSError * __autoreleasing *)error +{ + XCTAssertTrue(error != NULL); + + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + // Specify a fixed issuerID, so we get the same cert if we use the same keys. + __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; + XCTAssertNil(*error); + XCTAssertNotNil(root); + + __auto_type * operational = [MTRCertificates createOperationalCertificate:rootKeys + signingCertificate:root + operationalPublicKey:operationalKeys.publicKey + fabricID:fabricID + nodeID:nodeID + caseAuthenticatedTags:nil + error:error]; + XCTAssertNil(*error); + XCTAssertNotNil(operational); + + __auto_type * params = + [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; + XCTAssertNotNil(params); + + params.shouldAdvertiseOperational = advertiseOperational; + + return [factory createController:params error:error]; +} + +- (void)test001_CheckAdvertisingAsExpected +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + XCTAssertNotNil(factory); + + __auto_type * rootKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(rootKeys); + + __auto_type * operationalKeys = [[MTRTestKeys alloc] init]; + XCTAssertNotNil(operationalKeys); + + // Pick some ids that no other test will be using. + NSNumber * nodeID1 = @(0x1827364554637281); + NSNumber * nodeID2 = @(0x8172635445362718); + NSNumber * nodeID3 = @(0x8811772266335544); + NSNumber * fabricID = @(0x1122334455667788); + + __auto_type * browseExpectation = [self expectationWithDescription:@"Discovered our last controller"]; + // Assume that since we start the controller with nodeID3 last, by the + // time we see its advertisements we will have seen the ones for the one + // with nodeID1 too, if it had any. + __auto_type * operationalBrowser = + [[MTRControllerAdvertisingTestsOperationalBrowser alloc] initWithExpectation:browseExpectation nodeIDToExpect:nodeID3]; + XCTAssertNotNil(operationalBrowser); + + __auto_type * storageDelegate1 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; + + NSError * error; + MTRDeviceController * controller1 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID1 + storage:storageDelegate1 + advertiseOperational:NO + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller1); + XCTAssertTrue([controller1 isRunning]); + XCTAssertEqualObjects(controller1.controllerNodeID, nodeID1); + + __auto_type * storageDelegate2 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; + + MTRDeviceController * controller2 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID2 + storage:storageDelegate2 + advertiseOperational:YES + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller2); + XCTAssertTrue([controller2 isRunning]); + XCTAssertEqualObjects(controller2.controllerNodeID, nodeID2); + + __auto_type * storageDelegate3 = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; + + MTRDeviceController * controller3 = [self startControllerWithRootKeys:rootKeys + operationalKeys:operationalKeys + fabricID:fabricID + nodeID:nodeID3 + storage:storageDelegate3 + advertiseOperational:YES + error:&error]; + XCTAssertNil(error); + XCTAssertNotNil(controller3); + XCTAssertTrue([controller3 isRunning]); + XCTAssertEqualObjects(controller3.controllerNodeID, nodeID3); + + [self waitForExpectations:@[ browseExpectation ] timeout:kTimeoutInSeconds]; + + __auto_type * expectedDiscoveredNodes = [NSSet setWithArray:@[ NodeIDAsString(nodeID2), NodeIDAsString(nodeID3) ]]; + XCTAssertEqualObjects(operationalBrowser.discoveredNodes, expectedDiscoveredNodes); + + [controller1 shutdown]; + XCTAssertFalse([controller1 isRunning]); + [controller2 shutdown]; + XCTAssertFalse([controller2 isRunning]); + [controller3 shutdown]; + XCTAssertFalse([controller3 isRunning]); +} + +@end diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index edc68cd47eb1c4..a95c790993dfd5 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -173,6 +173,7 @@ 517BF3F1282B62B800A8B7DB /* MTRCertificates.mm in Sources */ = {isa = PBXBuildFile; fileRef = 517BF3EF282B62B800A8B7DB /* MTRCertificates.mm */; }; 517BF3F3282B62CB00A8B7DB /* MTRCertificateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */; }; 518D3F832AA132DC008E0007 /* MTRTestPerControllerStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 518D3F812AA132DC008E0007 /* MTRTestPerControllerStorage.m */; }; + 518D3F852AA14006008E0007 /* MTRControllerAdvertisingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 518D3F842AA14006008E0007 /* MTRControllerAdvertisingTests.m */; }; 519498322A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */; }; 51A2F1322A00402A00F03298 /* MTRDataValueParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51A2F1312A00402A00F03298 /* MTRDataValueParserTests.m */; }; 51B22C1E2740CB0A008D5055 /* MTRStructsObjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B22C1D2740CB0A008D5055 /* MTRStructsObjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -489,6 +490,7 @@ 517BF3F2282B62CB00A8B7DB /* MTRCertificateTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRCertificateTests.m; sourceTree = ""; }; 518D3F812AA132DC008E0007 /* MTRTestPerControllerStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRTestPerControllerStorage.m; sourceTree = ""; }; 518D3F822AA132DC008E0007 /* MTRTestPerControllerStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRTestPerControllerStorage.h; sourceTree = ""; }; + 518D3F842AA14006008E0007 /* MTRControllerAdvertisingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRControllerAdvertisingTests.m; sourceTree = ""; }; 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRSetupPayloadSerializerTests.m; sourceTree = ""; }; 51A2F1312A00402A00F03298 /* MTRDataValueParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRDataValueParserTests.m; sourceTree = ""; }; 51B22C1D2740CB0A008D5055 /* MTRStructsObjc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRStructsObjc.h; sourceTree = ""; }; @@ -1164,6 +1166,7 @@ 519498312A25581C00B3BABE /* MTRSetupPayloadSerializerTests.m */, 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */, 51E95DF72A78110900A434F0 /* MTRPerControllerStorageTests.m */, + 518D3F842AA14006008E0007 /* MTRControllerAdvertisingTests.m */, B202529D2459E34F00F97062 /* Info.plist */, 5143851C2A65885400EDC8E6 /* MatterTests-Bridging-Header.h */, ); @@ -1580,6 +1583,7 @@ 51D10D2E2808E2CA00E8CA3D /* MTRTestStorage.m in Sources */, 7596A8512878709F004DAE0E /* MTRAsyncCallbackQueueTests.m in Sources */, 997DED1A26955D0200975E97 /* MTRThreadOperationalDatasetTests.mm in Sources */, + 518D3F852AA14006008E0007 /* MTRControllerAdvertisingTests.m in Sources */, 51C8E3F82825CDB600D47D00 /* MTRTestKeys.m in Sources */, 51C984622A61CE2A00B0AD9A /* MTRFabricInfoChecker.m in Sources */, 99C65E10267282F1003402F6 /* MTRControllerTests.m in Sources */, From 8bd7e087b85a90edd92d502a4e42e10d3d7945d3 Mon Sep 17 00:00:00 2001 From: jrhees-cae <61466710+jrhees-cae@users.noreply.github.com> Date: Fri, 1 Sep 2023 16:06:35 -0400 Subject: [PATCH 25/96] [DRLK] Return NOT_FOUND error for non-existent User on GetWeekdaySchedule/GetYeardaySchedule commands (#28974) * [DRLK] Return NOT_FOUND error for non-existent User on GetWeekdaySchedule/GetYeardaySchedule commands Fixes #21791 * Restyled by prettier-yaml * zap-regen * Include changes to DL_Schedules.yaml test * zap regen * Fix issue with DL_Schedules for correct Status codes --------- Co-authored-by: Restyled.io --- .../door-lock-server/door-lock-server.cpp | 4 +- src/app/tests/suites/DL_Schedules.yaml | 12 +- .../certification/Test_TC_DRLK_2_5.yaml | 39 +++- .../certification/Test_TC_DRLK_2_7.yaml | 28 ++- .../zap-generated/test/Commands.h | 206 ++++++++++++++---- 5 files changed, 241 insertions(+), 48 deletions(-) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index a9b3cdd4dc106d..01edd3f1b60253 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -1046,7 +1046,7 @@ void DoorLockServer::getWeekDayScheduleCommandHandler(chip::app::CommandHandler { ChipLogProgress(Zcl, "[GetWeekDaySchedule] User does not exist [endpointId=%d,weekDayIndex=%d,userIndex=%d]", endpointId, weekDayIndex, userIndex); - sendGetWeekDayScheduleResponse(commandObj, commandPath, weekDayIndex, userIndex, DlStatus::kFailure); + sendGetWeekDayScheduleResponse(commandObj, commandPath, weekDayIndex, userIndex, DlStatus::kNotFound); return; } @@ -1246,7 +1246,7 @@ void DoorLockServer::getYearDayScheduleCommandHandler(chip::app::CommandHandler { ChipLogProgress(Zcl, "[GetYearDaySchedule] User does not exist [endpointId=%d,yearDayIndex=%d,userIndex=%d]", endpointId, yearDayIndex, userIndex); - sendGetYearDayScheduleResponse(commandObj, commandPath, yearDayIndex, userIndex, DlStatus::kFailure); + sendGetYearDayScheduleResponse(commandObj, commandPath, yearDayIndex, userIndex, DlStatus::kNotFound); return; } diff --git a/src/app/tests/suites/DL_Schedules.yaml b/src/app/tests/suites/DL_Schedules.yaml index e70a46863cf0eb..208600f4f65ec8 100644 --- a/src/app/tests/suites/DL_Schedules.yaml +++ b/src/app/tests/suites/DL_Schedules.yaml @@ -488,7 +488,7 @@ tests: - name: "UserIndex" value: 2 - name: "Status" - value: 0x01 + value: 0x8B # # Excercise SetYearDay schedules with invalid parameters @@ -686,7 +686,7 @@ tests: - name: "UserIndex" value: 2 - name: "Status" - value: 0x01 + value: 0x8B # # Excercise Set Holiday schedules with invalid parameters @@ -1799,7 +1799,7 @@ tests: - name: "UserIndex" value: 1 - name: "Status" - value: 0x01 + value: 0x8B - label: "Make sure clearing first user also cleared year day schedules" command: "GetYearDaySchedule" @@ -1816,7 +1816,7 @@ tests: - name: "UserIndex" value: 1 - name: "Status" - value: 0x01 + value: 0x8B - label: "Make sure clearing second user also cleared week day schedules" command: "GetWeekDaySchedule" @@ -1833,7 +1833,7 @@ tests: - name: "UserIndex" value: 2 - name: "Status" - value: 0x01 + value: 0x8B - label: "Make sure clearing second user also cleared year day schedules" command: "GetYearDaySchedule" @@ -1850,7 +1850,7 @@ tests: - name: "UserIndex" value: 2 - name: "Status" - value: 0x01 + value: 0x8B # Make sure that all the manipulations did not affect the holiday schedules - label: "Make sure that first holiday schedule was not deleted" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml index 41ec78be53f221..782824c8de5caf 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml @@ -212,7 +212,42 @@ tests: constraints: hasValue: false - - label: "Step 7: TH sends Clear Week Day Schedule Command to DUT" + - label: + "Step 7: TH sends Get Week Day Schedule Command to DUT for + non-existent User" + PICS: DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx + command: "GetWeekDaySchedule" + arguments: + values: + - name: "WeekDayIndex" + value: 1 + - name: "UserIndex" + value: 2 + response: + values: + - name: "WeekDayIndex" + value: 1 + - name: "UserIndex" + value: 2 + - name: "Status" + value: 0x8B + - name: "DaysMask" + constraints: + hasValue: false + - name: "StartHour" + constraints: + hasValue: false + - name: "StartMinute" + constraints: + hasValue: false + - name: "EndHour" + constraints: + hasValue: false + - name: "EndMinute" + constraints: + hasValue: false + + - label: "Step 8: TH sends Clear Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0d.Rsp command: "ClearWeekDaySchedule" arguments: @@ -222,7 +257,7 @@ tests: - name: "UserIndex" value: 1 - - label: "Step 8: TH sends Get Week Day Schedule Command to DUT" + - label: "Step 9: TH sends Get Week Day Schedule Command to DUT" PICS: DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx command: "GetWeekDaySchedule" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml index 46c91e523ed360..0db99395e20ea8 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml @@ -298,7 +298,33 @@ tests: constraints: minValue: 1081 - - label: "Step 12: TH sends Clear Year Day Schedule to DUT" + - label: + "Step 12: TH sends Get Year Day Schedule Command to DUT for + non-existent User" + PICS: DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx + command: "GetYearDaySchedule" + arguments: + values: + - name: "YearDayIndex" + value: 1 + - name: "UserIndex" + value: 2 + response: + values: + - name: "YearDayIndex" + value: 1 + - name: "UserIndex" + value: 2 + - name: "Status" + value: 0x8B + - name: "LocalStartTime" + constraints: + hasValue: false + - name: "LocalEndTime" + constraints: + hasValue: false + + - label: "Step 13: TH sends Clear Year Day Schedule to DUT" PICS: DRLK.S.F0a && DRLK.S.C10.Rsp command: "ClearYearDaySchedule" arguments: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 5ed37c33b7a44e..35a6c29cc80972 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -165750,7 +165750,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -166142,7 +166142,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -168549,7 +168549,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -168587,7 +168587,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -168625,7 +168625,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -168663,7 +168663,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 1U)); + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); } NextTest(); @@ -171833,24 +171833,33 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { err = TestStep6ThSendGetWeekDayScheduleCommandToDut_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7: TH sends Clear Week Day Schedule Command to DUT\n"); - if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0d.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 9 : Step 7: TH sends Get Week Day Schedule Command to DUT for non-existent User\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { NextTest(); return; } - err = TestStep7ThSendsClearWeekDayScheduleCommandToDut_9(); + err = TestStep7ThSendsGetWeekDayScheduleCommandToDutForNonExistentUser_9(); break; case 10: - ChipLogProgress(chipTool, " ***** Test Step 10 : Step 8: TH sends Get Week Day Schedule Command to DUT\n"); - if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { + ChipLogProgress(chipTool, " ***** Test Step 10 : Step 8: TH sends Clear Week Day Schedule Command to DUT\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0d.Rsp")) { NextTest(); return; } - err = TestStep8ThSendsGetWeekDayScheduleCommandToDut_10(); + err = TestStep8ThSendsClearWeekDayScheduleCommandToDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Cleanup the created user\n"); - err = TestCleanupTheCreatedUser_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 9: TH sends Get Week Day Schedule Command to DUT\n"); + if (ShouldSkip("DRLK.S.F04 && DRLK.S.C0c.Rsp && DRLK.S.C0c.Tx")) { + NextTest(); + return; + } + err = TestStep9ThSendsGetWeekDayScheduleCommandToDut_11(); + break; + case 12: + ChipLogProgress(chipTool, " ***** Test Step 12 : Cleanup the created user\n"); + err = TestCleanupTheCreatedUser_12(); break; } @@ -171899,6 +171908,9 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -171912,7 +171924,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 12; + const uint16_t mTestCount = 13; chip::Optional mNodeId; chip::Optional mCluster; @@ -172269,7 +172281,67 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep7ThSendsClearWeekDayScheduleCommandToDut_9() + CHIP_ERROR TestStep7ThSendsGetWeekDayScheduleCommandToDutForNonExistentUser_9() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; + params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster + getWeekDayScheduleWithParams:params + completion:^( + MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 7: TH sends Get Week Day Schedule Command to DUT for non-existent User Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.weekDayIndex; + VerifyOrReturn(CheckValue("WeekDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("UserIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); + } + + VerifyOrReturn(CheckConstraintHasValue("daysMask", values.daysMask, false)); + if (values.daysMask != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("startHour", values.startHour, false)); + if (values.startHour != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("startMinute", values.startMinute, false)); + if (values.startMinute != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("endHour", values.endHour, false)); + if (values.endHour != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("endMinute", values.endMinute, false)); + if (values.endMinute != nil) { + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep8ThSendsClearWeekDayScheduleCommandToDut_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172281,7 +172353,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 7: TH sends Clear Week Day Schedule Command to DUT Error: %@", err); + NSLog(@"Step 8: TH sends Clear Week Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -172291,7 +172363,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep8ThSendsGetWeekDayScheduleCommandToDut_10() + CHIP_ERROR TestStep9ThSendsGetWeekDayScheduleCommandToDut_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172304,7 +172376,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { [cluster getWeekDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Step 8: TH sends Get Week Day Schedule Command to DUT Error: %@", err); + NSLog(@"Step 9: TH sends Get Week Day Schedule Command to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -172349,7 +172421,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanupTheCreatedUser_11() + CHIP_ERROR TestCleanupTheCreatedUser_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -172964,28 +173036,37 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { err = TestStep11ThSendsGetYearDayScheduleCommandToDut_14(); break; case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 12: TH sends Clear Year Day Schedule to DUT\n"); - if (ShouldSkip("DRLK.S.F0a && DRLK.S.C10.Rsp")) { + ChipLogProgress( + chipTool, " ***** Test Step 15 : Step 12: TH sends Get Year Day Schedule Command to DUT for non-existent User\n"); + if (ShouldSkip("DRLK.S.F0a && DRLK.S.C0f.Rsp && DRLK.S.C0f.Tx")) { NextTest(); return; } - err = TestStep12ThSendsClearYearDayScheduleToDut_15(); + err = TestStep12ThSendsGetYearDayScheduleCommandToDutForNonExistentUser_15(); break; case 16: - ChipLogProgress(chipTool, " ***** Test Step 16 : Clear a year day schedule for the first user\n"); + ChipLogProgress(chipTool, " ***** Test Step 16 : Step 13: TH sends Clear Year Day Schedule to DUT\n"); if (ShouldSkip("DRLK.S.F0a && DRLK.S.C10.Rsp")) { NextTest(); return; } - err = TestClearAYearDayScheduleForTheFirstUser_16(); + err = TestStep13ThSendsClearYearDayScheduleToDut_16(); break; case 17: - ChipLogProgress(chipTool, " ***** Test Step 17 : Cleanup the created user with UserIndex 1\n"); - err = TestCleanupTheCreatedUserWithUserIndex1_17(); + ChipLogProgress(chipTool, " ***** Test Step 17 : Clear a year day schedule for the first user\n"); + if (ShouldSkip("DRLK.S.F0a && DRLK.S.C10.Rsp")) { + NextTest(); + return; + } + err = TestClearAYearDayScheduleForTheFirstUser_17(); break; case 18: - ChipLogProgress(chipTool, " ***** Test Step 18 : Cleanup the created user with UserIndex 5\n"); - err = TestCleanupTheCreatedUserWithUserIndex5_18(); + ChipLogProgress(chipTool, " ***** Test Step 18 : Cleanup the created user with UserIndex 1\n"); + err = TestCleanupTheCreatedUserWithUserIndex1_18(); + break; + case 19: + ChipLogProgress(chipTool, " ***** Test Step 19 : Cleanup the created user with UserIndex 5\n"); + err = TestCleanupTheCreatedUserWithUserIndex5_19(); break; } @@ -173044,10 +173125,10 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), EMBER_ZCL_STATUS_INVALID_COMMAND)); break; case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -173055,6 +173136,9 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -173068,7 +173152,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 19; + const uint16_t mTestCount = 20; chip::Optional mNodeId; chip::Optional mCluster; @@ -173613,7 +173697,55 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep12ThSendsClearYearDayScheduleToDut_15() + CHIP_ERROR TestStep12ThSendsGetYearDayScheduleCommandToDutForNonExistentUser_15() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; + params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:2U]; + [cluster + getYearDayScheduleWithParams:params + completion:^( + MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { + NSLog(@"Step 12: TH sends Get Year Day Schedule Command to DUT for non-existent User Error: %@", + err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = values.yearDayIndex; + VerifyOrReturn(CheckValue("YearDayIndex", actualValue, 1U)); + } + + { + id actualValue = values.userIndex; + VerifyOrReturn(CheckValue("UserIndex", actualValue, 2U)); + } + + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); + } + + VerifyOrReturn(CheckConstraintHasValue("localStartTime", values.localStartTime, false)); + if (values.localStartTime != nil) { + } + + VerifyOrReturn(CheckConstraintHasValue("localEndTime", values.localEndTime, false)); + if (values.localEndTime != nil) { + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep13ThSendsClearYearDayScheduleToDut_16() { MTRBaseDevice * device = GetDevice("alpha"); @@ -173626,7 +173758,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { [cluster clearYearDayScheduleWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 12: TH sends Clear Year Day Schedule to DUT Error: %@", err); + NSLog(@"Step 13: TH sends Clear Year Day Schedule to DUT Error: %@", err); VerifyOrReturn(CheckValue("status", err ? ([err.domain isEqualToString:MTRInteractionErrorDomain] ? err.code @@ -173639,7 +173771,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_16() + CHIP_ERROR TestClearAYearDayScheduleForTheFirstUser_17() { MTRBaseDevice * device = GetDevice("alpha"); @@ -173661,7 +173793,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanupTheCreatedUserWithUserIndex1_17() + CHIP_ERROR TestCleanupTheCreatedUserWithUserIndex1_18() { MTRBaseDevice * device = GetDevice("alpha"); @@ -173682,7 +173814,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestCleanupTheCreatedUserWithUserIndex5_18() + CHIP_ERROR TestCleanupTheCreatedUserWithUserIndex5_19() { MTRBaseDevice * device = GetDevice("alpha"); From 1d8b86a70dbc3df08b6c17c6b4e34c2425cb6329 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Sat, 2 Sep 2023 04:33:27 +0800 Subject: [PATCH 26/96] ESP32: Set the InterfaceId to Wi-Fi Station netif by default for platform mDNS (#28769) --- src/platform/ESP32/WiFiDnssdImpl.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/platform/ESP32/WiFiDnssdImpl.cpp b/src/platform/ESP32/WiFiDnssdImpl.cpp index 79c839b27ecc2f..44f641f75e6bb6 100644 --- a/src/platform/ESP32/WiFiDnssdImpl.cpp +++ b/src/platform/ESP32/WiFiDnssdImpl.cpp @@ -19,6 +19,7 @@ #include "lib/dnssd/platform/Dnssd.h" #include +#include #include #include @@ -323,12 +324,22 @@ static CHIP_ERROR OnBrowseDone(BrowseContext * ctx) ctx->mService[servicesIndex].mAddressType = MapAddressType(currentResult->ip_protocol); ctx->mService[servicesIndex].mTransportType = ctx->mAddressType; ctx->mService[servicesIndex].mPort = currentResult->port; - ctx->mService[servicesIndex].mInterface = ctx->mInterfaceId; ctx->mService[servicesIndex].mTextEntries = GetTextEntry(currentResult->txt, currentResult->txt_value_len, currentResult->txt_count); ctx->mService[servicesIndex].mTextEntrySize = currentResult->txt_count; ctx->mService[servicesIndex].mSubTypes = NULL; ctx->mService[servicesIndex].mSubTypeSize = 0; + if (ctx->mInterfaceId == chip::Inet::InterfaceId::Null()) + { + // If the InterfaceId in the context is Null, we will use the Station netif by default. + struct netif * lwip_netif = + reinterpret_cast(esp_netif_get_netif_impl(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); + ctx->mService[servicesIndex].mInterface = chip::Inet::InterfaceId(lwip_netif); + } + else + { + ctx->mService[servicesIndex].mInterface = ctx->mInterfaceId; + } if (currentResult->addr) { Inet::IPAddress IPAddr; @@ -403,9 +414,20 @@ static CHIP_ERROR ParseSrvResult(ResolveContext * ctx) ctx->mService->mAddressType = MapAddressType(ctx->mSrvQueryResult->ip_protocol); ctx->mService->mTransportType = ctx->mService->mAddressType; ctx->mService->mPort = ctx->mSrvQueryResult->port; - ctx->mService->mInterface = ctx->mInterfaceId; ctx->mService->mSubTypes = nullptr; ctx->mService->mSubTypeSize = 0; + if (ctx->mInterfaceId == chip::Inet::InterfaceId::Null()) + { + // If the InterfaceId in the context is Null, we will use the Station netif by default. + struct netif * lwip_netif = + reinterpret_cast(esp_netif_get_netif_impl(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); + ctx->mService->mInterface = chip::Inet::InterfaceId(lwip_netif); + } + else + { + ctx->mService->mInterface = ctx->mInterfaceId; + } + return CHIP_NO_ERROR; } else From 6cb9720fa2589df2ea17a06a3752ee1f1a8591f3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 16:50:16 -0400 Subject: [PATCH 27/96] Allow specifying per-controller OTA delegates in Darwin.framework. (#29014) Review note: the delegate-validation code in initWithFactory just moved there from startControllerFactory, with no real changes to it other than changing what it returns on error. --- .../Framework/CHIP/MTRDeviceController.mm | 54 +++++++++ .../CHIP/MTRDeviceControllerFactory.mm | 103 ++++++++---------- .../MTRDeviceControllerStartupParameters.h | 7 ++ .../CHIP/MTRDeviceControllerStartupParams.mm | 7 ++ ...TRDeviceControllerStartupParams_Internal.h | 3 + .../CHIP/MTRDeviceController_Internal.h | 16 ++- .../CHIP/MTROTAProviderDelegateBridge.h | 5 +- .../CHIP/MTROTAProviderDelegateBridge.mm | 55 +++++----- 8 files changed, 155 insertions(+), 95 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 44d3b63712d426..98d757d6d291e7 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -123,6 +123,8 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory queue:(dispatch_queue_t)queue storageDelegate:(id _Nullable)storageDelegate storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + otaProviderDelegate:(id _Nullable)otaProviderDelegate + otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier { if (self = [super init]) { @@ -143,6 +145,58 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory } } + // Ensure the otaProviderDelegate, if any, is valid. + if (otaProviderDelegate == nil && otaProviderDelegateQueue != nil) { + MTR_LOG_ERROR("Must have otaProviderDelegate when we have otaProviderDelegateQueue"); + return nil; + } + + if (otaProviderDelegate != nil && otaProviderDelegateQueue == nil) { + MTR_LOG_ERROR("Must have otaProviderDelegateQueue when we have otaProviderDelegate"); + return nil; + } + + if (otaProviderDelegate != nil) { + if (![otaProviderDelegate respondsToSelector:@selector(handleQueryImageForNodeID:controller:params:completion:)] + && ![otaProviderDelegate respondsToSelector:@selector(handleQueryImageForNodeID: + controller:params:completionHandler:)]) { + MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleQueryImageForNodeID"); + return nil; + } + if (![otaProviderDelegate respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completion:)] + && ![otaProviderDelegate + respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completionHandler:)]) { + MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleApplyUpdateRequestForNodeID"); + return nil; + } + if (![otaProviderDelegate respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID: + controller:params:completion:)] + && ![otaProviderDelegate + respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completionHandler:)]) { + MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleNotifyUpdateAppliedForNodeID"); + return nil; + } + if (![otaProviderDelegate respondsToSelector:@selector + (handleBDXTransferSessionBeginForNodeID:controller:fileDesignator:offset:completion:)] + && ![otaProviderDelegate respondsToSelector:@selector + (handleBDXTransferSessionBeginForNodeID: + controller:fileDesignator:offset:completionHandler:)]) { + MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXTransferSessionBeginForNodeID"); + return nil; + } + if (![otaProviderDelegate + respondsToSelector:@selector(handleBDXQueryForNodeID:controller:blockSize:blockIndex:bytesToSkip:completion:)] + && ![otaProviderDelegate + respondsToSelector:@selector(handleBDXQueryForNodeID: + controller:blockSize:blockIndex:bytesToSkip:completionHandler:)]) { + MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXQueryForNodeID"); + return nil; + } + } + + _otaProviderDelegate = otaProviderDelegate; + _otaProviderDelegateQueue = otaProviderDelegateQueue; + _chipWorkQueue = queue; _factory = factory; _deviceMapLock = OS_UNFAIR_LOCK_INIT; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index a11a7d30135e46..195fb61f5c7b6a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -61,7 +61,6 @@ static NSString * const kErrorControllerFactoryInit = @"Init failure while initializing controller factory"; static NSString * const kErrorKeystoreInit = @"Init failure while initializing persistent storage keystore"; static NSString * const kErrorCertStoreInit = @"Init failure while initializing persistent storage operational certificate store"; -static NSString * const kErrorOtaProviderInit = @"Init failure while creating an OTA provider delegate"; static NSString * const kErrorSessionKeystoreInit = @"Init failure while initializing session keystore"; static bool sExitHandlerRegistered = false; @@ -123,6 +122,9 @@ @interface MTRDeviceControllerFactory () // D. Locking around reads not from the Matter queue is OK but not required. @property (nonatomic, readonly) os_unfair_lock controllersLock; +@property (nonatomic, readonly, nullable) id otaProviderDelegate; +@property (nonatomic, readonly, nullable) dispatch_queue_t otaProviderDelegateQueue; + - (BOOL)findMatchingFabric:(FabricTable &)fabricTable params:(MTRDeviceControllerStartupParams *)params fabric:(const FabricInfo * _Nullable * _Nonnull)fabric; @@ -289,9 +291,15 @@ - (void)cleanupInitObjects - (void)cleanupStartupObjects { - if (_otaProviderDelegateBridge) { - delete _otaProviderDelegateBridge; - _otaProviderDelegateBridge = nullptr; + // Make sure the deinit order here is the reverse of the init order in + // startControllerFactory: + _certificationDeclarationCertificates = nil; + _productAttestationAuthorityCertificates = nil; + + if (_opCertStore) { + _opCertStore->Finish(); + delete _opCertStore; + _opCertStore = nullptr; } if (_keystore) { @@ -300,11 +308,12 @@ - (void)cleanupStartupObjects _keystore = nullptr; } - if (_opCertStore) { - _opCertStore->Finish(); - delete _opCertStore; - _opCertStore = nullptr; + if (_otaProviderDelegateBridge) { + delete _otaProviderDelegateBridge; + _otaProviderDelegateBridge = nullptr; } + _otaProviderDelegateQueue = nil; + _otaProviderDelegate = nil; if (_sessionResumptionStorage) { delete _sessionResumptionStorage; @@ -412,57 +421,12 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams return; } - if (startupParams.otaProviderDelegate) { - if (![startupParams.otaProviderDelegate respondsToSelector:@selector(handleQueryImageForNodeID: - controller:params:completion:)] - && ![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleQueryImageForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleQueryImageForNodeID"); - errorCode = CHIP_ERROR_INVALID_ARGUMENT; - return; - } - if (![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completion:)] - && ![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleApplyUpdateRequestForNodeID"); - errorCode = CHIP_ERROR_INVALID_ARGUMENT; - return; - } - if (![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completion:)] - && ![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleNotifyUpdateAppliedForNodeID"); - errorCode = CHIP_ERROR_INVALID_ARGUMENT; - return; - } - if (![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleBDXTransferSessionBeginForNodeID: - controller:fileDesignator:offset:completion:)] - && ![startupParams.otaProviderDelegate - respondsToSelector:@selector - (handleBDXTransferSessionBeginForNodeID:controller:fileDesignator:offset:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXTransferSessionBeginForNodeID"); - errorCode = CHIP_ERROR_INVALID_ARGUMENT; - return; - } - if (![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleBDXQueryForNodeID:controller:blockSize:blockIndex:bytesToSkip:completion:)] - && ![startupParams.otaProviderDelegate - respondsToSelector:@selector(handleBDXQueryForNodeID: - controller:blockSize:blockIndex:bytesToSkip:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXQueryForNodeID"); - errorCode = CHIP_ERROR_INVALID_ARGUMENT; - return; - } - _otaProviderDelegateBridge = new MTROTAProviderDelegateBridge(startupParams.otaProviderDelegate); - if (_otaProviderDelegateBridge == nil) { - MTR_LOG_ERROR("Error: %@", kErrorOtaProviderInit); - errorCode = CHIP_ERROR_NO_MEMORY; - return; - } + _otaProviderDelegate = startupParams.otaProviderDelegate; + if (_otaProviderDelegate != nil) { + _otaProviderDelegateQueue = dispatch_queue_create( + "org.csa-iot.matter.framework.otaprovider.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); } + _otaProviderDelegateBridge = new MTROTAProviderDelegateBridge(); // TODO: Allow passing a different keystore implementation via startupParams. _keystore = new PersistentStorageOperationalKeystore(); @@ -594,19 +558,25 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams return nil; } - id storageDelegate; - dispatch_queue_t storageDelegateQueue; + id _Nullable storageDelegate; + dispatch_queue_t _Nullable storageDelegateQueue; NSUUID * uniqueIdentifier; + id _Nullable otaProviderDelegate; + dispatch_queue_t _Nullable otaProviderDelegateQueue; if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParameters class]]) { MTRDeviceControllerStartupParameters * params = startupParams; storageDelegate = params.storageDelegate; storageDelegateQueue = params.storageDelegateQueue; uniqueIdentifier = params.uniqueIdentifier; + otaProviderDelegate = params.otaProviderDelegate; + otaProviderDelegateQueue = params.otaProviderDelegateQueue; } else if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParams class]]) { MTRDeviceControllerStartupParams * params = startupParams; storageDelegate = nil; storageDelegateQueue = nil; uniqueIdentifier = params.uniqueIdentifier; + otaProviderDelegate = nil; + otaProviderDelegateQueue = nil; } else { MTR_LOG_ERROR("Unknown kind of startup params: %@", startupParams); return nil; @@ -628,10 +598,19 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams return nil; } + // Fall back to the factory-wide OTA provider delegate if one is not + // provided in the startup params. + if (otaProviderDelegate == nil) { + otaProviderDelegate = self.otaProviderDelegate; + otaProviderDelegateQueue = self.otaProviderDelegateQueue; + } + // Create the controller, so we start the event loop, since we plan to do // our fabric table operations there. auto * controller = [self _createController:storageDelegate storageDelegateQueue:storageDelegateQueue + otaProviderDelegate:otaProviderDelegate + otaProviderDelegateQueue:otaProviderDelegateQueue uniqueIdentifier:uniqueIdentifier]; if (controller == nil) { if (error != nil) { @@ -874,6 +853,8 @@ - (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupP - (MTRDeviceController * _Nullable)_createController:(id _Nullable)storageDelegate storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + otaProviderDelegate:(id _Nullable)otaProviderDelegate + otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier { [self _assertCurrentQueueIsNotMatterQueue]; @@ -882,6 +863,8 @@ - (MTRDeviceController * _Nullable)_createController:(id #import +#import NS_ASSUME_NONNULL_BEGIN @@ -59,6 +60,12 @@ MTR_NEWLY_AVAILABLE - (void)setOperationalCertificateIssuer:(id)operationalCertificateIssuer queue:(dispatch_queue_t)queue; +/** + * Set an MTROTAProviderDelegate to call (on the provided queue). Only needs to + * be called if this controller should be able to handle OTA for devices. + */ +- (void)setOTAProviderDelegate:(id)otaProviderDelegate queue:(dispatch_queue_t)queue; + @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 57c9270a682b08..7bbcea96183035 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -288,6 +288,13 @@ - (void)setOperationalCertificateIssuer:(id)ope _operationalCertificateIssuer = operationalCertificateIssuer; _operationalCertificateIssuerQueue = queue; } + +- (void)setOTAProviderDelegate:(id)otaProviderDelegate queue:(dispatch_queue_t)queue +{ + _otaProviderDelegate = otaProviderDelegate; + _otaProviderDelegateQueue = queue; +} + @end @implementation MTRDeviceControllerExternalCertificateStartupParameters diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index cb7540c2e16e65..734197ef72d2d6 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -77,6 +77,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, readonly) dispatch_queue_t storageDelegateQueue; @property (nonatomic, strong, readonly) NSUUID * uniqueIdentifier; +@property (nonatomic, strong, readonly, nullable) id otaProviderDelegate; +@property (nonatomic, strong, readonly, nullable) dispatch_queue_t otaProviderDelegateQueue; + @end MTR_HIDDEN diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 89db3a9f951d3e..6ff5843f622513 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -30,9 +30,10 @@ #import "MTRBaseDevice.h" #import "MTRDeviceController.h" #import "MTRDeviceControllerDataStore.h" -#import "MTRDeviceControllerStorageDelegate.h" #import +#import +#import @class MTRDeviceControllerStartupParamsInternal; @class MTRDeviceControllerFactory; @@ -75,12 +76,19 @@ NS_ASSUME_NONNULL_BEGIN * * This property MUST be gotten from the Matter work queue. */ -@property (readonly, nullable) NSNumber * compressedFabricID; +@property (nonatomic, readonly, nullable) NSNumber * compressedFabricID; /** * The per-controller data store this controller was initialized with, if any. */ -@property (nonatomic, nullable) MTRDeviceControllerDataStore * controllerDataStore; +@property (nonatomic, readonly, nullable) MTRDeviceControllerDataStore * controllerDataStore; + +/** + * OTA delegate and its queue, if this controller supports OTA. Either both + * will be non-nil or both will be nil. + */ +@property (nonatomic, readonly, nullable) id otaProviderDelegate; +@property (nonatomic, readonly, nullable) dispatch_queue_t otaProviderDelegateQueue; /** * Init a newly created controller. @@ -91,6 +99,8 @@ NS_ASSUME_NONNULL_BEGIN queue:(dispatch_queue_t)queue storageDelegate:(id _Nullable)storageDelegate storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + otaProviderDelegate:(id _Nullable)otaProviderDelegate + otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier; /** diff --git a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.h b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.h index f502dbff081d26..f74fb32a08bd19 100644 --- a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.h +++ b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.h @@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN class MTROTAProviderDelegateBridge : public chip::app::Clusters::OTAProviderDelegate { public: - MTROTAProviderDelegateBridge(id delegate); + MTROTAProviderDelegateBridge(); ~MTROTAProviderDelegateBridge(); CHIP_ERROR Init(chip::System::Layer * systemLayer, chip::Messaging::ExchangeManager * exchangeManager); @@ -65,9 +65,6 @@ class MTROTAProviderDelegateBridge : public chip::app::Clusters::OTAProviderDele static void ConvertToNotifyUpdateAppliedParams( const chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::DecodableType & commandData, MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams * commandParams); - - _Nullable id mDelegate; - dispatch_queue_t mDelegateNotificationQueue; }; NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm index 4ebef0535253ee..1b9f436751b2a5 100644 --- a/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm +++ b/src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm @@ -69,7 +69,6 @@ CHIP_ERROR PrepareForTransfer(FabricIndex fabricIndex, NodeId nodeId) { assertChipStackLockedByCurrentThread(); - VerifyOrReturnError(mDelegate != nil, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mExchangeMgr != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mSystemLayer != nullptr, CHIP_ERROR_INCORRECT_STATE); @@ -121,18 +120,6 @@ void ControllerShuttingDown(MTRDeviceController * controller) } } - void SetDelegate(id delegate, dispatch_queue_t delegateNotificationQueue) - { - if (delegate) { - mDelegate = delegate; - mDelegateNotificationQueue = delegateNotificationQueue; - } else { - ResetState(); - mDelegate = nil; - mDelegateNotificationQueue = nil; - } - } - void ResetState() { assertChipStackLockedByCurrentThread(); @@ -161,6 +148,9 @@ void ResetState() mExchangeCtx = nullptr; } + mDelegate = nil; + mDelegateNotificationQueue = nil; + mInitialized = false; } @@ -463,6 +453,16 @@ CHIP_ERROR ConfigureState(chip::FabricIndex fabricIndex, chip::NodeId nodeId) ResetState(); } + auto * controller = [[MTRDeviceControllerFactory sharedInstance] runningControllerForFabricIndex:fabricIndex]; + VerifyOrReturnError(controller != nil, CHIP_ERROR_INCORRECT_STATE); + + mDelegate = controller.otaProviderDelegate; + mDelegateNotificationQueue = controller.otaProviderDelegateQueue; + + // We should have already checked that this controller supports OTA. + VerifyOrReturnError(mDelegate != nil, CHIP_ERROR_INCORRECT_STATE); + VerifyOrReturnError(mDelegateNotificationQueue != nil, CHIP_ERROR_INCORRECT_STATE); + // Start a timer to track whether we receive a BDX init after a successful query image in a reasonable amount of time CHIP_ERROR err = mSystemLayer->StartTimer(kBdxInitReceivedTimeout, HandleBdxInitReceivedTimeoutExpired, this); LogErrorOnFailure(err); @@ -497,18 +497,11 @@ CHIP_ERROR ConfigureState(chip::FabricIndex fabricIndex, chip::NodeId nodeId) NSInteger const kOtaProviderEndpoint = 0; } // anonymous namespace -MTROTAProviderDelegateBridge::MTROTAProviderDelegateBridge(id delegate) - : mDelegate(delegate) - , mDelegateNotificationQueue( - dispatch_queue_create("org.csa-iot.matter.framework.otaprovider.workqueue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL)) -{ - gOtaSender.SetDelegate(delegate, mDelegateNotificationQueue); - Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, this); -} +MTROTAProviderDelegateBridge::MTROTAProviderDelegateBridge() { Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, this); } MTROTAProviderDelegateBridge::~MTROTAProviderDelegateBridge() { - gOtaSender.SetDelegate(nil, nil); + gOtaSender.ResetState(); Clusters::OTAProvider::SetDelegate(kOtaProviderEndpoint, nullptr); } @@ -547,6 +540,12 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath return false; } + if (!controller.otaProviderDelegate) { + // This controller does not support OTA. + commandHandler->AddStatus(commandPath, Status::UnsupportedCommand); + return false; + } + *outController = controller; *outNodeId = desc.subject; return true; @@ -722,8 +721,8 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath }]; }; - auto strongDelegate = mDelegate; - dispatch_async(mDelegateNotificationQueue, ^{ + auto strongDelegate = controller.otaProviderDelegate; + dispatch_async(controller.otaProviderDelegateQueue, ^{ if ([strongDelegate respondsToSelector:@selector(handleQueryImageForNodeID:controller:params:completion:)]) { [strongDelegate handleQueryImageForNodeID:@(nodeId) controller:controller @@ -782,8 +781,8 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath auto * commandParams = [[MTROTASoftwareUpdateProviderClusterApplyUpdateRequestParams alloc] init]; ConvertToApplyUpdateRequestParams(commandData, commandParams); - auto strongDelegate = mDelegate; - dispatch_async(mDelegateNotificationQueue, ^{ + auto strongDelegate = controller.otaProviderDelegate; + dispatch_async(controller.otaProviderDelegateQueue, ^{ if ([strongDelegate respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completion:)]) { [strongDelegate handleApplyUpdateRequestForNodeID:@(nodeId) controller:controller @@ -838,8 +837,8 @@ bool GetPeerNodeInfo(CommandHandler * commandHandler, const ConcreteCommandPath auto * commandParams = [[MTROTASoftwareUpdateProviderClusterNotifyUpdateAppliedParams alloc] init]; ConvertToNotifyUpdateAppliedParams(commandData, commandParams); - auto strongDelegate = mDelegate; - dispatch_async(mDelegateNotificationQueue, ^{ + auto strongDelegate = controller.otaProviderDelegate; + dispatch_async(controller.otaProviderDelegateQueue, ^{ if ([strongDelegate respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completion:)]) { [strongDelegate handleNotifyUpdateAppliedForNodeID:@(nodeId) controller:controller From 28006109a21a4ed8544822f6c2cb8cf43d77aa81 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:28:22 -0400 Subject: [PATCH 28/96] [Silabs]Re-enable some compilation flags (#29020) * remove some -wno flag that are not needed anymore. Root issue fixed in gsdk * fix array bounds error in rsi_if. some cleanup --- .../platform/silabs/efr32/rs911x/rsi_if.c | 61 +++++++++---------- .../silabs/SiWx917/wifi/wfx_host_events.h | 1 - .../silabs/efr32/wifi/wfx_host_events.h | 1 - third_party/silabs/efr32_sdk.gni | 11 +--- 4 files changed, 29 insertions(+), 45 deletions(-) diff --git a/examples/platform/silabs/efr32/rs911x/rsi_if.c b/examples/platform/silabs/efr32/rs911x/rsi_if.c index c89f31142beb96..c43389761dcdfc 100644 --- a/examples/platform/silabs/efr32/rs911x/rsi_if.c +++ b/examples/platform/silabs/efr32/rs911x/rsi_if.c @@ -54,6 +54,11 @@ #include "wfx_host_events.h" #include "wfx_rsi.h" +// TODO convert this file to cpp and use CodeUtils.h +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif + /* Rsi driver Task will use as its stack */ StackType_t driverRsiTaskStack[WFX_RSI_WLAN_TASK_SZ] = { 0 }; @@ -691,50 +696,40 @@ void wfx_rsi_task(void * arg) { if (!(wfx_rsi.dev_state & WFX_RSI_ST_SCANSTARTED)) { - SILABS_LOG("%s: start SSID scan", __func__); - int x; - wfx_wifi_scan_result_t ap; - rsi_scan_info_t * scan; - int32_t status; - uint8_t bgscan_results[BG_SCAN_RES_SIZE] = { 0 }; - status = rsi_wlan_bgscan_profile(1, (rsi_rsp_scan_t *) bgscan_results, BG_SCAN_RES_SIZE); - - SILABS_LOG("%s: status: %02x size = %d", __func__, status, BG_SCAN_RES_SIZE); - rsi_rsp_scan_t * rsp = (rsi_rsp_scan_t *) bgscan_results; + rsi_rsp_scan_t scan_rsp = { 0 }; + int32_t status = rsi_wlan_bgscan_profile(1, &scan_rsp, sizeof(scan_rsp)); + if (status) { - /* - * Scan is done - failed - */ + SILABS_LOG("SSID scan failed: %02x ", status); } else - for (x = 0; x < rsp->scan_count[0]; x++) + { + rsi_scan_info_t * scan; + wfx_wifi_scan_result_t ap; + for (int x = 0; x < scan_rsp.scan_count[0]; x++) { - scan = &rsp->scan_info[x]; - strcpy(&ap.ssid[0], (char *) &scan->ssid[0]); - if (wfx_rsi.scan_ssid) + scan = &scan_rsp.scan_info[x]; + // is it a scan all or target scan + if (!wfx_rsi.scan_ssid || + (wfx_rsi.scan_ssid && strcmp(wfx_rsi.scan_ssid, (char *) scan->ssid) == CMP_SUCCESS)) { - SILABS_LOG("Inside scan_ssid"); - SILABS_LOG("SCAN SSID: %s , ap scan: %s", wfx_rsi.scan_ssid, ap.ssid); - if (strcmp(wfx_rsi.scan_ssid, ap.ssid) == CMP_SUCCESS) - { - SILABS_LOG("Inside ap details"); - ap.security = scan->security_mode; - ap.rssi = (-1) * scan->rssi_val; - memcpy(&ap.bssid[0], &scan->bssid[0], BSSID_MAX_STR_LEN); - (*wfx_rsi.scan_cb)(&ap); - } - } - else - { - SILABS_LOG("Inside else"); + strncpy(ap.ssid, (char *) scan->ssid, MIN(sizeof(ap.ssid), sizeof(scan->ssid))); ap.security = scan->security_mode; ap.rssi = (-1) * scan->rssi_val; - ap.chan = scan->rf_channel; - memcpy(&ap.bssid[0], &scan->bssid[0], BSSID_MAX_STR_LEN); + configASSERT(sizeof(ap.bssid) >= BSSID_MAX_STR_LEN); + configASSERT(sizeof(scan->bssid) >= BSSID_MAX_STR_LEN); + memcpy(ap.bssid, scan->bssid, BSSID_MAX_STR_LEN); (*wfx_rsi.scan_cb)(&ap); + + if (wfx_rsi.scan_ssid) + { + break; // we found the targeted ssid. + } } } + } + wfx_rsi.dev_state &= ~WFX_RSI_ST_SCANSTARTED; /* Terminate with end of scan which is no ap sent back */ (*wfx_rsi.scan_cb)((wfx_wifi_scan_result_t *) 0); diff --git a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h index 32518820d64045..c63f358774902f 100644 --- a/src/platform/silabs/SiWx917/wifi/wfx_host_events.h +++ b/src/platform/silabs/SiWx917/wifi/wfx_host_events.h @@ -127,7 +127,6 @@ #define SCAN_BITMAP_OPTN_1 (1) #define IP_CONF_RSP_BUFF_LENGTH_4 (4) #define STATION (0) -#define BG_SCAN_RES_SIZE (500) #define SPI_CONFIG_SUCCESS (0) diff --git a/src/platform/silabs/efr32/wifi/wfx_host_events.h b/src/platform/silabs/efr32/wifi/wfx_host_events.h index ab722f649532cc..4fe2d5a96f6cb7 100644 --- a/src/platform/silabs/efr32/wifi/wfx_host_events.h +++ b/src/platform/silabs/efr32/wifi/wfx_host_events.h @@ -214,7 +214,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s #define SCAN_BITMAP_OPTN_1 1 #define IP_CONF_RSP_BUFF_LENGTH_4 4 #define STATION 0 -#define BG_SCAN_RES_SIZE 500 #define SPI_CONFIG_SUCESS 0 diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 2295bd5e14f9fd..8ecd5ff4db53cd 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -516,16 +516,7 @@ template("efr32_sdk") { cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] } - cflags += [ - "-Wno-maybe-uninitialized", - "-Wno-shadow", - - # see https://github.com/project-chip/connectedhomeip/issues/26058 - "-Wno-error=array-parameter", - - # see https://github.com/project-chip/connectedhomeip/issues/26170 - "-Wno-error=array-bounds", - ] + cflags += [ "-Wno-shadow" ] if (silabs_family == "efr32mg24" || silabs_family == "mgm24") { cflags += [ "-mcmse" ] From a823c63057bf837df28768deb05a546bee6aa232 Mon Sep 17 00:00:00 2001 From: Liam Gonyea <80923273+liamgonyea@users.noreply.github.com> Date: Fri, 1 Sep 2023 14:52:57 -0700 Subject: [PATCH 29/96] New op creds yaml test (#28786) * Adding new ciTest Test_TC_OPCREDS_3_7.yaml * Edit to new ciTest Test_TC_OPCREDS_3_7.yaml * Fixed formatting issues in Test_TC_OPCREDS_3_7.yaml and added yaml to _GetChipReplUnsupportedTests * Fixed failing steps on Test_TC_OPCREDS_3_7.yaml * Added Test_TC_OPCREDS_3_7 to DFT CI Tests disabled list * Update examples/darwin-framework-tool/templates/tests/ciTests.json Co-authored-by: Boris Zbarsky * Update src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml Co-authored-by: Boris Zbarsky * Updated reasoning for disabled step for src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml * Addressing changes made to the test plan in CHIP-Specifications/chip-test-plans/pull/3398 for Step 6 and Step 12 * Provided justification for Step 9/10 being disabled * cleanup verification step comments based on Test Plan PR * Apply suggestions from code review Co-authored-by: Boris Zbarsky * Added WaitForCommissionee to Step 10 to guarantee we do CASE * Applied restyled patch --------- Co-authored-by: Boris Zbarsky --- .../templates/tests/ciTests.json | 2 + scripts/tests/chiptest/__init__.py | 1 + .../certification/Test_TC_OPCREDS_3_7.yaml | 363 +++++++++++------- src/app/tests/suites/ciTests.json | 1 + 4 files changed, 224 insertions(+), 143 deletions(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index b717e8acf13005..ad899068350067 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -30,6 +30,8 @@ "Test_TC_ACL_2_8", "Test_TC_ACL_2_9", "Test_TC_ACL_2_10", + "Disabled due to GetCommissionerRootCertificate command not being supported", + "Test_TC_OPCREDS_3_7", "DL_LockUnlock", "Disabled due to Events verification not supported", "Test_TC_BINFO_2_2", diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 1350e8c0c5a82a..ce312d492beabd 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -152,6 +152,7 @@ def _GetChipReplUnsupportedTests() -> Set[str]: """Tests that fail in chip-repl for some reason""" return { "Test_AddNewFabricFromExistingFabric.yaml", # chip-repl does not support GetCommissionerRootCertificate and IssueNocChain command + "Test_TC_OPCREDS_3_7.yaml", # chip-repl does not support GetCommissionerRootCertificate and IssueNocChain command "TestEqualities.yaml", # chip-repl does not support pseudo-cluster commands that return a value "TestExampleCluster.yaml", # chip-repl does not load custom pseudo clusters "TestAttributesById.yaml", # chip-repl does not support AnyCommands (06/06/2023) diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml index d8e3bb279c7402..531fdf492ac3e2 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_7.yaml @@ -11,7 +11,6 @@ # 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. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 15.2.6. [TC-OPCREDS-3.7] Add Second Fabric over CASE [DUT-Server] @@ -20,191 +19,269 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" + cluster: "Operational Credentials" endpoint: 0 tests: - - label: "Pre-Conditions" + - label: "Precondition" verification: | TH1 and TH2 are 2 clients that trust each other disabled: true + - label: "Wait for the alpha device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + - label: "Step 1: Factory Reset DUT (to ensure NOC list is empty at the beginning of the following steps)" PICS: OPCREDS.S.A0000 - verification: | - On both DUT and TH side, on Raspi we do factory reset with the below command. The DUT for cert should follow vendor specific procedure for factory reset - sudo rm -rf /tmp/chip_* + # verification: "" + # Disabling this step, because the test starts with a DUT device that has just been commissioned by the TH1 commissioner disabled: true - label: "Step 2: Start the commissioning process of DUT by TH1 on the first Fabric." - verification: | - On TH (chip-tool) side: - ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 - [1690193191.894851][13219:13221] CHIP:CTL: Received CommissioningComplete response, errorCode=0 - [1690193191.894879][13219:13221] CHIP:CTL: Successfully finished commissioning step 'SendComplete' - + # PICS: "" + # verification: "Verify that TH1 successfully completes commissioning, including establishing a CASE session on the operational network and issuing a CommissioningComplete command." + # Disabling this step, because the test starts with a DUT device that has just been commissioned by the TH1 commissioner - On DUT(all-clusters-app) side: - ./all-clusters-app - [1641381202.306840][4431:4431] CHIP:DL: NVS set: chip-config/regulatory-location = 0 (0x0) disabled: true - label: - "Step 3: TH1 does a non-fabric-filtered read of the Fabrics attribute - from the Node Operational Credentials cluster. Save the FabricIndex - for TH1 as TH1_Fabric_Index for future use." + "Step 3.1: Save the FabricIndex for TH1 as TH1_Fabric_Index for future + use." PICS: OPCREDS.S.A0001 - verification: | - ./chip-tool operationalcredentials read fabrics 1 0 - - Verify on the Th(chip-tool) that fabrics has only 1 entry and save the fabric index as TH1_Fabric_Index for using in the following steps - - - [1690193331.552693][13227:13229] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Attribute 0x0000_0001 DataVersion: 632277469 - [1690193331.552824][13227:13229] CHIP:TOO: Fabrics: 1 entries - [1690193331.552910][13227:13229] CHIP:TOO: [1]: { - [1690193331.552945][13227:13229] CHIP:TOO: RootPublicKey: 04AD3DD61741C7F8BB56C922BCAADF1A44BD7AB7A00BB3D3D9CDB6C5889C841AA59C62C5A504CA2DE33BFE0626B6E570DC1716ECA769295C0D6BBB0FA5B3A5E69C - [1690193331.552972][13227:13229] CHIP:TOO: VendorID: 65521 - [1690193331.552997][13227:13229] CHIP:TOO: FabricID: 1 - [1690193331.553020][13227:13229] CHIP:TOO: NodeID: 1 - [1690193331.553044][13227:13229] CHIP:TOO: Label: - [1690193331.553066][13227:13229] CHIP:TOO: FabricIndex: 1 - [1690193331.553088][13227:13229] CHIP:TOO: } - [1690193331.553268][13227:13229] CHIP:EM: <<< [E:60956i S:18401 M:33374407 (Ack:23211476)] (S) Msg TX to 1:0000000000000001 [C23D] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + identity: "alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "CurrentFabricIndex" + response: + saveAs: TH1_Fabric_Index + - label: + "Step 3.2: TH1 does a non-fabric-filtered read of the Fabrics + attribute from the Node Operational Credentials cluster." + PICS: OPCREDS.S.A0001 + identity: "alpha" + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + value: [{ "FabricIndex": TH1_Fabric_Index, "Label": "" }] + constraints: + type: list + + # verification: "Verify that there is a single entry in the list and the FabricIndex for that entry matches TH1_Fabric_Index." - label: "Step 4: TH1 sends ArmFailSafe command to the DUT with the ExpiryLengthSeconds field set to 60 seconds" PICS: CGEN.S.C00.Rsp && CGEN.S.C01.Tx - verification: | - ./chip-tool generalcommissioning arm-fail-safe 60 0 1 0 - - Verify on the Th(chip-tool) that DUT sends ArmFailSafeResponse command to TH1 with field ErrorCode as OK(0) - - [1690226811353] [19885:5418547] [DMG] Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 - [1690226811354] [19885:5418547] [TOO] Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 - [1690226811354] [19885:5418547] [TOO] ArmFailSafeResponse: { - [1690226811354] [19885:5418547] [TOO] errorCode: 0 - [1690226811354] [19885:5418547] [TOO] debugText: - [1690226811354] [19885:5418547] [TOO] } - disabled: true - - - label: "Step 5: TH1 Sends CSRRequest command with a random 32-byte nonce" + identity: "alpha" + cluster: "General Commissioning" + command: "ArmFailSafe" + arguments: + values: + - name: "ExpiryLengthSeconds" + value: 60 + - name: "Breadcrumb" + value: 0 + response: + values: + - name: "ErrorCode" + value: 0 # OK + + # verification: "Verify that the DUT sends ArmFailSafeResponse command to TH1 with field ErrorCode as OK(0)" + - label: "Step 5: TH1 Sends CSRRequest command with a random 32-byte nonce." PICS: OPCREDS.S.C04.Rsp - verification: | - To get CSR Nonce give below command - echo hex:$(hexdump -vn32 -e'4/4 "%08X" ' /dev/urandom) - - ./chip-tool operationalcredentials csrrequest 1 0 - - ./chip-tool operationalcredentials csrrequest hex:A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F359902982717603 1 0 - - Verify the CSRResponse in TH Log - - [1658223679.580697][6136:6141] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0005 - [1658223679.580761][6136:6141] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0005 - [1658223679.580823][6136:6141] CHIP:TOO: CSRResponse: { - [1658223679.580875][6136:6141] CHIP:TOO: NOCSRElements: 153001CB3081C83070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200047DA16C714034D3B96716F64DC0E742D007233212025E305AF6CE56DFA057718E149E52B39584456C8F954A1596B64F8BBC02E501276B962D4AB2C0A607D983C9A000300A06082A8648CE3D040302034800304502206FB78A61A7B0F021C396FEC1CCD6802129AC3EE5EA2727ABCCB19DBAEA7DEE1A022100A5C81ADC5D8BFAA5DB84A1261D8BBCEA5C26B24D4405F0B978E19B17D8458C9E300220A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F35990298271760318 - [1658223679.580915][6136:6141] CHIP:TOO: attestationSignature: EB731B40B20501AF32C468AA522948F7848D3AEDFA24D9A879575B4A265886C97109EE0DE1ECEB969B1A7F98F127DB4C275292B986BF8DA56EF7B16DA8EC8ABE - [1658223679.580943][6136:6141] CHIP:TOO: } - disabled: true - + identity: "alpha" + command: "CSRRequest" + cluster: "Operational Credentials" + arguments: + values: + - name: CSRNonce + value: "\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07\x00\x01\x02\x03\x04\x05\x06\x07" + response: + values: + - name: "NOCSRElements" + saveAs: NOCSRElements + - name: "AttestationSignature" + saveAs: attestationSignature + + # verification: "Step 5: Verify that the DUT responds with the CSRResponse command." - label: - "Step 6: TH1 validates the Device Attestation Signature - (attestation_signature) field from CSRResponse command in Step 5" - PICS: OPCREDS.S.C04.Rsp - verification: | - To get CSR Nonce give below command - echo hex:$(hexdump -vn32 -e'4/4 "%08X" ' /dev/urandom) - - ./chip-tool operationalcredentials csrrequest 1 0 - - ./chip-tool operationalcredentials csrrequest hex:A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F359902982717603 1 0 - - Verify the CSRResponse in TH Log - - [1658223679.580697][6136:6141] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0005 - [1658223679.580761][6136:6141] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_003E Command 0x0000_0005 - [1658223679.580823][6136:6141] CHIP:TOO: CSRResponse: { - [1658223679.580875][6136:6141] CHIP:TOO: NOCSRElements: 153001CB3081C83070020100300E310C300A060355040A0C034353523059301306072A8648CE3D020106082A8648CE3D030107034200047DA16C714034D3B96716F64DC0E742D007233212025E305AF6CE56DFA057718E149E52B39584456C8F954A1596B64F8BBC02E501276B962D4AB2C0A607D983C9A000300A06082A8648CE3D040302034800304502206FB78A61A7B0F021C396FEC1CCD6802129AC3EE5EA2727ABCCB19DBAEA7DEE1A022100A5C81ADC5D8BFAA5DB84A1261D8BBCEA5C26B24D4405F0B978E19B17D8458C9E300220A61BFCE6E2C6AAF48FDEC4BF9DCEF08EB65B976997D82BE5F35990298271760318 - [1658223679.580915][6136:6141] CHIP:TOO: attestationSignature: EB731B40B20501AF32C468AA522948F7848D3AEDFA24D9A879575B4A265886C97109EE0DE1ECEB969B1A7F98F127DB4C275292B986BF8DA56EF7B16DA8EC8ABE - [1658223679.580943][6136:6141] CHIP:TOO: } - disabled: true - + "Step 6.1: Read the commissioner root certificate from TH2's fabric. + Save RCAC as Root_CA_Certificate_TH2" + # PICS: + identity: "beta" + cluster: "CommissionerCommands" + command: "GetCommissionerRootCertificate" + response: + values: + - name: "RCAC" + saveAs: Root_CA_Certificate_TH2 + + # verification: "" - label: - "Step 7: TH2 generates the NOC, the Root CA Certificate and ICAC using - the CSR elements from Step 5 and selects an IPK, all for use by TH2. - The certificates shall have their subjects padded with additional data - such that they are each the maximum certificate size of 400 bytes when - encoded in the MatterCertificateEncoding. Save RCAC as - Root_CA_Certificate_TH2 Save ICAC as Intermediate_Certificate_TH2 Save - NOC as Node_Operational_Certificate_TH2 Save IPK as IPK_TH2 Extract - the RCAC public key and save as Root_Public_Key_TH2" - verification: | - - disabled: true - + "Step 6.2: TH2 generates the NOC, the Root CA Certificate and ICAC + using the CSR elements from Step 5 and selects an IPK, all for use by + TH2. Save ICAC as Intermediate_Certificate_TH2. Save NOC as + Node_Operational_Certificate_TH2. Save IPK as IPK_TH2. Extract the + RCAC public key and save as Root_Public_Key_TH2." + # PICS: + identity: "beta" + cluster: "CommissionerCommands" + command: "IssueNocChain" + arguments: + values: + - name: "Elements" + value: NOCSRElements + - name: "nodeId" + value: 0x43211234 + response: + values: + - name: "NOC" + saveAs: Node_Operational_Certificate_TH2 + - name: "ICAC" + saveAs: Intermediate_Certificate_TH2 + - name: "IPK" + saveAs: IPK_TH2 + + # verification: "" + - label: "Step 7.1: Read the commissioner node ID from TH2" + # PICS: + identity: "beta" + cluster: "CommissionerCommands" + command: "GetCommissionerNodeId" + response: + values: + - name: "nodeId" + saveAs: Commissioner_Node_Id_TH2 + + # verification: "" - label: - "Step 8: TH1 sends AddTrustedRootCertificate command to DUT with + "Step 7.2: TH1 sends AddTrustedRootCertificate command to DUT with RootCACertificate set to Root_CA_Certificate_TH2" PICS: OPCREDS.S.C0b.Rsp - verification: | - Verify that AddTrustedRootCertificate command succeeds by sending the status code as SUCCESS - disabled: true - + identity: "alpha" + command: "AddTrustedRootCertificate" + cluster: "Operational Credentials" + arguments: + values: + - name: "RootCACertificate" + value: Root_CA_Certificate_TH2 + + # verification: "Verify that AddTrustedRootCertificate command succeeds by sending the status code as SUCCESS" - label: - "Step 9: TH1 sends the AddNOC command to DUT with the following - fields: NOCValue as Node_Operational_Certificate_TH2 ICACValue as - Intermediate_Certificate_TH2 IpkValue as IPK_TH2 CaseAdminSubject as - the NodeID of TH2 AdminVendorId as the Vendor ID of TH2" + "Step 8: TH1 sends the AddNOC command to DUT with the following + fields: NOCValue as Node_Operational_Certificate_TH2. ICACValue as + Intermediate_Certificate_TH2. IpkValue as IPK_TH2. CaseAdminSubject as + the NodeID of TH2. AdminVendorId as the Vendor ID of TH2." PICS: OPCREDS.S.C06.Rsp && OPCREDS.S.C08.Tx - verification: | - Verify that DUT responds with NOCResponse with status code OK - disabled: true - - - label: "Step 10: TH2 starts discovery of DUT using Operational Discovery" - verification: | - + identity: "alpha" + command: "AddNOC" + cluster: "Operational Credentials" + arguments: + values: + - name: "NOCValue" + value: Node_Operational_Certificate_TH2 + - name: "ICACValue" + value: Intermediate_Certificate_TH2 + - name: "IPKValue" + value: IPK_TH2 + - name: "CaseAdminSubject" + value: Commissioner_Node_Id_TH2 + - name: "AdminVendorId" + value: 0xFFF1 + response: + values: + - name: "StatusCode" + value: 0 + + # verification: "Verify that DUT responds with NOCResponse with status code OK" + - label: "Step 9: TH2 starts discovery of DUT using Operational Discovery" + # PICS: "" + # verification: "" + # Disabling this step as this occurs from the AddNOC command being run disabled: true - label: - "Step 11: TH2 opens a CASE session with DUT over operational network" - verification: | - DUT is able to open the CASE session with TH2 - disabled: true - - - label: "Step 12: TH2 sends CommissioningComplete command" + "Step 10: TH2 opens a CASE session with DUT over operational network." + # PICS: "" + identity: "beta" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: 0x43211234 + + # verification: "DUT is able to open the CASE session with TH2" + - label: "Step 11: TH2 sends CommissioningComplete command" PICS: CGEN.S.C05.Tx - verification: | - DUT respond with SUCCESS at CommissioningComplete command sent by TH2 - disabled: true - + nodeId: 0x43211234 + identity: "beta" + cluster: "General Commissioning" + command: "CommissioningComplete" + response: + values: + - name: "ErrorCode" + value: 0 # SUCCESS + + # verification: "DUT respond with SUCCESS at CommissioningComplete command sent by TH2" - label: - "Step 13: TH1 does a non-fabric-filtered read of the Fabrics attribute - from the Node Operational Credentials cluster. Save the FabricIndex - for TH2s entry as TH2_Fabric_Index for future use." + "Step 12: TH2 reads the Current Fabric Index attribute from the Node + Operational Credentials cluster. Save the FabricIndex for TH2 as + TH2_Fabric_Index." PICS: OPCREDS.S.A0001 - verification: | - Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index. - disabled: true - + identity: "beta" + nodeId: 0x43211234 + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "CurrentFabricIndex" + response: + saveAs: TH2_Fabric_Index + + # verification: "" - label: - "Step 14: TH2 does a non-fabric-filtered read of the Fabrics attribute + "Step 13: TH2 does a non-fabric-filtered read of the Fabrics attribute from the Node Operational Credentials cluster" PICS: OPCREDS.S.A0001 - verification: | - Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index. - disabled: true - + identity: "beta" + nodeId: 0x43211234 + command: "readAttribute" + cluster: "Operational Credentials" + attribute: "Fabrics" + fabricFiltered: false + response: + value: + [ + { "FabricIndex": TH1_Fabric_Index, "Label": "" }, + { "FabricIndex": TH2_Fabric_Index, "Label": "" }, + ] + constraints: + type: list + + # verification: "Verify that there are 2 entries in the list where one entry matches TH1_Fabric_Index and the other matches TH2_Fabric_Index." - label: - "Step 15: TH1 sends RemoveFabric command to DUT with the FabricIndex + "Step 14: TH1 sends RemoveFabric command to DUT with the FabricIndex field set to TH2_Fabric_Index." PICS: OPCREDS.S.C0a.Rsp - verification: | - Verify that DUT sends NOCResponse command with status code OK - disabled: true + identity: "alpha" + command: "RemoveFabric" + cluster: "Operational Credentials" + arguments: + values: + - name: "FabricIndex" + value: TH2_Fabric_Index + response: + values: + - name: "StatusCode" + value: 0 + # verification: "Verify that DUT sends NOCResponse command with status code OK" diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 91a6b7cf77efd5..12fc67440426e6 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -43,6 +43,7 @@ "DeviceManagement": [ "TestIcdManagementCluster", "Test_TC_OPCREDS_1_2", + "Test_TC_OPCREDS_3_7", "Test_TC_BINFO_1_1", "Test_TC_BINFO_2_1", "Test_TC_BINFO_2_2", From 35c8d924daf0f68f9d59ba492393367ef281e69d Mon Sep 17 00:00:00 2001 From: EricZijian_SiterWell Date: Sat, 2 Sep 2023 06:17:12 +0800 Subject: [PATCH 30/96] Change waitForReport to manual in TC-SMOKECO (#29009) * Change waitForReport to manual in TC-SMOKECO * Restyled by prettier-yaml --------- Co-authored-by: Hare Co-authored-by: Restyled.io --- .../certification/Test_TC_SMOKECO_2_2.yaml | 66 ++- .../certification/Test_TC_SMOKECO_2_3.yaml | 66 ++- .../certification/Test_TC_SMOKECO_2_4.yaml | 187 ++++--- .../certification/Test_TC_SMOKECO_2_5.yaml | 507 +++++++++++------- .../certification/Test_TC_SMOKECO_2_6.yaml | 222 +++++--- 5 files changed, 670 insertions(+), 378 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml index e14c009653513d..fbd307e0a0928a 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml @@ -101,14 +101,20 @@ tests: - label: "Step 6: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 7: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -181,14 +187,20 @@ tests: - label: "Step 15: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 16: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -226,14 +238,20 @@ tests: - label: "Step 19: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 20: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml index e4117df2fc67d1..9e6430731dce5d 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml @@ -100,14 +100,20 @@ tests: - label: "Step 6: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 7: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -180,14 +186,20 @@ tests: - label: "Step 15: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 16: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -225,14 +237,20 @@ tests: - label: "Step 19: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 20: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml index db40c617cbef1c..7333b55fd247b4 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml @@ -113,14 +113,20 @@ tests: - label: "Step 6: TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0003 - command: "waitForReport" - attribute: "BatteryAlert" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0003 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read battery-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 + [TOO] BatteryAlert: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 7: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -158,14 +164,20 @@ tests: - label: "Step 10: TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0003 - command: "waitForReport" - attribute: "BatteryAlert" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0003 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read battery-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 + [TOO] BatteryAlert: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 11: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -203,14 +215,20 @@ tests: - label: "Step 14: TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0003 - command: "waitForReport" - attribute: "BatteryAlert" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0003 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read battery-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 + [TOO] BatteryAlert: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 15: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -259,14 +277,20 @@ tests: - label: "Step 19: TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0006 - command: "waitForReport" - attribute: "HardwareFaultAlert" - timeout: 300 - response: - value: 1 - constraints: - type: boolean + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0006 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 + [TOO] HardwareFaultAlert: TRUE + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 20: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -305,14 +329,20 @@ tests: - label: "Step 23: TH waits for a report of HardwareFaultAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0006 - command: "waitForReport" - attribute: "HardwareFaultAlert" - timeout: 300 - response: - value: 0 - constraints: - type: boolean + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0006 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 + [TOO] HardwareFaultAlert: FALSE + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 24: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -361,14 +391,20 @@ tests: - label: "Step 28: TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0007 - command: "waitForReport" - attribute: "EndOfServiceAlert" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0007 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 + [TOO] EndOfServiceAlert: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 29: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -407,14 +443,20 @@ tests: - label: "Step 32: TH waits for a report of EndOfServiceAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0007 - command: "waitForReport" - attribute: "EndOfServiceAlert" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0007 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 + [TOO] EndOfServiceAlert: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 33: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -531,14 +573,22 @@ tests: - label: "Step 45: TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds" - PICS: SMOKECO.S.A0005 - command: "waitForReport" - attribute: "TestInProgress" - timeout: 180 - response: - value: 1 - constraints: - type: boolean + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0005 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read test-in-progress 1 1 + + This step needs to be completed quickly + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0005 DataVersion: 1795725838 + [TOO] TestInProgress: TRUE + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 46: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -549,8 +599,15 @@ tests: constraints: type: enum8 + - label: "Step 47a: TH subscribes to TestInProgress attribute from DUT" + PICS: SMOKECO.S.A0005 + command: "subscribeAttribute" + attribute: "TestInProgress" + minInterval: 1 + maxInterval: 900 + - label: - "Step 47: TH waits for a report of TestInProgress attribute from DUT + "Step 47b: TH waits for a report of TestInProgress attribute from DUT with a timeout of 180 seconds" PICS: SMOKECO.S.A0005 command: "waitForReport" diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml index 1556ab5b2f49b9..f44ce08ab77d82 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml @@ -148,16 +148,20 @@ tests: - label: "Step 6: TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0008 - command: "waitForReport" - attribute: "InterconnectSmokeAlarm" - timeout: 300 - response: - saveAs: interconnectSmokeAlarmSeverityLevel - constraints: - type: enum8 - minValue: 1 - maxValue: 2 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0008 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 + [TOO] InterconnectSmokeAlarm: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 7: TH reads InterconnectSmokeAlarm event from DUT" PICS: SMOKECO.S.A0008 && SMOKECO.S.E08 @@ -165,7 +169,7 @@ tests: event: "InterconnectSmokeAlarm" eventNumber: "LastReceivedEventNumber + 1" response: - value: { AlarmSeverityLevel: interconnectSmokeAlarmSeverityLevel } + value: { AlarmSeverityLevel: 1 } - label: "Step 8: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0008 && SMOKECO.S.A0000 @@ -196,14 +200,20 @@ tests: - label: "Step 10: TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0008 - command: "waitForReport" - attribute: "InterconnectSmokeAlarm" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0008 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 + [TOO] InterconnectSmokeAlarm: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 11: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0008 && SMOKECO.S.A0000 @@ -261,16 +271,20 @@ tests: - label: "Step 16: TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0009 - command: "waitForReport" - attribute: "InterconnectCOAlarm" - timeout: 300 - response: - saveAs: interconnectCOAlarmSeverityLevel - constraints: - type: enum8 - minValue: 1 - maxValue: 2 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0009 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 + [TOO] InterconnectCOAlarm: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 17: TH reads InterconnectCOAlarm event from DUT" PICS: SMOKECO.S.A0009 && SMOKECO.S.E09 @@ -278,7 +292,7 @@ tests: event: "InterconnectCOAlarm" eventNumber: "LastReceivedEventNumber + 1" response: - value: { AlarmSeverityLevel: interconnectCOAlarmSeverityLevel } + value: { AlarmSeverityLevel: 1 } - label: "Step 18: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0009 && SMOKECO.S.A0000 @@ -309,14 +323,20 @@ tests: - label: "Step 20: TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0009 - command: "waitForReport" - attribute: "InterconnectCOAlarm" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0009 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 + [TOO] InterconnectCOAlarm: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 21: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0009 && SMOKECO.S.A0000 @@ -366,15 +386,22 @@ tests: - label: "Step 25: TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000a - command: "waitForReport" - attribute: "ContaminationState" - timeout: 300 - response: - constraints: - type: enum8 - minValue: 2 - maxValue: 3 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000a + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read contamination-state 1 1 + + Verify that the value of ContaminationState is 2 or 3 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 + [TOO] ContaminationState: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 26: TH sends TestEventTrigger command to General Diagnostics @@ -396,14 +423,20 @@ tests: - label: "Step 27: TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000a - command: "waitForReport" - attribute: "ContaminationState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000a + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read contamination-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 + [TOO] ContaminationState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 28: TH sends TestEventTrigger command to General Diagnostics @@ -425,14 +458,20 @@ tests: - label: "Step 29: TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000a - command: "waitForReport" - attribute: "ContaminationState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000a + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read contamination-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 + [TOO] ContaminationState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 30: TH sends TestEventTrigger command to General Diagnostics @@ -454,14 +493,20 @@ tests: - label: "Step 31: TH waits for a report of ContaminationState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000a - command: "waitForReport" - attribute: "ContaminationState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000a + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read contamination-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 + [TOO] ContaminationState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 32: TH subscribes to SmokeSensitivityLevel attribute from DUT" @@ -495,14 +540,20 @@ tests: - label: "Step 34: TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000b - command: "waitForReport" - attribute: "SmokeSensitivityLevel" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000b + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 + [TOO] SmokeSensitivityLevel: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 35: TH sends TestEventTrigger command to General Diagnostics @@ -524,14 +575,20 @@ tests: - label: "Step 36: TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000b - command: "waitForReport" - attribute: "SmokeSensitivityLevel" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000b + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 + [TOO] SmokeSensitivityLevel: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 37: TH sends TestEventTrigger command to General Diagnostics @@ -553,14 +610,20 @@ tests: - label: "Step 38: TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000b - command: "waitForReport" - attribute: "SmokeSensitivityLevel" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000b + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 + [TOO] SmokeSensitivityLevel: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 39: TH sends TestEventTrigger command to General Diagnostics @@ -582,14 +645,20 @@ tests: - label: "Step 40: TH waits for a report of SmokeSensitivityLevel attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A000b - command: "waitForReport" - attribute: "SmokeSensitivityLevel" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A000b + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 + [TOO] SmokeSensitivityLevel: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 41: TH subscribes to DeviceMuted attribute from DUT" PICS: SMOKECO.S.A0004 @@ -641,14 +710,22 @@ tests: - label: "Step 45: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F00 && + SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 46a: TH subscribes to DeviceMuted attribute from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 @@ -676,14 +753,20 @@ tests: - label: "Step 47: TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 - command: "waitForReport" - attribute: "DeviceMuted" - timeout: 120 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F00 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read device-muted 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 + [TOO] DeviceMuted: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 48: TH reads AlarmMuted event from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E06 @@ -713,14 +796,20 @@ tests: - label: "Step 50: TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 - command: "waitForReport" - attribute: "DeviceMuted" - timeout: 120 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F00 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read device-muted 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 + [TOO] DeviceMuted: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 51: TH reads MuteEnded event from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.E07 @@ -756,14 +845,22 @@ tests: - label: "Step 53: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F00 && + SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 54: TH sends TestEventTrigger command to General Diagnostics @@ -825,14 +922,22 @@ tests: - label: "Step 57: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F00 && SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F00 && + SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 58: TH reads FeatureMap attribute(CO Alarm) from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 @@ -873,14 +978,22 @@ tests: - label: "Step 61: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F01 && + SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 62a: TH subscribes to DeviceMuted attribute from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 @@ -908,14 +1021,20 @@ tests: - label: "Step 63: TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 - command: "waitForReport" - attribute: "DeviceMuted" - timeout: 120 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F01 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read device-muted 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 + [TOO] DeviceMuted: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 64: TH reads AlarmMuted event from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E06 @@ -945,14 +1064,20 @@ tests: - label: "Step 66: TH waits for a report of DeviceMuted attribute from DUT with a timeout of 120 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 - command: "waitForReport" - attribute: "DeviceMuted" - timeout: 120 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F01 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read device-muted 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 + [TOO] DeviceMuted: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 67: TH reads MuteEnded event from DUT" PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.E07 @@ -988,14 +1113,22 @@ tests: - label: "Step 69: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 2 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F01 && + SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 2 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 70: TH sends TestEventTrigger command to General Diagnostics @@ -1057,11 +1190,19 @@ tests: - label: "Step 73: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0004 && SMOKECO.S.F01 && SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: + PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0004 && SMOKECO.S.F01 && + SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml index 870c8f5c850acb..f5106b7f316591 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml @@ -184,14 +184,20 @@ tests: - label: "Step 10: TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0003 - command: "waitForReport" - attribute: "BatteryAlert" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0003 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read battery-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 + [TOO] BatteryAlert: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 11a: TH subscribes to InterconnectSmokeAlarm attribute from DUT" @@ -221,15 +227,20 @@ tests: - label: "Step 12: TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0008 - command: "waitForReport" - attribute: "InterconnectSmokeAlarm" - timeout: 300 - response: - constraints: - type: enum8 - minValue: 1 - maxValue: 2 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0008 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 + [TOO] InterconnectSmokeAlarm: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 13a: TH subscribes to InterconnectCOAlarm attribute from DUT" PICS: SMOKECO.S.A0009 @@ -257,15 +268,20 @@ tests: - label: "Step 14: TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0009 - command: "waitForReport" - attribute: "InterconnectCOAlarm" - timeout: 300 - response: - constraints: - type: enum8 - minValue: 1 - maxValue: 2 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0009 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 + [TOO] InterconnectCOAlarm: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 15a: TH subscribes to COState attribute from DUT" PICS: SMOKECO.S.A0002 @@ -293,14 +309,20 @@ tests: - label: "Step 16: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 17a: TH subscribes to SmokeState attribute from DUT" PICS: SMOKECO.S.A0001 @@ -328,14 +350,20 @@ tests: - label: "Step 18: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 1 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 1 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 19: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -365,14 +393,20 @@ tests: - label: "Step 21: TH waits for a report of SmokeState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0001 - command: "waitForReport" - attribute: "SmokeState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0001 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read smoke-state 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 + [TOO] SmokeState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 22: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -409,14 +443,20 @@ tests: - label: "Step 24: TH waits for a report of COState attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0002 - command: "waitForReport" - attribute: "COState" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0002 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read costate 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 + [TOO] COState: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 25: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -454,14 +494,20 @@ tests: - label: "Step 27: TH waits for a report of InterconnectCOAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0009 - command: "waitForReport" - attribute: "InterconnectCOAlarm" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0009 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 + [TOO] InterconnectCOAlarm: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 28: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -500,14 +546,20 @@ tests: - label: "Step 30: TH waits for a report of InterconnectSmokeAlarm attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0008 - command: "waitForReport" - attribute: "InterconnectSmokeAlarm" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0008 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 + [TOO] InterconnectSmokeAlarm: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 31: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 @@ -544,14 +596,20 @@ tests: - label: "Step 33: TH waits for a report of BatteryAlert attribute from DUT with a timeout of 300 seconds" - PICS: SMOKECO.S.A0003 - command: "waitForReport" - attribute: "BatteryAlert" - timeout: 300 - response: - value: 0 - constraints: - type: enum8 + PICS: PICS_SKIP_SAMPLE_APP && SMOKECO.S.A0003 + cluster: "LogCommands" + command: "UserPrompt" + verification: | + ./chip-tool.py smokecoalarm read battery-alert 1 1 + + [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 + [TOO] BatteryAlert: 0 + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" - label: "Step 34: TH reads ExpressedState attribute from DUT" PICS: SMOKECO.S.A0000 From 29fd8dcddfffb3710d439f9ea5a8c5bc9775bd52 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Fri, 1 Sep 2023 18:49:06 -0400 Subject: [PATCH 31/96] Remove SED related common code as it is deprecated and replaced by ICD (#29023) --- .../silabs/SiWx917/SiWx917/sl_wifi_if.c | 4 +- examples/pump-app/silabs/src/AppTask.cpp | 2 +- examples/window-app/silabs/src/AppTask.cpp | 2 +- src/app/FailSafeContext.cpp | 8 - src/app/server/CommissioningWindowManager.cpp | 16 -- src/app/server/CommissioningWindowManager.h | 4 - src/include/platform/ConnectivityManager.h | 39 ---- src/include/platform/ThreadStackManager.h | 37 ---- .../GenericConnectivityManagerImpl_Thread.h | 27 --- src/messaging/ExchangeContext.cpp | 48 ----- src/messaging/ReliableMessageMgr.cpp | 7 - .../ReliableMessageProtocolConfig.cpp | 10 - src/platform/Linux/ThreadStackManagerImpl.cpp | 26 --- src/platform/Linux/ThreadStackManagerImpl.h | 5 - ...GenericThreadStackManagerImpl_OpenThread.h | 18 -- ...nericThreadStackManagerImpl_OpenThread.hpp | 185 +----------------- .../wifi/ConnectivityManagerImplWiFi.cpp | 20 -- .../wifi/ConnectivityManagerImplWiFi.h | 6 - src/platform/qpg/ThreadStackManagerImpl.cpp | 10 - src/platform/qpg/ThreadStackManagerImpl.h | 4 - src/platform/webos/ThreadStackManagerImpl.cpp | 26 --- src/platform/webos/ThreadStackManagerImpl.h | 6 - 22 files changed, 7 insertions(+), 503 deletions(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index f54175ae9733da..22032e33f4a928 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -191,7 +191,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t return SL_STATUS_OK; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED +#if SL_ICD_ENABLED /****************************************************************** * @fn wfx_rsi_power_save() * @brief @@ -221,7 +221,7 @@ int32_t wfx_rsi_power_save() SILABS_LOG("Powersave Config Success"); return status; } -#endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */ +#endif /* SL_ICD_ENABLED */ /************************************************************************************* * @fn static int32_t wfx_wifi_rsi_init(void) diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp index d870092d6527a4..b37d10852d0bd9 100644 --- a/examples/pump-app/silabs/src/AppTask.cpp +++ b/examples/pump-app/silabs/src/AppTask.cpp @@ -135,7 +135,7 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) sAppTask.StartStatusLEDTimer(); #endif diff --git a/examples/window-app/silabs/src/AppTask.cpp b/examples/window-app/silabs/src/AppTask.cpp index 9adf137a5ccc04..4765c48fa4d987 100644 --- a/examples/window-app/silabs/src/AppTask.cpp +++ b/examples/window-app/silabs/src/AppTask.cpp @@ -120,7 +120,7 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) sAppTask.StartStatusLEDTimer(); #endif diff --git a/src/app/FailSafeContext.cpp b/src/app/FailSafeContext.cpp index d79a36f14f045b..b11ad8775c84df 100644 --- a/src/app/FailSafeContext.cpp +++ b/src/app/FailSafeContext.cpp @@ -52,14 +52,6 @@ void FailSafeContext::HandleDisarmFailSafe(intptr_t arg) void FailSafeContext::SetFailSafeArmed(bool armed) { -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (IsFailSafeArmed() != armed) - { - // Per spec, we should be staying in active mode while a fail-safe is - // armed. - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(armed); - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #if CHIP_CONFIG_ENABLE_ICD_SERVER if (IsFailSafeArmed() != armed) { diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index cbc7c44e7fb6f8..270f4dad57cb39 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -98,14 +98,6 @@ void CommissioningWindowManager::ResetState() mECMIterations = 0; mECMSaltLength = 0; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (mSEDActiveModeEnabled) - { - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false); - mSEDActiveModeEnabled = false; - } -#endif - UpdateWindowStatus(CommissioningWindowStatusEnum::kWindowNotOpen); UpdateOpenerFabricIndex(NullNullable); @@ -245,14 +237,6 @@ CHIP_ERROR CommissioningWindowManager::AdvertiseAndListenForPASE() mPairingSession.Clear(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (!mSEDActiveModeEnabled) - { - mSEDActiveModeEnabled = true; - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(true); - } -#endif - ReturnErrorOnFailure(mServer->GetExchangeManager().RegisterUnsolicitedMessageHandlerForType( Protocols::SecureChannel::MsgType::PBKDFParamRequest, this)); mListeningForPASE = true; diff --git a/src/app/server/CommissioningWindowManager.h b/src/app/server/CommissioningWindowManager.h index fae3c075f5b518..df9b1dcd5e36c6 100644 --- a/src/app/server/CommissioningWindowManager.h +++ b/src/app/server/CommissioningWindowManager.h @@ -211,10 +211,6 @@ class CommissioningWindowManager : public Messaging::UnsolicitedMessageHandler, uint32_t mECMSaltLength = 0; uint8_t mECMSalt[kSpake2p_Max_PBKDF_Salt_Length]; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - bool mSEDActiveModeEnabled = false; -#endif - // For tests only, so that we can test the commissioning window timeout // without having to wait 3 minutes. Optional mMinCommissioningTimeoutOverride; diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 79eaa37423542a..cdacf50b663979 100755 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -204,28 +204,6 @@ class ConnectivityManager void ResetThreadNetworkDiagnosticsCounts(); CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, app::AttributeValueEncoder & encoder); -// Sleepy end device methods -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig); - - /** - * Sets Sleepy End Device intervals configuration and posts kSEDIntervalChange event to inform other software - * modules about the change. - * - * @param[in] intervalsConfig intervals configuration to be set - */ - CHIP_ERROR SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig); - - /** - * Requests setting Sleepy End Device active interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode - * consumers counter. Active mode is set if the consumers counter is bigger than 0. - * - * @param[in] onOff true if active mode should be enabled and false otherwise. - */ - CHIP_ERROR RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif - CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); // CHIPoBLE service methods @@ -470,23 +448,6 @@ inline CHIP_ERROR ConnectivityManager::SetThreadDeviceType(ThreadDeviceType devi return static_cast(this)->_SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ConnectivityManager::GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ConnectivityManager::SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ConnectivityManager::RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return static_cast(this)->_RequestSEDActiveMode(onOff, delayIdle); -} -#endif - inline CHIP_ERROR ConnectivityManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { #if CHIP_CONFIG_ENABLE_ICD_SERVER diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index 589d138ba77773..bfd8875551a84b 100755 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -163,26 +163,6 @@ class ThreadStackManager ConnectivityManager::ThreadDeviceType GetThreadDeviceType(); CHIP_ERROR SetThreadDeviceType(ConnectivityManager::ThreadDeviceType threadRole); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - - /** - * Sets Sleepy End Device intervals configuration and posts kICDPollingIntervalChange event to inform other software - * modules about the change. - * - * @param[in] intervalsConfig intervals configuration to be set - */ - CHIP_ERROR SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - - /** - * Requests setting Sleepy End Device active interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode - * consumers counter. Active mode is set if the consumers counter is bigger than 0. - * - * @param[in] onOff true if active mode should be enabled and false otherwise. - */ - CHIP_ERROR RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif @@ -393,23 +373,6 @@ inline CHIP_ERROR ThreadStackManager::SetThreadDeviceType(ConnectivityManager::T return static_cast(this)->_SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ThreadStackManager::GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ThreadStackManager::SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ThreadStackManager::RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return static_cast(this)->_RequestSEDActiveMode(onOff, delayIdle); -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER inline CHIP_ERROR ThreadStackManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h index 0f8b568d0393dd..a1d24c2e1c80d4 100755 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h @@ -63,11 +63,6 @@ class GenericConnectivityManagerImpl_Thread bool _IsThreadApplicationControlled(); ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */ @@ -144,28 +139,6 @@ GenericConnectivityManagerImpl_Thread::_SetThreadDeviceType(Connectiv return ThreadStackMgrImpl().SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -template -inline CHIP_ERROR -GenericConnectivityManagerImpl_Thread::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return ThreadStackMgrImpl().GetSEDIntervalsConfig(intervalsConfig); -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_SetSEDIntervalsConfig( - const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return ThreadStackMgrImpl().SetSEDIntervalsConfig(intervalsConfig); -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return ThreadStackMgrImpl().RequestSEDActiveMode(onOff, delayIdle); -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER template inline CHIP_ERROR diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index bb8fe2d993da32..9d1e7ca06fce23 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -91,45 +91,6 @@ void ExchangeContext::SetResponseTimeout(Timeout timeout) mResponseTimeout = timeout; } -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED -void ExchangeContext::UpdateSEDIntervalMode() -{ - if (!HasSessionHandle()) - { - // After the session has been deleted, no further communication can occur on the exchange, - // so withdraw a SED active mode request. - UpdateSEDIntervalMode(false); - return; - } - - Transport::PeerAddress address; - - switch (GetSessionHandle()->GetSessionType()) - { - case Transport::Session::SessionType::kSecure: - address = GetSessionHandle()->AsSecureSession()->GetPeerAddress(); - break; - case Transport::Session::SessionType::kUnauthenticated: - address = GetSessionHandle()->AsUnauthenticatedSession()->GetPeerAddress(); - break; - default: - return; - } - - VerifyOrReturn(address.GetTransportType() != Transport::Type::kBle); - UpdateSEDIntervalMode(IsResponseExpected() || IsSendExpected() || IsMessageNotAcked()); -} - -void ExchangeContext::UpdateSEDIntervalMode(bool activeMode) -{ - if (activeMode != IsRequestingActiveMode()) - { - SetRequestingActiveMode(activeMode); - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(activeMode, true); - } -} -#endif - CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgType, PacketBufferHandle && msgBuf, const SendFlags & sendFlags) { @@ -400,11 +361,6 @@ ExchangeContext::~ExchangeContext() // VerifyOrDie(mFlags.Has(Flags::kFlagClosed)); -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - // Make sure that the exchange withdraws the request for Sleepy End Device active mode. - UpdateSEDIntervalMode(false); -#endif - // Ideally, in this scenario, the retransmit table should // be clear of any outstanding messages for this context and // the boolean parameter passed to DoClose() should not matter. @@ -681,10 +637,6 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload void ExchangeContext::MessageHandled() { -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - UpdateSEDIntervalMode(); -#endif - if (mFlags.Has(Flags::kFlagClosed) || IsResponseExpected() || IsSendExpected()) { return; diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index b2aaacf633b9af..5dc397a39b9ad8 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -258,13 +258,6 @@ System::Clock::Timestamp ReliableMessageMgr::GetBackoff(System::Clock::Timestamp // "An ICD sender SHOULD increase t to also account for its own sleepy interval // required to receive the acknowledgment" mrpBackoffTime += app::ICDManager::GetFastPollingInterval(); -#elif CHIP_DEVICE_CONFIG_ENABLE_SED - DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervals; - - if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervals) == CHIP_NO_ERROR) - { - mrpBackoffTime += System::Clock::Timestamp(sedIntervals.ActiveIntervalMS); - } #endif mrpBackoffTime += CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST; diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index 795e02c3ce3679..9dfd0719293774 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -76,16 +76,6 @@ Optional GetLocalMRPConfig() config.mIdleRetransTimeout += app::ICDManager::GetSlowPollingInterval(); config.mActiveRetransTimeout += app::ICDManager::GetFastPollingInterval(); config.mActiveThresholdTime = System::Clock::Milliseconds16(IcdManagementServer::GetInstance().GetActiveModeThreshold()); -#elif CHIP_DEVICE_CONFIG_ENABLE_SED - DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; - - if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervalsConfig) == CHIP_NO_ERROR) - { - // Increase local MRP retry intervals by SED intervals. That is, intervals for - // which the device can be at sleep and not be able to receive any messages). - config.mIdleRetransTimeout += sedIntervalsConfig.IdleIntervalMS; - config.mActiveRetransTimeout += sedIntervalsConfig.ActiveIntervalMS; - } #endif #if CONFIG_BUILD_FOR_HOST_UNIT_TEST diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index f8cdcb2f453e44..a880490d85fb00 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -518,32 +518,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - (void) intervalsConfig; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - (void) intervalsConfig; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - (void) onOff; - (void) delayIdle; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR ThreadStackManagerImpl::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index b91d210f7c5028..5e077cba3bd1fe 100755 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -93,11 +93,6 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */ diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index b28058b5946d72..d8bf1b2b76a4a0 100755 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -100,13 +100,6 @@ class GenericThreadStackManagerImpl_OpenThread void _OnNetworkScanFinished(otActiveScanResult * aResult); void _UpdateNetworkStatus(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle); - CHIP_ERROR SEDUpdateMode(); - static void RequestSEDModeUpdate(chip::System::Layer * apSystemLayer, void * apAppState); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -166,13 +159,6 @@ class GenericThreadStackManagerImpl_OpenThread NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * mpConnectCallback; NetworkCommissioning::Internal::BaseDriver::NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDIntervalsConfig mIntervalsConfig; - ConnectivityManager::SEDIntervalMode mIntervalsMode = ConnectivityManager::SEDIntervalMode::Idle; - uint32_t mActiveModeConsumers = 0; - bool mDelayIdleTimerRunning = false; -#endif - #if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT struct SrpClient @@ -279,10 +265,6 @@ class GenericThreadStackManagerImpl_OpenThread static void OnJoinerComplete(otError aError, void * aContext); void OnJoinerComplete(otError aError); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType); -#endif - inline ImplClass * Impl() { return static_cast(this); } }; diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 4d2f461e61dd7f..4e89e6938520b4 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -376,7 +376,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(NetworkCommissioning::ThreadDriver::ScanCallback * callback) { CHIP_ERROR error = CHIP_NO_ERROR; -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER otLinkModeConfig linkMode; #endif // If there is another ongoing scan request, reject the new one. @@ -392,7 +392,7 @@ GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(NetworkCom SuccessOrExit(error = MapOpenThreadError(otIp6SetEnabled(mOTInst, true))); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER // Thread network discovery makes Sleepy End Devices detach from a network, so temporarily disable the SED mode. linkMode = otThreadGetLinkMode(mOTInst); @@ -430,7 +430,7 @@ void GenericThreadStackManagerImpl_OpenThread::_OnNetworkScanFinished { if (aResult == nullptr) // scan completed { -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER if (mTemporaryRxOnWhenIdle) { otLinkModeConfig linkMode = otThreadGetLinkMode(mOTInst); @@ -1702,19 +1702,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::DoInit(otInstanc mOTInst = otInst; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; - using namespace System::Clock::Literals; - sedIntervalsConfig.ActiveIntervalMS = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL; - sedIntervalsConfig.IdleIntervalMS = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL; - err = _SetSEDIntervalsConfig(sedIntervalsConfig); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "Failed to set sleepy end device intervals: %s", ErrorStr(err)); - } - SuccessOrExit(err); -#endif - // Arrange for OpenThread to call the OnOpenThreadStateChange method whenever a // state change occurs. Note that we reference the OnOpenThreadStateChange method // on the concrete implementation class so that that class can override the default @@ -1767,172 +1754,6 @@ bool GenericThreadStackManagerImpl_OpenThread::IsThreadInterfaceUpNoL return otIp6IsEnabled(mOTInst); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetSEDIntervalsConfig( - ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - intervalsConfig = mIntervalsConfig; - return CHIP_NO_ERROR; -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetSEDIntervalsConfig( - const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - using namespace System::Clock::Literals; - if ((intervalsConfig.IdleIntervalMS < intervalsConfig.ActiveIntervalMS) || (intervalsConfig.IdleIntervalMS == 0_ms32) || - (intervalsConfig.ActiveIntervalMS == 0_ms32)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - mIntervalsConfig = intervalsConfig; - - CHIP_ERROR err = SetSEDIntervalMode(mIntervalsMode); - - if (err == CHIP_NO_ERROR) - { - ChipDeviceEvent event; - event.Type = DeviceEventType::kICDPollingIntervalChange; - err = chip::DeviceLayer::PlatformMgr().PostEvent(&event); - } - - return err; -} - -template -CHIP_ERROR -GenericThreadStackManagerImpl_OpenThread::SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - System::Clock::Milliseconds32 interval; - - if (intervalType == ConnectivityManager::SEDIntervalMode::Idle) - { - interval = mIntervalsConfig.IdleIntervalMS; - } - else if (intervalType == ConnectivityManager::SEDIntervalMode::Active) - { - interval = mIntervalsConfig.ActiveIntervalMS; - } - else - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - Impl()->LockThreadStack(); - - mIntervalsMode = intervalType; - -// For Thread devices, the intervals are defined as: -// * poll period for SED devices that poll the parent for data -// * CSL period for SSED devices that listen for messages in scheduled time slots. -#if CHIP_DEVICE_CONFIG_THREAD_SSED - // Get CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. - uint32_t curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; -#else - uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst); -#endif - otError otErr = OT_ERROR_NONE; - if (interval.count() != curIntervalMS) - { -#if CHIP_DEVICE_CONFIG_THREAD_SSED - // Set CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. - otErr = otLinkCslSetPeriod(mOTInst, interval.count() * 1000 / OT_US_PER_TEN_SYMBOLS); - curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; -#else - otErr = otLinkSetPollPeriod(mOTInst, interval.count()); - curIntervalMS = otLinkGetPollPeriod(mOTInst); -#endif - err = MapOpenThreadError(otErr); - } - - Impl()->UnlockThreadStack(); - - if (otErr != OT_ERROR_NONE) - { - ChipLogError(DeviceLayer, "Failed to set SED interval to %" PRId32 "ms. Defaulting to %" PRId32 "ms", interval.count(), - curIntervalMS); - } - else - { - ChipLogProgress(DeviceLayer, "OpenThread SED interval is %" PRId32 "ms", curIntervalMS); - } - - return err; -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - if (onOff) - { - mActiveModeConsumers++; - } - else - { - if (mActiveModeConsumers > 0) - mActiveModeConsumers--; - } - - if (!onOff && delayIdle && CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD.count() != 0) - { - // StartTimer will cancel a timer if the same callback & context is used. - // This will have the effect of canceling the previous one (if any) and starting - // a new timer of the same duration. This effectively prolongs the active threshold - // without consuming additional resources. - err = DeviceLayer::SystemLayer().StartTimer(CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD, RequestSEDModeUpdate, this); - if (CHIP_NO_ERROR == err) - { - if (!mDelayIdleTimerRunning) - { - mDelayIdleTimerRunning = true; - mActiveModeConsumers++; - } - return err; - } - - ChipLogError(DeviceLayer, "Failed to postpone Idle Mode with error %" CHIP_ERROR_FORMAT, err.Format()); - } - - return SEDUpdateMode(); -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::SEDUpdateMode() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - ConnectivityManager::SEDIntervalMode mode; - - mode = mActiveModeConsumers > 0 ? ConnectivityManager::SEDIntervalMode::Active : ConnectivityManager::SEDIntervalMode::Idle; - - if (mIntervalsMode != mode) - err = SetSEDIntervalMode(mode); - - return err; -} - -template -void GenericThreadStackManagerImpl_OpenThread::RequestSEDModeUpdate(chip::System::Layer * apSystemLayer, - void * apAppState) -{ - if (apAppState != nullptr) - { - GenericThreadStackManagerImpl_OpenThread * obj = static_cast(apAppState); - if (obj->mActiveModeConsumers > 0) - { - obj->mActiveModeConsumers--; - } - - obj->mDelayIdleTimerRunning = false; - - obj->SEDUpdateMode(); - } -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER template CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) diff --git a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp index 93559822ef6d82..b3bdede0f2f852 100644 --- a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp +++ b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp @@ -123,26 +123,6 @@ CHIP_ERROR ConnectivityManagerImplWiFi::_GetAndLogWiFiStatsCounters(void) return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ConnectivityManagerImplWiFi::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & SEDIntervalsConfig) -{ - // For now Wi-Fi uses legacy power save mode that has fixed inactivity interval - SEDIntervalsConfig.ActiveIntervalMS = - chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs); - SEDIntervalsConfig.IdleIntervalMS = - chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs); - return CHIP_NO_ERROR; -} -CHIP_ERROR ConnectivityManagerImplWiFi::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} -CHIP_ERROR ConnectivityManagerImplWiFi::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} -#endif - ConnectivityManager::WiFiAPMode ConnectivityManagerImplWiFi::_GetWiFiAPMode(void) { /* AP mode is unsupported */ diff --git a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h index 407bb2044ed77c..dfa6a05f0b7ae4 100644 --- a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h +++ b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h @@ -55,12 +55,6 @@ class ConnectivityManagerImplWiFi void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif - // Wi-Fi access point - not supported ConnectivityManager::WiFiAPMode _GetWiFiAPMode(void); CHIP_ERROR _SetWiFiAPMode(ConnectivityManager::WiFiAPMode val); diff --git a/src/platform/qpg/ThreadStackManagerImpl.cpp b/src/platform/qpg/ThreadStackManagerImpl.cpp index cb6fd0e2ec1289..01abdc679f970c 100644 --- a/src/platform/qpg/ThreadStackManagerImpl.cpp +++ b/src/platform/qpg/ThreadStackManagerImpl.cpp @@ -113,13 +113,3 @@ extern "C" void otPlatFree(void * aPtr) { CHIPPlatformMemoryFree(aPtr); } - -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDFastPollingMode(bool onOff) -{ - (void) onOff; - - ChipLogError(DeviceLayer, "Polling config is not supported on this platform"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif diff --git a/src/platform/qpg/ThreadStackManagerImpl.h b/src/platform/qpg/ThreadStackManagerImpl.h index fe39291e77edb3..9896ea6e57128e 100644 --- a/src/platform/qpg/ThreadStackManagerImpl.h +++ b/src/platform/qpg/ThreadStackManagerImpl.h @@ -74,10 +74,6 @@ class ThreadStackManagerImpl final : public ThreadStackManager, using ThreadStackManager::InitThreadStack; CHIP_ERROR InitThreadStack(otInstance * otInst); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); -#endif - private: // ===== Methods that implement the ThreadStackManager abstract interface. diff --git a/src/platform/webos/ThreadStackManagerImpl.cpp b/src/platform/webos/ThreadStackManagerImpl.cpp index b6e4bd9e9a853e..6acb542d78a3c1 100644 --- a/src/platform/webos/ThreadStackManagerImpl.cpp +++ b/src/platform/webos/ThreadStackManagerImpl.cpp @@ -481,32 +481,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) -{ - (void) pollingConfig; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig) -{ - (void) pollingConfig; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDFastPollingMode(bool onOff) -{ - (void) onOff; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif - bool ThreadStackManagerImpl::_HaveMeshConnectivity() { // TODO: Remove Weave legacy APIs diff --git a/src/platform/webos/ThreadStackManagerImpl.h b/src/platform/webos/ThreadStackManagerImpl.h index b70910878c08d0..330e601f75a7fd 100644 --- a/src/platform/webos/ThreadStackManagerImpl.h +++ b/src/platform/webos/ThreadStackManagerImpl.h @@ -86,12 +86,6 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); -#endif - bool _HaveMeshConnectivity(); CHIP_ERROR _GetAndLogThreadStatsCounters(); From fae28ee2b8501b69d752f9defe3d49697cb2dd2e Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Fri, 1 Sep 2023 19:08:56 -0400 Subject: [PATCH 32/96] fix RVC Mode clusters' TC 3-2: add precondition check (#29016) * fix TC 3-2 * fix lint issues * use 'not' instead of 'is False' --- src/python_testing/TC_RVCCLEANM_3_2.py | 30 ++++++++++++++++++++++++++ src/python_testing/TC_RVCRUNM_3_2.py | 30 ++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/python_testing/TC_RVCCLEANM_3_2.py b/src/python_testing/TC_RVCCLEANM_3_2.py index 7f29c8807262b9..0ac29273c20b7d 100644 --- a/src/python_testing/TC_RVCCLEANM_3_2.py +++ b/src/python_testing/TC_RVCCLEANM_3_2.py @@ -45,6 +45,30 @@ async def write_start_up_mode(self, newMode): ret = await self.default_controller.WriteAttribute(self.dut_node_id, [(self.endpoint, Clusters.RvcCleanMode.Attributes.StartUpMode(newMode))]) asserts.assert_equal(ret[0].Status, Status.Success, "Writing to StartUpMode failed") + async def check_preconditions(self, endpoint): + # check whether the StartUpMode will be overridden by the OnMode attribute + + if not self.check_pics("RVCCLEANM.S.F00"): + return True + + logging.info("RVCCLEANM.S.F00: 1") + + cluster = Clusters.Objects.OnOff + attr = Clusters.OnOff.Attributes.StartUpOnOff + startUpOnOff = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attr) + logging.info("StartUpOnOff: %s" % (startUpOnOff)) + if startUpOnOff == NullValue or startUpOnOff == 0: + return True + + cluster = Clusters.Objects.RvcCleanMode + attr = Clusters.RvcCleanMode.Attributes.OnMode + onMode = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attr) + logging.info("OnMode: %s" % (onMode)) + if onMode == NullValue: + return True + + return False + @async_test_body async def test_TC_RVCCLEANM_3_2(self): @@ -60,6 +84,12 @@ async def test_TC_RVCCLEANM_3_2(self): asserts.assert_true(self.check_pics("RVCCLEANM.S.C00.Rsp"), "RVCCLEANM.S.C00.Rsp must be supported") asserts.assert_true(self.check_pics("RVCCLEANM.S.C01.Tx"), "RVCCLEANM.S.C01.Tx must be supported") + depOnOffKey = "RVCCLEANM.S.F00" + asserts.assert_true(depOnOffKey in self.matter_test_config.pics, "%s must be provided" % (depOnOffKey)) + + ret = await self.check_preconditions(self.endpoint) + asserts.assert_true(ret, "invalid preconditions - StartUpMode overridden by OnMode") + attributes = Clusters.RvcCleanMode.Attributes from enum import Enum diff --git a/src/python_testing/TC_RVCRUNM_3_2.py b/src/python_testing/TC_RVCRUNM_3_2.py index 683395ef1db72a..09d99f4864b15f 100644 --- a/src/python_testing/TC_RVCRUNM_3_2.py +++ b/src/python_testing/TC_RVCRUNM_3_2.py @@ -45,6 +45,30 @@ async def write_start_up_mode(self, newMode): ret = await self.default_controller.WriteAttribute(self.dut_node_id, [(self.endpoint, Clusters.RvcRunMode.Attributes.StartUpMode(newMode))]) asserts.assert_equal(ret[0].Status, Status.Success, "Writing to StartUpMode failed") + async def check_preconditions(self, endpoint): + # check whether the StartUpMode will be overridden by the OnMode attribute + + if not self.check_pics("RVCRUNM.S.F00"): + return True + + logging.info("RVCRUNM.S.F00: 1") + + cluster = Clusters.Objects.OnOff + attr = Clusters.OnOff.Attributes.StartUpOnOff + startUpOnOff = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attr) + logging.info("StartUpOnOff: %s" % (startUpOnOff)) + if startUpOnOff == NullValue or startUpOnOff == 0: + return True + + cluster = Clusters.Objects.RvcRunMode + attr = Clusters.RvcRunMode.Attributes.OnMode + onMode = await self.read_single_attribute_check_success(endpoint=endpoint, cluster=cluster, attribute=attr) + logging.info("OnMode: %s" % (onMode)) + if onMode == NullValue: + return True + + return False + @async_test_body async def test_TC_RVCRUNM_3_2(self): @@ -60,6 +84,12 @@ async def test_TC_RVCRUNM_3_2(self): asserts.assert_true(self.check_pics("RVCRUNM.S.C00.Rsp"), "RVCRUNM.S.C00.Rsp must be supported") asserts.assert_true(self.check_pics("RVCRUNM.S.C01.Tx"), "RVCRUNM.S.C01.Tx must be supported") + depOnOffKey = "RVCRUNM.S.F00" + asserts.assert_true(depOnOffKey in self.matter_test_config.pics, "%s must be provided" % (depOnOffKey)) + + ret = await self.check_preconditions(self.endpoint) + asserts.assert_true(ret, "invalid preconditions - StartUpMode overridden by OnMode") + attributes = Clusters.RvcRunMode.Attributes from enum import Enum From 29d3302d972b62175a99c8c4f3217e0cce822218 Mon Sep 17 00:00:00 2001 From: William Date: Sat, 2 Sep 2023 00:10:07 +0100 Subject: [PATCH 33/96] Adds the AirQuality server logic to the embedded target applications (#29008) * Added the AirQuality server logic to the ameba, asr, cc13x2x7_26x2x7, cc13x4_26x4, infineon, mbed, nrfconnect, nxp, openiotsdk, telink and tizen target applications. * Restyled by gn --------- Co-authored-by: Restyled.io --- examples/all-clusters-app/ameba/chip_main.cmake | 3 ++- examples/all-clusters-app/asr/BUILD.gn | 1 + examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn | 1 + examples/all-clusters-app/cc13x4_26x4/BUILD.gn | 1 + examples/all-clusters-app/infineon/psoc6/BUILD.gn | 1 + examples/all-clusters-app/mbed/CMakeLists.txt | 1 + examples/all-clusters-app/nrfconnect/CMakeLists.txt | 1 + examples/all-clusters-app/nxp/mw320/BUILD.gn | 1 + examples/all-clusters-app/openiotsdk/CMakeLists.txt | 1 + examples/all-clusters-app/telink/CMakeLists.txt | 1 + examples/all-clusters-app/tizen/BUILD.gn | 1 + 11 files changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index d635c806c42375..3a3d2429f6e5bd 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -154,7 +154,8 @@ list( APPEND ${list_chip_main_sources} ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp - ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp + ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-delegates.cpp ${chip_dir}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp diff --git a/examples/all-clusters-app/asr/BUILD.gn b/examples/all-clusters-app/asr/BUILD.gn index e023a48cb3643e..89c9607b53448d 100755 --- a/examples/all-clusters-app/asr/BUILD.gn +++ b/examples/all-clusters-app/asr/BUILD.gn @@ -71,6 +71,7 @@ asr_executable("clusters_app") { output_name = "chip-asr-clusters-example.out" sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn index 5c166468dffea2..6c991abac181a1 100644 --- a/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn +++ b/examples/all-clusters-app/cc13x2x7_26x2x7/BUILD.gn @@ -75,6 +75,7 @@ ti_simplelink_executable("all-clusters-app") { output_name = "chip-${ti_simplelink_board}-all-clusters-example.out" sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", diff --git a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn index ff5f7815168486..97ca8d972051a4 100644 --- a/examples/all-clusters-app/cc13x4_26x4/BUILD.gn +++ b/examples/all-clusters-app/cc13x4_26x4/BUILD.gn @@ -75,6 +75,7 @@ ti_simplelink_executable("all-clusters-app") { output_name = "chip-${ti_simplelink_board}-all-clusters-example.out" sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", diff --git a/examples/all-clusters-app/infineon/psoc6/BUILD.gn b/examples/all-clusters-app/infineon/psoc6/BUILD.gn index aa0acaf2bee415..d61814767374d2 100644 --- a/examples/all-clusters-app/infineon/psoc6/BUILD.gn +++ b/examples/all-clusters-app/infineon/psoc6/BUILD.gn @@ -107,6 +107,7 @@ psoc6_executable("clusters_app") { output_name = "chip-psoc6-clusters-example.out" sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", diff --git a/examples/all-clusters-app/mbed/CMakeLists.txt b/examples/all-clusters-app/mbed/CMakeLists.txt index b784bc0c32e163..486901342dbb08 100644 --- a/examples/all-clusters-app/mbed/CMakeLists.txt +++ b/examples/all-clusters-app/mbed/CMakeLists.txt @@ -60,6 +60,7 @@ target_sources(${APP_TARGET} PRIVATE ${MBED_COMMON}/util/LEDWidget.cpp ${MBED_COMMON}/util/DFUManager.cpp ${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp + ${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp diff --git a/examples/all-clusters-app/nrfconnect/CMakeLists.txt b/examples/all-clusters-app/nrfconnect/CMakeLists.txt index 69521548530d47..03515f36ae24b6 100644 --- a/examples/all-clusters-app/nrfconnect/CMakeLists.txt +++ b/examples/all-clusters-app/nrfconnect/CMakeLists.txt @@ -63,6 +63,7 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp ${NRFCONNECT_COMMON}/util/LEDWidget.cpp) diff --git a/examples/all-clusters-app/nxp/mw320/BUILD.gn b/examples/all-clusters-app/nxp/mw320/BUILD.gn index 2a227860192d7c..f7f415961a7481 100644 --- a/examples/all-clusters-app/nxp/mw320/BUILD.gn +++ b/examples/all-clusters-app/nxp/mw320/BUILD.gn @@ -74,6 +74,7 @@ mw320_executable("shell_mw320") { "${chip_root}/examples/all-clusters-app/nxp/mw320/include", ] sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/fan-stub.cpp", diff --git a/examples/all-clusters-app/openiotsdk/CMakeLists.txt b/examples/all-clusters-app/openiotsdk/CMakeLists.txt index ea02c19c076ad0..6b2e7cc87b3157 100644 --- a/examples/all-clusters-app/openiotsdk/CMakeLists.txt +++ b/examples/all-clusters-app/openiotsdk/CMakeLists.txt @@ -54,6 +54,7 @@ target_sources(${APP_TARGET} main/main_ns.cpp ${ALL_CLUSTERS_COMMON}/src/smco-stub.cpp ${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp + ${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp ${ALL_CLUSTERS_COMMON}/src/resource-monitoring-delegates.cpp diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index 25b0d1ec279e5b..aacc82ddc06b25 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -76,6 +76,7 @@ target_sources(app PRIVATE ${ALL_CLUSTERS_COMMON_DIR}/src/static-supported-temperature-levels.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp + ${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp ${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp diff --git a/examples/all-clusters-app/tizen/BUILD.gn b/examples/all-clusters-app/tizen/BUILD.gn index e755bcaef060ea..1f40d96500c012 100644 --- a/examples/all-clusters-app/tizen/BUILD.gn +++ b/examples/all-clusters-app/tizen/BUILD.gn @@ -23,6 +23,7 @@ assert(chip_build_tools) source_set("chip-all-clusters-common") { sources = [ + "${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp", From 1ed389725756a7a5e6ce4c2e79e6458c7d89d2f6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 1 Sep 2023 19:13:48 -0400 Subject: [PATCH 34/96] Fix signatures of string-attribute getters in Accessors.h/cpp. (#29024) The old signature did not propagate the update length of the span to the caller. Fixes https://github.com/project-chip/connectedhomeip/issues/28357 --- scripts/setup/zap.json | 4 +- scripts/setup/zap.version | 2 +- scripts/tools/zap/zap_execution.py | 2 +- .../zap-generated/attributes/Accessors.cpp | 68 +++++++++---------- .../zap-generated/attributes/Accessors.h | 68 +++++++++---------- 5 files changed, 72 insertions(+), 72 deletions(-) diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index c27f4df51ab556..d763e123ff712b 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.08.30-nightly.1"] + "tags": ["version:2@v2023.09.01-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.08.30-nightly.1"] + "tags": ["version:2@v2023.09.01-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 1cedd0fcbd5c11..5af16d0daf37f9 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.08.30-nightly +v2023.09.01-nightly diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 4e69557eb99486..5dbff86656cd17 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.8.30' +MIN_ZAP_VERSION = '2023.9.1' class ZapTool: diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 3c6c262fcdec57..878ef63131deb0 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -1556,7 +1556,7 @@ namespace Attributes { namespace ActiveText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); @@ -1587,7 +1587,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); @@ -1618,7 +1618,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace InactiveText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); @@ -2175,7 +2175,7 @@ namespace Attributes { namespace SetupURL { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[512 + 2]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, zclString, sizeof(zclString)); @@ -2274,7 +2274,7 @@ namespace Attributes { namespace NodeLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, zclString, sizeof(zclString)); @@ -2686,7 +2686,7 @@ namespace Attributes { namespace ActiveLocale { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[35 + 1]; EmberAfStatus status = @@ -3145,7 +3145,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[60 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); @@ -3742,7 +3742,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace BatReplacementDescription { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[60 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); @@ -3804,7 +3804,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::PowerSource::B namespace BatANSIDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[20 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); @@ -3835,7 +3835,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace BatIECDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[20 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::PowerSource::Id, Id, zclString, sizeof(zclString)); @@ -5275,7 +5275,7 @@ namespace Attributes { namespace VendorName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -5339,7 +5339,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) namespace ProductName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -5372,7 +5372,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace NodeLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -5436,7 +5436,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace HardwareVersionString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[64 + 1]; EmberAfStatus status = @@ -5500,7 +5500,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) namespace SoftwareVersionString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[64 + 1]; EmberAfStatus status = @@ -5533,7 +5533,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace ManufacturingDate { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = @@ -5566,7 +5566,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace PartNumber { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -5599,7 +5599,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace ProductURL { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[256 + 2]; EmberAfStatus status = @@ -5632,7 +5632,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace ProductLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[64 + 1]; EmberAfStatus status = @@ -5665,7 +5665,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace SerialNumber { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -5729,7 +5729,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace UniqueID { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = @@ -6702,7 +6702,7 @@ namespace Attributes { namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[64 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ModeSelect::Id, Id, zclString, sizeof(zclString)); @@ -9512,7 +9512,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace Language { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[3 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::DoorLock::Id, Id, zclString, sizeof(zclString)); @@ -15260,7 +15260,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace CompensationText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[254 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ColorControl::Id, Id, zclString, sizeof(zclString)); @@ -17288,7 +17288,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace LampType { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); @@ -17319,7 +17319,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace LampManufacturer { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[16 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::BallastConfiguration::Id, Id, zclString, sizeof(zclString)); @@ -20315,7 +20315,7 @@ namespace Attributes { namespace MACAddress { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::WakeOnLan::Id, Id, zclString, sizeof(zclString)); @@ -21424,7 +21424,7 @@ namespace Attributes { namespace VendorName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); @@ -21486,7 +21486,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value) namespace ApplicationName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); @@ -21579,7 +21579,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBas namespace ApplicationVersion { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[32 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::ApplicationBasic::Id, Id, zclString, sizeof(zclString)); @@ -26557,7 +26557,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, double value) namespace OctetString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) { uint8_t zclString[10 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString)); @@ -26588,7 +26588,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) namespace LongOctetString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value) { uint8_t zclString[1000 + 2]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString)); @@ -26619,7 +26619,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value) namespace CharString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[10 + 1]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString)); @@ -26650,7 +26650,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value) namespace LongCharString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value) { uint8_t zclString[1000 + 2]; EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::UnitTesting::Id, Id, zclString, sizeof(zclString)); 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 244a3ad9023876..f23f87366c526f 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 @@ -303,17 +303,17 @@ namespace BinaryInputBasic { namespace Attributes { namespace ActiveText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ActiveText namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace Description namespace InactiveText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace InactiveText @@ -428,7 +428,7 @@ namespace Actions { namespace Attributes { namespace SetupURL { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // long_char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace SetupURL @@ -449,7 +449,7 @@ namespace BasicInformation { namespace Attributes { namespace NodeLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace NodeLabel @@ -530,7 +530,7 @@ namespace LocalizationConfiguration { namespace Attributes { namespace ActiveLocale { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ActiveLocale @@ -626,7 +626,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace Order namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace Description @@ -715,7 +715,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace BatPresent namespace BatReplacementDescription { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace BatReplacementDescription @@ -726,12 +726,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::PowerSource::B } // namespace BatCommonDesignation namespace BatANSIDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace BatANSIDesignation namespace BatIECDesignation { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace BatIECDesignation @@ -1012,7 +1012,7 @@ namespace BridgedDeviceBasicInformation { namespace Attributes { namespace VendorName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace VendorName @@ -1022,12 +1022,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value); } // namespace VendorID namespace ProductName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ProductName namespace NodeLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace NodeLabel @@ -1037,7 +1037,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace HardwareVersion namespace HardwareVersionString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace HardwareVersionString @@ -1047,32 +1047,32 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); } // namespace SoftwareVersion namespace SoftwareVersionString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace SoftwareVersionString namespace ManufacturingDate { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ManufacturingDate namespace PartNumber { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace PartNumber namespace ProductURL { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // long_char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ProductURL namespace ProductLabel { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ProductLabel namespace SerialNumber { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace SerialNumber @@ -1082,7 +1082,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Reachable namespace UniqueID { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace UniqueID @@ -1299,7 +1299,7 @@ namespace ModeSelect { namespace Attributes { namespace Description { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace Description @@ -1829,7 +1829,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace NumberOfCredentialsSupportedPerUser namespace Language { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace Language @@ -2743,7 +2743,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace DriftCompensation namespace CompensationText { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace CompensationText @@ -3055,12 +3055,12 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); } // namespace LampQuantity namespace LampType { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LampType namespace LampManufacturer { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LampManufacturer @@ -3598,7 +3598,7 @@ namespace WakeOnLan { namespace Attributes { namespace MACAddress { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace MACAddress @@ -3821,7 +3821,7 @@ namespace ApplicationBasic { namespace Attributes { namespace VendorName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace VendorName @@ -3831,7 +3831,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::VendorId value); } // namespace VendorID namespace ApplicationName { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ApplicationName @@ -3847,7 +3847,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::ApplicationBas } // namespace Status namespace ApplicationVersion { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace ApplicationVersion @@ -4669,22 +4669,22 @@ EmberAfStatus Set(chip::EndpointId endpoint, double value); } // namespace FloatDouble namespace OctetString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // octet_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // octet_string EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); } // namespace OctetString namespace LongOctetString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan value); // long_octet_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableByteSpan & value); // long_octet_string EmberAfStatus Set(chip::EndpointId endpoint, chip::ByteSpan value); } // namespace LongOctetString namespace CharString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace CharString namespace LongCharString { -EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan value); // long_char_string +EmberAfStatus Get(chip::EndpointId endpoint, chip::MutableCharSpan & value); // long_char_string EmberAfStatus Set(chip::EndpointId endpoint, chip::CharSpan value); } // namespace LongCharString From 5ccb774e7e5fe7ead3ff85bec1cda31a459c9c37 Mon Sep 17 00:00:00 2001 From: Serhii Salamakha Date: Sat, 2 Sep 2023 02:55:08 +0300 Subject: [PATCH 35/96] [Telink] Turn off the CHIP_FACTORY_RESET_ERASE_NVS by Default (#28947) --- config/telink/chip-module/Kconfig | 2 +- .../telink/common/src/AppTaskCommon.cpp | 60 ++++++++----------- 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/config/telink/chip-module/Kconfig b/config/telink/chip-module/Kconfig index fcd205102f22aa..325eb4172f198c 100644 --- a/config/telink/chip-module/Kconfig +++ b/config/telink/chip-module/Kconfig @@ -147,7 +147,7 @@ endif #CHIP_FACTORY_DATA_BUILD # See config/zephyr/Kconfig for full definition config CHIP_FACTORY_RESET_ERASE_NVS bool - default y + default n config CHIP_LOG_SIZE_OPTIMIZATION bool "Disable some detailed logs to decrease flash usage" diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index a64e2c7d5bf2e2..3a831ea0ef8fce 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -39,10 +39,8 @@ #include #endif -#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS #include #include -#endif using namespace chip::app; @@ -103,10 +101,11 @@ Button sThreadStartButton; k_timer sFactoryResetTimer; uint8_t sFactoryResetCntr = 0; -bool sIsThreadProvisioned = false; -bool sIsThreadEnabled = false; -bool sIsThreadAttached = false; -bool sHaveBLEConnections = false; +bool sIsCommissioningFailed = false; +bool sIsThreadProvisioned = false; +bool sIsThreadEnabled = false; +bool sIsThreadAttached = false; +bool sHaveBLEConnections = false; #if APP_SET_DEVICE_INFO_PROVIDER chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; @@ -138,9 +137,10 @@ class AppCallbacks : public AppDelegate bool isComissioningStarted; public: - void OnCommissioningSessionEstablishmentStarted() {} + void OnCommissioningSessionEstablishmentStarted() override { sIsCommissioningFailed = false; } void OnCommissioningSessionStarted() override { isComissioningStarted = true; } void OnCommissioningSessionStopped() override { isComissioningStarted = false; } + void OnCommissioningSessionEstablishmentError(CHIP_ERROR err) override { sIsCommissioningFailed = true; } void OnCommissioningWindowClosed() override { if (!isComissioningStarted) @@ -157,44 +157,33 @@ class AppFabricTableDelegate : public FabricTable::Delegate { if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) { - bool isBasicCommissioningMode = chip::Server::GetInstance().GetCommissioningWindowManager().GetCommissioningMode() == - Dnssd::CommissioningMode::kEnabledBasic; ChipLogProgress(DeviceLayer, "Performing erasing of settings partition"); -#ifdef CONFIG_CHIP_FACTORY_RESET_ERASE_NVS - void * storage = nullptr; - int status = settings_storage_get(&storage); - - if (status == 0) + // Do FactoryReset in case of failed commissioning to allow new pairing via BLE + if (sIsCommissioningFailed) { - status = nvs_clear(static_cast(storage)); + chip::Server::GetInstance().ScheduleFactoryReset(); } - - if (!isBasicCommissioningMode) + // TC-OPCREDS-3.6 (device doesn't need to reboot automatically after the last fabric is removed) can't use FactoryReset + else { + void * storage = nullptr; + int status = settings_storage_get(&storage); + if (!status) { - status = nvs_mount(static_cast(storage)); + status = nvs_clear(static_cast(storage)); } - } - - if (status) - { - ChipLogError(DeviceLayer, "Storage clearance failed: %d", status); - } -#else - const CHIP_ERROR err = PersistedStorage::KeyValueStoreMgrImpl().DoFactoryReset(); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "Factory reset failed: %" CHIP_ERROR_FORMAT, err.Format()); - } + if (!status) + { + status = nvs_mount(static_cast(storage)); + } - ConnectivityMgr().ErasePersistentInfo(); -#endif - if (isBasicCommissioningMode) - { - PlatformMgr().Shutdown(); + if (status) + { + ChipLogError(DeviceLayer, "Storage clearance failed: %d", status); + } } } } @@ -202,6 +191,7 @@ class AppFabricTableDelegate : public FabricTable::Delegate class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate { + // Disable openthread before reset to prevent writing to NVS void OnShutDown() override { if (ThreadStackManagerImpl().IsThreadEnabled()) From fbce0e2a1fd89cf48e2bbc8b631acb1da73774a7 Mon Sep 17 00:00:00 2001 From: Rohan Sahay Date: Sat, 2 Sep 2023 09:25:11 +0530 Subject: [PATCH 36/96] [Silabs] Adds WiseConnect 3 SDK 3.0.13 support (#28915) * Adds support for WiSeConnect 3 SDK v3.0.13 * Update(s) SDK support for WiseConnect 3 SDK 3.0.12+ * Adds support for WiseConnect 3.0.12 * Adds changes for WiseConnect 3.0.13 changes * Adds NVIC API changes * ports NVIC API in SDK support * Adds fix for NVIC snippet * revert .vscode changes * Restyled by gn * Updates SDK support --------- Co-authored-by: Restyled.io --- examples/platform/silabs/FreeRTOSConfig.h | 5 +++++ src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp | 4 ++++ third_party/silabs/SiWx917_sdk.gni | 2 ++ third_party/silabs/matter_support | 2 +- third_party/silabs/wifi_sdk | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index e8ec24ed72a905..3f438778276244 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -181,7 +181,12 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ #define configKERNEL_INTERRUPT_PRIORITY (255) /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#ifdef SIWX_917 +#define configMAX_SYSCALL_INTERRUPT_PRIORITY 20 +#else #define configMAX_SYSCALL_INTERRUPT_PRIORITY 48 +#endif // SIWX_917 + #define configENABLE_FPU 0 #define configENABLE_MPU 0 /* FreeRTOS Secure Side Only and TrustZone Security Extension */ diff --git a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp index 000597e5231d90..a9cb0c0f5f540e 100644 --- a/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp +++ b/src/platform/silabs/platformAbstraction/WiseMcuSpam.cpp @@ -26,6 +26,7 @@ // TODO add includes ? extern "C" { +#include "em_core.h" #include "sl_event_handler.h" void RSI_Board_LED_Set(int, bool); @@ -56,6 +57,9 @@ CHIP_ERROR SilabsPlatform::Init(void) sl_system_init(); + // TODO: Setting the highest priority for SVCall_IRQn to avoid the HardFault issue + NVIC_SetPriority(SVCall_IRQn, CORE_INTERRUPT_HIGHEST_PRIORITY); + // Configuration the clock rate soc_pll_config(); diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 9b973b083521e9..a3164a636bef0d 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -49,6 +49,7 @@ template("siwx917_sdk") { "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/hal", "${efr32_sdk_root}/platform/emdrv/nvm3/inc", "${efr32_sdk_root}/platform/emdrv/common/inc", + "${efr32_sdk_root}/platform/service/device_init/inc", "${sdk_support_root}/matter/mbedtls/tinycrypt/inc", "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/autogen", "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/config", @@ -350,6 +351,7 @@ template("siwx917_sdk") { "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c", "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_lock.c", "${efr32_sdk_root}/platform/emlib/src/em_core.c", + "${efr32_sdk_root}/platform/service/device_init/src/sl_device_init_nvic.c", "${efr32_sdk_root}/platform/service/system/src/sl_system_init.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/croutine.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/event_groups.c", diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index a7f35beb8e8601..130270901b4d37 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit a7f35beb8e8601b1686e4aa90f90060571bb9dc2 +Subproject commit 130270901b4d377950a47b1ceddde300d9eea981 diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index 0a9db52aa98a2f..0f0cdcdc249b8d 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit 0a9db52aa98a2f9c56ef1160281f9daf5d50079f +Subproject commit 0f0cdcdc249b8de03cb57b5095b290125f42030c From aac1a77de185e6f73ad83f351fa18ec52a4951e8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 2 Sep 2023 01:57:20 -0400 Subject: [PATCH 37/96] Actually fix the XML cluster revision for color control. (#29032) https://github.com/project-chip/connectedhomeip/pull/28763 updated a bunch of ZAP files, and claimed it was fixing XML, but didn't fix the XML. --- .../zap-templates/zcl/data-model/chip/color-control-cluster.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml index 99040f85a16982..a51b68479f576b 100644 --- a/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/color-control-cluster.xml @@ -105,7 +105,7 @@ limitations under the License. true true - + CurrentHue From 2df2dd3f94bf3e9a87b3cff3707aa9412e3c2216 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Sat, 2 Sep 2023 02:42:40 -0400 Subject: [PATCH 38/96] Actually fix the XML cluster revision for descriptor. (#29034) https://github.com/project-chip/connectedhomeip/pull/28753 updated some ZAP files but didn't fix the XML. --- .../zap-templates/zcl/data-model/chip/descriptor-cluster.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml index 8ef8ba9279e646..3d41b09fcf6991 100644 --- a/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/descriptor-cluster.xml @@ -42,6 +42,9 @@ limitations under the License. 0x001d DESCRIPTOR_CLUSTER The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. + + + DeviceTypeList ServerList ClientList From 88d636658066441d1750217db4013abee78bfd3d Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Sat, 2 Sep 2023 15:42:19 +0530 Subject: [PATCH 39/96] [ESP32] Skip the WiFi interface initialization if already done (#29017) * [ESP32] Skip the WiFi interface initialization if already done * Define the default wifi netif keys --- .../ESP32/ConnectivityManagerImpl_WiFi.cpp | 23 +++++++++++-------- src/platform/ESP32/ESP32Utils.cpp | 23 +++++++++++++------ src/platform/ESP32/ESP32Utils.h | 3 +++ src/platform/ESP32/WiFiDnssdImpl.cpp | 10 ++++---- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp index 27ecfbcfd74bc5..e52319b55bb365 100644 --- a/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp +++ b/src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp @@ -526,7 +526,8 @@ void ConnectivityManagerImpl::OnWiFiPlatformEvent(const ChipDeviceEvent * event) break; case IP_EVENT_GOT_IP6: ChipLogProgress(DeviceLayer, "IP_EVENT_GOT_IP6"); - if (strcmp(esp_netif_get_ifkey(event->Platform.ESPSystemEvent.Data.IpGotIp6.esp_netif), "WIFI_STA_DEF") == 0) + if (strcmp(esp_netif_get_ifkey(event->Platform.ESPSystemEvent.Data.IpGotIp6.esp_netif), + ESP32Utils::kDefaultWiFiStationNetifKey) == 0) { OnStationIPv6AddressAvailable(event->Platform.ESPSystemEvent.Data.IpGotIp6); } @@ -670,10 +671,11 @@ void ConnectivityManagerImpl::DriveStationState() void ConnectivityManagerImpl::OnStationConnected() { // Assign an IPv6 link local address to the station interface. - esp_err_t err = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); + esp_err_t err = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey(ESP32Utils::kDefaultWiFiStationNetifKey)); if (err != ESP_OK) { - ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for WIFI_STA_DEF interface: %s", esp_err_to_name(err)); + ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for %s interface, err:%s", + ESP32Utils::kDefaultWiFiStationNetifKey, esp_err_to_name(err)); } NetworkCommissioning::ESPWiFiDriver::GetInstance().OnConnectWiFiNetwork(); // TODO Invoke WARM to perform actions that occur when the WiFi station interface comes up. @@ -907,14 +909,14 @@ void ConnectivityManagerImpl::DriveAPState() // If AP is active, but the interface doesn't have an IPv6 link-local // address, assign one now. - if (mWiFiAPState == kWiFiAPState_Active && Internal::ESP32Utils::IsInterfaceUp("WIFI_AP_DEF") && - !Internal::ESP32Utils::HasIPv6LinkLocalAddress("WIFI_AP_DEF")) + if (mWiFiAPState == kWiFiAPState_Active && ESP32Utils::IsInterfaceUp(ESP32Utils::kDefaultWiFiAPNetifKey) && + !ESP32Utils::HasIPv6LinkLocalAddress(ESP32Utils::kDefaultWiFiAPNetifKey)) { - esp_err_t error = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey("WIFI_AP_DEF")); + esp_err_t error = esp_netif_create_ip6_linklocal(esp_netif_get_handle_from_ifkey(ESP32Utils::kDefaultWiFiAPNetifKey)); if (error != ESP_OK) { - ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for WIFI_AP_DEF interface: %s", - esp_err_to_name(error)); + ChipLogError(DeviceLayer, "esp_netif_create_ip6_linklocal() failed for %s interface, err:%s", + ESP32Utils::kDefaultWiFiAPNetifKey, esp_err_to_name(error)); goto exit; } } @@ -1002,7 +1004,8 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void) haveIPv4Conn = true; esp_netif_ip_info_t ipInfo; - if (esp_netif_get_ip_info(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"), &ipInfo) == ESP_OK) + if (esp_netif_get_ip_info(esp_netif_get_handle_from_ifkey(ESP32Utils::kDefaultWiFiStationNetifKey), &ipInfo) == + ESP_OK) { char addrStr[INET_ADDRSTRLEN]; // ToDo: change the code to using IPv6 address @@ -1105,7 +1108,7 @@ void ConnectivityManagerImpl::OnStationIPv6AddressAvailable(const ip_event_got_i event.InterfaceIpAddressChanged.Type = InterfaceIpChangeType::kIpV6_Assigned; PlatformMgr().PostEventOrDie(&event); #if CONFIG_ENABLE_ROUTE_HOOK - esp_route_hook_init(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF")); + esp_route_hook_init(esp_netif_get_handle_from_ifkey(ESP32Utils::kDefaultWiFiStationNetifKey)); #endif } diff --git a/src/platform/ESP32/ESP32Utils.cpp b/src/platform/ESP32/ESP32Utils.cpp index 4a03d08282dcda..bfa06b176949ee 100644 --- a/src/platform/ESP32/ESP32Utils.cpp +++ b/src/platform/ESP32/ESP32Utils.cpp @@ -223,7 +223,7 @@ const char * ESP32Utils::WiFiModeToStr(wifi_mode_t wifiMode) struct netif * ESP32Utils::GetStationNetif(void) { - return GetNetif("WIFI_STA_DEF"); + return GetNetif(kDefaultWiFiStationNetifKey); } CHIP_ERROR ESP32Utils::GetWiFiStationProvision(Internal::DeviceNetworkInfo & netInfo, bool includeCredentials) @@ -321,16 +321,25 @@ CHIP_ERROR ESP32Utils::InitWiFiStack(void) } #if CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP - if (!esp_netif_create_default_wifi_ap()) + // Lets not create a default AP interface if already present + if (!esp_netif_get_handle_from_ifkey(kDefaultWiFiAPNetifKey)) { - ChipLogError(DeviceLayer, "Failed to create the WiFi AP netif"); - return CHIP_ERROR_INTERNAL; + if (!esp_netif_create_default_wifi_ap()) + { + ChipLogError(DeviceLayer, "Failed to create the WiFi AP netif"); + return CHIP_ERROR_INTERNAL; + } } #endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP - if (!esp_netif_create_default_wifi_sta()) + + // Lets not create a default station interface if already present + if (!esp_netif_get_handle_from_ifkey(kDefaultWiFiStationNetifKey)) { - ChipLogError(DeviceLayer, "Failed to create the WiFi STA netif"); - return CHIP_ERROR_INTERNAL; + if (!esp_netif_create_default_wifi_sta()) + { + ChipLogError(DeviceLayer, "Failed to create the WiFi STA netif"); + return CHIP_ERROR_INTERNAL; + } } // Initialize the ESP WiFi layer. diff --git a/src/platform/ESP32/ESP32Utils.h b/src/platform/ESP32/ESP32Utils.h index c1d714ada787d4..1c052eee6f64b8 100644 --- a/src/platform/ESP32/ESP32Utils.h +++ b/src/platform/ESP32/ESP32Utils.h @@ -51,6 +51,9 @@ class ESP32Utils static CHIP_ERROR MapError(esp_err_t error); static void RegisterESP32ErrorFormatter(); static bool FormatError(char * buf, uint16_t bufSize, CHIP_ERROR err); + + static constexpr char kDefaultWiFiStationNetifKey[] = "WIFI_STA_DEF"; + static constexpr char kDefaultWiFiAPNetifKey[] = "WIFI_AP_DEF"; }; #define ReturnMappedErrorOnFailure(expr) \ diff --git a/src/platform/ESP32/WiFiDnssdImpl.cpp b/src/platform/ESP32/WiFiDnssdImpl.cpp index 44f641f75e6bb6..14139083e09a13 100644 --- a/src/platform/ESP32/WiFiDnssdImpl.cpp +++ b/src/platform/ESP32/WiFiDnssdImpl.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace { @@ -332,9 +333,8 @@ static CHIP_ERROR OnBrowseDone(BrowseContext * ctx) if (ctx->mInterfaceId == chip::Inet::InterfaceId::Null()) { // If the InterfaceId in the context is Null, we will use the Station netif by default. - struct netif * lwip_netif = - reinterpret_cast(esp_netif_get_netif_impl(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); - ctx->mService[servicesIndex].mInterface = chip::Inet::InterfaceId(lwip_netif); + ctx->mService[servicesIndex].mInterface = + Inet::InterfaceId(DeviceLayer::Internal::ESP32Utils::GetStationNetif()); } else { @@ -419,9 +419,7 @@ static CHIP_ERROR ParseSrvResult(ResolveContext * ctx) if (ctx->mInterfaceId == chip::Inet::InterfaceId::Null()) { // If the InterfaceId in the context is Null, we will use the Station netif by default. - struct netif * lwip_netif = - reinterpret_cast(esp_netif_get_netif_impl(esp_netif_get_handle_from_ifkey("WIFI_STA_DEF"))); - ctx->mService->mInterface = chip::Inet::InterfaceId(lwip_netif); + ctx->mService->mInterface = Inet::InterfaceId(DeviceLayer::Internal::ESP32Utils::GetStationNetif()); } else { From 54038c0db7349cb54461dbb59418674d747123cf Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Sun, 3 Sep 2023 20:45:54 -0700 Subject: [PATCH 40/96] update convertTlvTag function description (#29035) --- src/lib/support/jsontlv/JsonToTlv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/support/jsontlv/JsonToTlv.h b/src/lib/support/jsontlv/JsonToTlv.h index 54d7fb84188d01..287f0d7279f645 100644 --- a/src/lib/support/jsontlv/JsonToTlv.h +++ b/src/lib/support/jsontlv/JsonToTlv.h @@ -33,8 +33,8 @@ CHIP_ERROR JsonToTlv(const std::string & jsonString, MutableByteSpan & tlv); CHIP_ERROR JsonToTlv(const std::string & jsonString, TLV::TLVWriter & writer); /* - * Convert a uint64_t tagNumber to a TLV tag. When tagNumber is less than UINT8_MAX, - * the tag is encoded using ContextTag. When tagNumber is less than UINT32_MAX, + * Convert a uint64_t tagNumber to a TLV tag. When tagNumber is less than or equal to UINT8_MAX, + * the tag is encoded using ContextTag. When tagNumber is larger than UINT8_MAX and less than or equal to UINT32_MAX, * the tag is encoded using an implicit profile tag. */ CHIP_ERROR ConvertTlvTag(const uint64_t tagNumber, TLV::Tag & tag); From eb019b0f150cf31becb6252709c389c4ae297190 Mon Sep 17 00:00:00 2001 From: Robert Szewczyk Date: Mon, 4 Sep 2023 18:42:19 -0700 Subject: [PATCH 41/96] Aligned chip-types.xml with the latest Matter spec (#28978) * Aligned chip-types.xml with the latest Matter spec * reordered the XML to use the same order as the spec; this should make maintenance a bit more sane * renumbered types to avoid duplication and conflicts and to align with the spec Fixes #28976 * Regen ZAP * Reflect the type changes in the Python codegen per code review comment * Add XSD validation for unique IDs * Add a unique constraint on the `id` element in `` sequence * Add chip-types.xml to the validator script --- .../matter_idl/generators/types.py | 8 ++- .../zcl/data-model/chip/chip-types.xml | 66 ++++++++++++------- src/app/zap-templates/zcl/validate.sh | 1 + src/app/zap-templates/zcl/zcl.xsd | 6 ++ .../app-common/zap-generated/attribute-size.h | 13 ++-- .../app-common/zap-generated/attribute-type.h | 47 +++++++------ 6 files changed, 87 insertions(+), 54 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/generators/types.py b/scripts/py_matter_idl/matter_idl/generators/types.py index a22275bf29bb0f..c5428a92ff6636 100644 --- a/scripts/py_matter_idl/matter_idl/generators/types.py +++ b/scripts/py_matter_idl/matter_idl/generators/types.py @@ -196,23 +196,27 @@ def is_struct(self) -> bool: "data_ver": BasicInteger(idl_name="data_ver", byte_count=4, is_signed=False), "date": BasicInteger(idl_name="date", byte_count=4, is_signed=False), "devtype_id": BasicInteger(idl_name="devtype_id", byte_count=4, is_signed=False), + "elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False), "endpoint_no": BasicInteger(idl_name="endpoint_no", byte_count=2, is_signed=False), + "entry_idx": BasicInteger(idl_name="entry_idx", byte_count=2, is_signed=False), "epoch_s": BasicInteger(idl_name="epoch_s", byte_count=4, is_signed=False), "epoch_us": BasicInteger(idl_name="epoch_us", byte_count=8, is_signed=False), - "elapsed_s": BasicInteger(idl_name="elapsed_s", byte_count=4, is_signed=False), "event_id": BasicInteger(idl_name="event_id", byte_count=4, is_signed=False), "event_no": BasicInteger(idl_name="event_no", byte_count=8, is_signed=False), "fabric_id": BasicInteger(idl_name="fabric_id", byte_count=8, is_signed=False), "fabric_idx": BasicInteger(idl_name="fabric_idx", byte_count=1, is_signed=False), "field_id": BasicInteger(idl_name="field_id", byte_count=4, is_signed=False), "group_id": BasicInteger(idl_name="group_id", byte_count=2, is_signed=False), + "namespace": BasicInteger(idl_name="namespace", byte_count=1, is_signed=False), "node_id": BasicInteger(idl_name="node_id", byte_count=8, is_signed=False), "percent": BasicInteger(idl_name="percent", byte_count=1, is_signed=False), "percent100ths": BasicInteger(idl_name="percent100ths", byte_count=2, is_signed=False), "posix_ms": BasicInteger(idl_name="posix_ms", byte_count=8, is_signed=False), + "priority": BasicInteger(idl_name="priority", byte_count=1, is_signed=False), "status": BasicInteger(idl_name="status", byte_count=2, is_signed=False), - "systime_us": BasicInteger(idl_name="systime_us", byte_count=8, is_signed=False), "systime_ms": BasicInteger(idl_name="systime_ms", byte_count=8, is_signed=False), + "systime_us": BasicInteger(idl_name="systime_us", byte_count=8, is_signed=False), + "tag": BasicInteger(idl_name="tag", byte_count=1, is_signed=False), "temperature": BasicInteger(idl_name="temperature", byte_count=2, is_signed=True), "tod": BasicInteger(idl_name="tod", byte_count=4, is_signed=False), "trans_id": BasicInteger(idl_name="trans_id", byte_count=4, is_signed=False), diff --git a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml index 2e8f2bf400fae2..0756fd85569f6c 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chip-types.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chip-types.xml @@ -46,8 +46,6 @@ limitations under the License. - - @@ -57,39 +55,57 @@ limitations under the License. + + + + - - + + + - - - + + + + + + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/validate.sh b/src/app/zap-templates/zcl/validate.sh index 1ae73fea1084de..22fe1009eb6a2b 100755 --- a/src/app/zap-templates/zcl/validate.sh +++ b/src/app/zap-templates/zcl/validate.sh @@ -1,2 +1,3 @@ #!/bin/bash xmllint --noout --schema zcl.xsd data-model/chip/matter-devices.xml +xmllint --noout --schema zcl.xsd data-model/chip/chip-types.xml diff --git a/src/app/zap-templates/zcl/zcl.xsd b/src/app/zap-templates/zcl/zcl.xsd index 1a880304f27305..a00a9e48cb87c7 100644 --- a/src/app/zap-templates/zcl/zcl.xsd +++ b/src/app/zap-templates/zcl/zcl.xsd @@ -221,6 +221,10 @@ This schema describes the format of the XML files, that describe the ZCL specifi + + + + @@ -233,6 +237,8 @@ This schema describes the format of the XML files, that describe the ZCL specifi + + diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-size.h b/zzz_generated/app-common/app-common/zap-generated/attribute-size.h index 8abca661608b0b..f4e3e5cac680b3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-size.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-size.h @@ -27,12 +27,13 @@ ZCL_BOOLEAN_ATTRIBUTE_TYPE, 1, ZCL_BITMAP8_ATTRIBUTE_TYPE, 1, ZCL_BITMAP16_ATTRI ZCL_INT56U_ATTRIBUTE_TYPE, 7, ZCL_INT64U_ATTRIBUTE_TYPE, 8, ZCL_INT8S_ATTRIBUTE_TYPE, 1, ZCL_INT16S_ATTRIBUTE_TYPE, 2, ZCL_INT24S_ATTRIBUTE_TYPE, 3, ZCL_INT32S_ATTRIBUTE_TYPE, 4, ZCL_INT40S_ATTRIBUTE_TYPE, 5, ZCL_INT48S_ATTRIBUTE_TYPE, 6, ZCL_INT56S_ATTRIBUTE_TYPE, 7, ZCL_INT64S_ATTRIBUTE_TYPE, 8, ZCL_ENUM8_ATTRIBUTE_TYPE, 1, ZCL_ENUM16_ATTRIBUTE_TYPE, 2, - ZCL_SINGLE_ATTRIBUTE_TYPE, 4, ZCL_DOUBLE_ATTRIBUTE_TYPE, 8, ZCL_POSIX_MS_ATTRIBUTE_TYPE, 8, ZCL_SYSTIME_MS_ATTRIBUTE_TYPE, 8, + ZCL_PRIORITY_ATTRIBUTE_TYPE, 1, ZCL_STATUS_ATTRIBUTE_TYPE, 1, ZCL_SINGLE_ATTRIBUTE_TYPE, 4, ZCL_DOUBLE_ATTRIBUTE_TYPE, 8, + ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE, 2, ZCL_VENDOR_ID_ATTRIBUTE_TYPE, 2, + ZCL_DEVTYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8, ZCL_FABRIC_IDX_ATTRIBUTE_TYPE, 1, + ZCL_ENTRY_IDX_ATTRIBUTE_TYPE, 2, ZCL_DATA_VER_ATTRIBUTE_TYPE, 4, ZCL_EVENT_NO_ATTRIBUTE_TYPE, 8, ZCL_SEMTAG_ATTRIBUTE_TYPE, 4, + ZCL_NAMESPACE_ATTRIBUTE_TYPE, 1, ZCL_TAG_ATTRIBUTE_TYPE, 1, ZCL_SYSTIME_US_ATTRIBUTE_TYPE, 8, ZCL_SYSTIME_MS_ATTRIBUTE_TYPE, 8, ZCL_ELAPSED_S_ATTRIBUTE_TYPE, 4, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, 2, ZCL_TOD_ATTRIBUTE_TYPE, 4, ZCL_DATE_ATTRIBUTE_TYPE, 4, - ZCL_EPOCH_US_ATTRIBUTE_TYPE, 8, ZCL_EPOCH_S_ATTRIBUTE_TYPE, 4, ZCL_SYSTIME_US_ATTRIBUTE_TYPE, 8, ZCL_PERCENT_ATTRIBUTE_TYPE, 1, + ZCL_EPOCH_US_ATTRIBUTE_TYPE, 8, ZCL_EPOCH_S_ATTRIBUTE_TYPE, 4, ZCL_POSIX_MS_ATTRIBUTE_TYPE, 8, ZCL_PERCENT_ATTRIBUTE_TYPE, 1, ZCL_PERCENT100THS_ATTRIBUTE_TYPE, 2, ZCL_CLUSTER_ID_ATTRIBUTE_TYPE, 4, ZCL_ATTRIB_ID_ATTRIBUTE_TYPE, 4, ZCL_FIELD_ID_ATTRIBUTE_TYPE, 4, ZCL_EVENT_ID_ATTRIBUTE_TYPE, 4, ZCL_COMMAND_ID_ATTRIBUTE_TYPE, 4, ZCL_ACTION_ID_ATTRIBUTE_TYPE, - 1, ZCL_TRANS_ID_ATTRIBUTE_TYPE, 4, ZCL_NODE_ID_ATTRIBUTE_TYPE, 8, ZCL_VENDOR_ID_ATTRIBUTE_TYPE, 2, - ZCL_DEVTYPE_ID_ATTRIBUTE_TYPE, 4, ZCL_FABRIC_ID_ATTRIBUTE_TYPE, 8, ZCL_GROUP_ID_ATTRIBUTE_TYPE, 2, ZCL_STATUS_ATTRIBUTE_TYPE, 1, - ZCL_DATA_VER_ATTRIBUTE_TYPE, 4, ZCL_EVENT_NO_ATTRIBUTE_TYPE, 8, ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE, 2, - ZCL_FABRIC_IDX_ATTRIBUTE_TYPE, 1, ZCL_IPV4ADR_ATTRIBUTE_TYPE, 4, ZCL_IPV6ADR_ATTRIBUTE_TYPE, 16, + 1, ZCL_TRANS_ID_ATTRIBUTE_TYPE, 4, ZCL_NODE_ID_ATTRIBUTE_TYPE, 8, ZCL_IPV4ADR_ATTRIBUTE_TYPE, 4, ZCL_IPV6ADR_ATTRIBUTE_TYPE, 16, diff --git a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h index 721aba2706f5dc..e79d1281b33a8c 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attribute-type.h +++ b/zzz_generated/app-common/app-common/zap-generated/attribute-type.h @@ -48,6 +48,8 @@ enum ZCL_INT64S_ATTRIBUTE_TYPE = 0x2F, // Signed 64-bit integer ZCL_ENUM8_ATTRIBUTE_TYPE = 0x30, // 8-bit enumeration ZCL_ENUM16_ATTRIBUTE_TYPE = 0x31, // 16-bit enumeration + ZCL_PRIORITY_ATTRIBUTE_TYPE = 0x32, // Priority + ZCL_STATUS_ATTRIBUTE_TYPE = 0x33, // Status Code ZCL_SINGLE_ATTRIBUTE_TYPE = 0x39, // Single precision ZCL_DOUBLE_ATTRIBUTE_TYPE = 0x3A, // Double precision ZCL_OCTET_STRING_ATTRIBUTE_TYPE = 0x41, // Octet String @@ -56,38 +58,41 @@ enum ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE = 0x44, // Long Character String ZCL_ARRAY_ATTRIBUTE_TYPE = 0x48, // List ZCL_STRUCT_ATTRIBUTE_TYPE = 0x4C, // Structure - ZCL_POSIX_MS_ATTRIBUTE_TYPE = 0xD0, // Posix Time Milliseconds + ZCL_GROUP_ID_ATTRIBUTE_TYPE = 0xC0, // Group ID + ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE = 0xC1, // Endpoint Number + ZCL_VENDOR_ID_ATTRIBUTE_TYPE = 0xC2, // Vendor ID + ZCL_DEVTYPE_ID_ATTRIBUTE_TYPE = 0xC3, // Device Type ID + ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xC4, // Fabric ID + ZCL_FABRIC_IDX_ATTRIBUTE_TYPE = 0xC5, // Fabric Index + ZCL_ENTRY_IDX_ATTRIBUTE_TYPE = 0xC6, // Entry Index + ZCL_DATA_VER_ATTRIBUTE_TYPE = 0xC7, // Data Version + ZCL_EVENT_NO_ATTRIBUTE_TYPE = 0xC8, // Event Number + ZCL_SEMTAG_ATTRIBUTE_TYPE = 0xC9, // Semantic Tag + ZCL_NAMESPACE_ATTRIBUTE_TYPE = 0xCA, // Namespace + ZCL_TAG_ATTRIBUTE_TYPE = 0xCB, // Tag + ZCL_SYSTIME_US_ATTRIBUTE_TYPE = 0xD0, // System Time Microseconds ZCL_SYSTIME_MS_ATTRIBUTE_TYPE = 0xD1, // System Time Milliseconds ZCL_ELAPSED_S_ATTRIBUTE_TYPE = 0xD2, // Elapsed Time Seconds - ZCL_TEMPERATURE_ATTRIBUTE_TYPE = 0xDB, // Temperature + ZCL_TEMPERATURE_ATTRIBUTE_TYPE = 0xD8, // Temperature ZCL_TOD_ATTRIBUTE_TYPE = 0xE0, // Time of day ZCL_DATE_ATTRIBUTE_TYPE = 0xE1, // Date ZCL_EPOCH_US_ATTRIBUTE_TYPE = 0xE3, // Epoch Microseconds ZCL_EPOCH_S_ATTRIBUTE_TYPE = 0xE4, // Epoch Seconds - ZCL_SYSTIME_US_ATTRIBUTE_TYPE = 0xE5, // System Time Microseconds + ZCL_POSIX_MS_ATTRIBUTE_TYPE = 0xE5, // Posix Time Milliseconds ZCL_PERCENT_ATTRIBUTE_TYPE = 0xE6, // Percentage units 1% ZCL_PERCENT100THS_ATTRIBUTE_TYPE = 0xE7, // Percentage units 0.01% ZCL_CLUSTER_ID_ATTRIBUTE_TYPE = 0xE8, // Cluster ID ZCL_ATTRIB_ID_ATTRIBUTE_TYPE = 0xE9, // Attribute ID - ZCL_FIELD_ID_ATTRIBUTE_TYPE = 0xEA, // Field ID - ZCL_EVENT_ID_ATTRIBUTE_TYPE = 0xEB, // Event ID - ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xEC, // Command ID - ZCL_ACTION_ID_ATTRIBUTE_TYPE = 0xED, // Action ID + ZCL_FIELD_ID_ATTRIBUTE_TYPE = 0xEB, // Field ID + ZCL_EVENT_ID_ATTRIBUTE_TYPE = 0xEC, // Event ID + ZCL_COMMAND_ID_ATTRIBUTE_TYPE = 0xED, // Command ID + ZCL_ACTION_ID_ATTRIBUTE_TYPE = 0xEE, // Action ID ZCL_TRANS_ID_ATTRIBUTE_TYPE = 0xEF, // Transaction ID ZCL_NODE_ID_ATTRIBUTE_TYPE = 0xF0, // Node ID - ZCL_VENDOR_ID_ATTRIBUTE_TYPE = 0xF1, // Vendor ID - ZCL_DEVTYPE_ID_ATTRIBUTE_TYPE = 0xF2, // Device Type ID - ZCL_FABRIC_ID_ATTRIBUTE_TYPE = 0xF3, // Fabric ID - ZCL_GROUP_ID_ATTRIBUTE_TYPE = 0xF4, // Group ID - ZCL_STATUS_ATTRIBUTE_TYPE = 0xF5, // Status Code - ZCL_DATA_VER_ATTRIBUTE_TYPE = 0xF6, // Data Version - ZCL_EVENT_NO_ATTRIBUTE_TYPE = 0xF7, // Event Number - ZCL_ENDPOINT_NO_ATTRIBUTE_TYPE = 0xF8, // Endpoint Number - ZCL_FABRIC_IDX_ATTRIBUTE_TYPE = 0xF9, // Fabric Index - ZCL_IPADR_ATTRIBUTE_TYPE = 0xFA, // IP Address - ZCL_IPV4ADR_ATTRIBUTE_TYPE = 0xFB, // IPv4 Address - ZCL_IPV6ADR_ATTRIBUTE_TYPE = 0xFC, // IPv6 Address - ZCL_IPV6PRE_ATTRIBUTE_TYPE = 0xFD, // IPv6 Prefix - ZCL_HWADR_ATTRIBUTE_TYPE = 0xFE, // Hardware Address + ZCL_IPADR_ATTRIBUTE_TYPE = 0xF2, // IP Address + ZCL_IPV4ADR_ATTRIBUTE_TYPE = 0xF3, // IPv4 Address + ZCL_IPV6ADR_ATTRIBUTE_TYPE = 0xF4, // IPv6 Address + ZCL_IPV6PRE_ATTRIBUTE_TYPE = 0xF5, // IPv6 Prefix + ZCL_HWADR_ATTRIBUTE_TYPE = 0xF6, // Hardware Address ZCL_UNKNOWN_ATTRIBUTE_TYPE = 0xFF, // Unknown }; From 6521b0db74241ac9d3c72763f2b75898ee45592c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 08:34:49 -0400 Subject: [PATCH 42/96] Re-enable tsan YAML tests on Linux and Mac. (#28990) --- .github/workflows/tests.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2571c6410d4432..15057ec27b2b4d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -198,8 +198,6 @@ jobs: " - name: Run Tests using the python parser sending commands to chip-tool - # https://github.com/project-chip/connectedhomeip/issues/27673 - if: matrix.build_variant != 'no-ble-tsan-clang' run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ @@ -274,8 +272,7 @@ jobs: strategy: matrix: - build_variant: [no-ble-asan-clang] - # Since no-ble-tsan-clang doesn't run any tests, this is just wasted CI time for now + build_variant: [no-ble-asan-clang, no-ble-tsan-clang] chip_tool: [""] env: BUILD_VARIANT: ${{matrix.build_variant}} @@ -322,8 +319,6 @@ jobs: " - name: Run Tests using the python parser sending commands to chip-tool - # https://github.com/project-chip/connectedhomeip/issues/27673 - if: matrix.build_variant != 'no-ble-tsan-clang' run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ From d083577a7d6fbd9a1829f28497b0c5d934edd478 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Tue, 5 Sep 2023 21:50:40 +0900 Subject: [PATCH 43/96] Fix Android exception jni type (#29066) --- .../java/src/chip/appserver/ChipAppServerException.java | 4 ++-- src/lib/support/JniReferences.cpp | 4 ++-- .../java/chip/platform/AndroidChipPlatformException.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/server/java/src/chip/appserver/ChipAppServerException.java b/src/app/server/java/src/chip/appserver/ChipAppServerException.java index 08e11d15fce99a..7a036eccc34973 100644 --- a/src/app/server/java/src/chip/appserver/ChipAppServerException.java +++ b/src/app/server/java/src/chip/appserver/ChipAppServerException.java @@ -3,11 +3,11 @@ public class ChipAppServerException extends RuntimeException { private static final long serialVersionUID = 1L; - public int errorCode; + public long errorCode; public ChipAppServerException() {} - public ChipAppServerException(int errorCode, String message) { + public ChipAppServerException(long errorCode, String message) { super(message != null ? message : String.format("Error Code %d", errorCode)); this.errorCode = errorCode; } diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 870ec3fc2d1d56..6ad7e26d215409 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -198,12 +198,12 @@ void JniReferences::ReportError(JNIEnv * env, CHIP_ERROR cbErr, const char * fun void JniReferences::ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR errToThrow) { env->ExceptionClear(); - jmethodID constructor = env->GetMethodID(exceptionCls, "", "(ILjava/lang/String;)V"); + jmethodID constructor = env->GetMethodID(exceptionCls, "", "(JLjava/lang/String;)V"); VerifyOrReturn(constructor != NULL); jstring jerrStr = env->NewStringUTF(ErrorStr(errToThrow)); - jthrowable outEx = (jthrowable) env->NewObject(exceptionCls, constructor, static_cast(errToThrow.AsInteger()), jerrStr); + jthrowable outEx = (jthrowable) env->NewObject(exceptionCls, constructor, static_cast(errToThrow.AsInteger()), jerrStr); VerifyOrReturn(!env->ExceptionCheck()); env->Throw(outEx); } diff --git a/src/platform/android/java/chip/platform/AndroidChipPlatformException.java b/src/platform/android/java/chip/platform/AndroidChipPlatformException.java index 0a0251730b9bee..9333e6149c6e7b 100644 --- a/src/platform/android/java/chip/platform/AndroidChipPlatformException.java +++ b/src/platform/android/java/chip/platform/AndroidChipPlatformException.java @@ -21,11 +21,11 @@ public class AndroidChipPlatformException extends Exception { private static final long serialVersionUID = 1L; - public int errorCode; + public long errorCode; public AndroidChipPlatformException() {} - public AndroidChipPlatformException(int errorCode, String message) { + public AndroidChipPlatformException(long errorCode, String message) { super(message != null ? message : String.format("Error Code %d", errorCode)); this.errorCode = errorCode; } From 4ccf87d2884bf030fdba3aff137367ee2363fd2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:53:25 +0000 Subject: [PATCH 44/96] Bump third_party/imgui/repo from `f617fe7` to `3816d47` (#29051) Bumps [third_party/imgui/repo](https://github.com/ocornut/imgui) from `f617fe7` to `3816d47`. - [Release notes](https://github.com/ocornut/imgui/releases) - [Commits](https://github.com/ocornut/imgui/compare/f617fe7890f78bc300e7a068a1c2acc9e9ce1e97...3816d478df0e7e292545fc7017b3d907c2dfd7a2) --- updated-dependencies: - dependency-name: third_party/imgui/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/imgui/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/imgui/repo b/third_party/imgui/repo index f617fe7890f78b..3816d478df0e7e 160000 --- a/third_party/imgui/repo +++ b/third_party/imgui/repo @@ -1 +1 @@ -Subproject commit f617fe7890f78bc300e7a068a1c2acc9e9ce1e97 +Subproject commit 3816d478df0e7e292545fc7017b3d907c2dfd7a2 From c07d91cec3a7b38f5dd11d6d24d419f7de51090a Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:02 +0800 Subject: [PATCH 45/96] optimize zap for chef refrigerator (#29044) --- ...eraturecontrolledcabinet_ffdb696680.matter | 75 ------------------- ...emperaturecontrolledcabinet_ffdb696680.zap | 5 +- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index f0584c5561216e..23069ca02f6a43 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -1066,12 +997,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index b7af38a37391f0..c41e00c3ca48d6 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -12727,5 +12727,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 35791b38d72f384d68696e85a462e397f6f3c621 Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:22 +0800 Subject: [PATCH 46/96] optimize zap for chef laundry washer (#29043) --- .../rootnode_laundrywasher_fb10d238c8.matter | 75 ------------------- .../rootnode_laundrywasher_fb10d238c8.zap | 5 +- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 691df7134838f0..1683218696d69e 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -1099,12 +1030,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 4f2b6a4014c1a2..185729bcbfc1e3 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -11081,5 +11081,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 80565696d6b9570cc73fb8bdb2e59e7209af3443 Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:32 +0800 Subject: [PATCH 47/96] [fix] optimize zap for rootnode_dishwasher (#29042) * optimize zap for rootnode_dishwasher * fix CI error * Revert "fix CI error" This reverts commit 93a05fa19cb159badcce6bdcc23c2586e0ecc902. --- .../rootnode_dishwasher_cc105034fe.matter | 109 ------------------ .../rootnode_dishwasher_cc105034fe.zap | 9 +- 2 files changed, 5 insertions(+), 113 deletions(-) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 5374c1f6f53af2..9b34dea09793a6 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -178,25 +109,6 @@ server cluster Descriptor = 29 { readonly attribute int16u clusterRevision = 65533; } -/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ -server cluster Binding = 30 { - fabric_scoped struct TargetStruct { - optional node_id node = 1; - optional group_id group = 2; - optional endpoint_no endpoint = 3; - optional cluster_id cluster = 4; - fabric_idx fabricIndex = 254; - } - - attribute TargetStruct binding[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated @@ -1120,12 +1032,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1331,12 +1237,6 @@ endpoint 1 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1349,15 +1249,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster Binding { - callback attribute binding; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster OperationalState { emits event OperationalError; emits event OperationCompletion; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 6f88ca3d61b5f0..bdd388535f5020 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -6553,7 +6553,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -7863,7 +7863,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Binding", @@ -10833,5 +10833,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 959ae4e89a5493c683e6ce82c9d3d8533c549ca6 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 5 Sep 2023 05:59:14 -0700 Subject: [PATCH 48/96] Add ManualCode unit tests for OnboardingPayloadParser (#29036) --- .../onboardingpayload/OnboardingPayload.kt | 16 ++++ .../chip/onboardingpayload/ManualCodeTest.kt | 75 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt index 1d6f8ab40a8aec..4d7cd01ff4a4d6 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt @@ -158,6 +158,22 @@ class OnboardingPayload( setupPinCode == other.setupPinCode } + override fun toString(): String { + return "OnboardingPayload(" + + "version=$version, " + + "vendorId=$vendorId, " + + "productId=$productId, " + + "commissioningFlow=$commissioningFlow, " + + "discoveryCapabilities=$discoveryCapabilities, " + + "discriminator=$discriminator, " + + "hasShortDiscriminator=$hasShortDiscriminator, " + + "setupPinCode=$setupPinCode, " + + "optionalQRCodeInfo=$optionalQRCodeInfo, " + + "optionalVendorData=$optionalVendorData, " + + "optionalExtensionData=$optionalExtensionData" + + ")" + } + fun addOptionalQRCodeInfo(info: OptionalQRCodeInfo) { optionalQRCodeInfo[info.tag] = info } diff --git a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt index 06dca307bbfeb7..51fb0bfc0c51ac 100644 --- a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt @@ -683,4 +683,79 @@ class ManualCodeTest { productId = payload.productId ) } + + /* + * Test Parse Short Manual PairingCode to Expected Payload + */ + @Test + fun testParseShortManualPairingCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Setup Pin Code: 20202021 + // Setup Discriminator: 15 + + val parser = OnboardingPayloadParser() + assertThat(parser.parseManualPairingCode("34970112332")) + .isEqualTo( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0, + productId = 0, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + } + + /* + * Test Parse Long Manual PairingCode to Expected Payload + */ + @Test + fun testParseLongManualPairingCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 17729 (0x4541) + // Setup Pin Code: 20202021 + // Setup Discriminator: 15 + + val parser = OnboardingPayloadParser() + assertThat(parser.parseManualPairingCode("749701123309050177298")) + .isEqualTo( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4541, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.CUSTOM.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + } + + /* + * Test Generate Manual PairingCode to Expected Payload + */ + @Test + fun testGenerateManualPairingCodetoExpectedPayload() { + val parser = OnboardingPayloadParser() + assertThat( + parser.getManualPairingCodeFromPayload( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4541, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.CUSTOM.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + ) + .isEqualTo("749701123309050177298") + } } From c8361b5bbae092c5de3fa457094197dd87b396d2 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 5 Sep 2023 21:10:09 +0800 Subject: [PATCH 49/96] ESP32: Update esp-idf to v5.1.1 release (#28980) * ESP32: Update esp-idf to v5.1.1 release * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- docs/guides/esp32/setup_idf_chip.md | 12 ++++++------ examples/all-clusters-app/esp32/partitions.csv | 1 - examples/all-clusters-app/esp32/sdkconfig.defaults | 3 +++ .../all-clusters-minimal-app/esp32/partitions.csv | 1 - .../esp32/sdkconfig.defaults | 3 +++ examples/bridge-app/esp32/sdkconfig.defaults | 3 +++ examples/chef/esp32/sdkconfig.defaults | 3 +++ examples/light-switch-app/esp32/sdkconfig.defaults | 3 +++ examples/lighting-app/esp32/partitions_h2.csv | 9 --------- examples/lighting-app/esp32/sdkconfig.defaults | 3 +++ .../lighting-app/esp32/sdkconfig.defaults.esp32h2 | 2 +- examples/lock-app/esp32/sdkconfig.defaults | 3 +++ examples/ota-provider-app/esp32/sdkconfig.defaults | 3 +++ examples/ota-requestor-app/esp32/sdkconfig.defaults | 3 +++ examples/pigweed-app/esp32/sdkconfig.defaults | 3 +++ .../esp32/sdkconfig.defaults | 3 +++ integrations/docker/images/base/chip-build/version | 2 +- .../images/stage-2/chip-build-esp32/Dockerfile | 2 +- 18 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 examples/lighting-app/esp32/partitions_h2.csv diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/guides/esp32/setup_idf_chip.md index 66f6931192cca3..900bfc170b5dea 100644 --- a/docs/guides/esp32/setup_idf_chip.md +++ b/docs/guides/esp32/setup_idf_chip.md @@ -16,22 +16,22 @@ step. - [Linux](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-linux-users) - [macOS](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-macos-users) -### Get IDF v5.1 +### Get IDF v5.1.1 -- Clone ESP-IDF - [v5.1 release](https://github.com/espressif/esp-idf/releases/tag/v5.1) +- Clone ESP-IDF [v5.1.1 + release](https://github.com/espressif/esp-idf/releases/tag/v5.1.1 ``` - git clone -b v5.1 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git + git clone -b v5.1.1 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git cd esp-idf ./install.sh ``` -- To update an existing esp-idf toolchain to v5.1: +- To update an existing esp-idf toolchain to v5.1.1: ``` cd path/to/esp-idf - git fetch --depth 1 origin v5.1 + git fetch --depth 1 origin v5.1.1 git reset --hard FETCH_HEAD git submodule update --depth 1 --recursive --init diff --git a/examples/all-clusters-app/esp32/partitions.csv b/examples/all-clusters-app/esp32/partitions.csv index 47172e25774ebb..530cbadc617136 100644 --- a/examples/all-clusters-app/esp32/partitions.csv +++ b/examples/all-clusters-app/esp32/partitions.csv @@ -5,4 +5,3 @@ otadata, data, ota, , 0x2000, phy_init, data, phy, , 0x1000, ota_0, app, ota_0, , 1900K, ota_1, app, ota_1, , 1900K, -ot_storage, data, 0x3a, , 0x2000, diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults b/examples/all-clusters-app/esp32/sdkconfig.defaults index c3b10929d4120d..08fcf94d8ca928 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults @@ -69,3 +69,6 @@ CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/all-clusters-minimal-app/esp32/partitions.csv b/examples/all-clusters-minimal-app/esp32/partitions.csv index 47172e25774ebb..530cbadc617136 100644 --- a/examples/all-clusters-minimal-app/esp32/partitions.csv +++ b/examples/all-clusters-minimal-app/esp32/partitions.csv @@ -5,4 +5,3 @@ otadata, data, ota, , 0x2000, phy_init, data, phy, , 0x1000, ota_0, app, ota_0, , 1900K, ota_1, app, ota_1, , 1900K, -ot_storage, data, 0x3a, , 0x2000, diff --git a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults index fda02fbf7c9bae..c551c966de34ec 100644 --- a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults @@ -69,3 +69,6 @@ CONFIG_MBEDTLS_HKDF_C=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/bridge-app/esp32/sdkconfig.defaults b/examples/bridge-app/esp32/sdkconfig.defaults index bc364e144359d3..c92a558df8491b 100644 --- a/examples/bridge-app/esp32/sdkconfig.defaults +++ b/examples/bridge-app/esp32/sdkconfig.defaults @@ -48,3 +48,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/chef/esp32/sdkconfig.defaults b/examples/chef/esp32/sdkconfig.defaults index bd714ab0202833..327e0d2538f022 100644 --- a/examples/chef/esp32/sdkconfig.defaults +++ b/examples/chef/esp32/sdkconfig.defaults @@ -62,3 +62,6 @@ CONFIG_MBEDTLS_HKDF_C=y # IRAM optimizations CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/light-switch-app/esp32/sdkconfig.defaults b/examples/light-switch-app/esp32/sdkconfig.defaults index e392501a531a67..d0e507742a2f64 100644 --- a/examples/light-switch-app/esp32/sdkconfig.defaults +++ b/examples/light-switch-app/esp32/sdkconfig.defaults @@ -55,3 +55,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/lighting-app/esp32/partitions_h2.csv b/examples/lighting-app/esp32/partitions_h2.csv deleted file mode 100644 index 16a8b0f7453040..00000000000000 --- a/examples/lighting-app/esp32/partitions_h2.csv +++ /dev/null @@ -1,9 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs, , 0xC000, -otadata, data, ota, , 0x2000, -phy_init, data, phy, , 0x1000, -ota_0, app, ota_0, , 1500K, -ota_1, app, ota_1, , 1500K, -fctry, data, nvs, , 0x6000, -ot_storage,data, fat, , 0x6000, diff --git a/examples/lighting-app/esp32/sdkconfig.defaults b/examples/lighting-app/esp32/sdkconfig.defaults index f87a164ae41dd2..a8833c13a1a23b 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults +++ b/examples/lighting-app/esp32/sdkconfig.defaults @@ -61,3 +61,6 @@ CONFIG_MBEDTLS_HKDF_C=y # Disable Read Client CONFIG_DISABLE_READ_CLIENT=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 index d5f98fc81d2393..11d5991c353b20 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 @@ -38,7 +38,7 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=n # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_h2.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" # LwIP config for OpenThread CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 diff --git a/examples/lock-app/esp32/sdkconfig.defaults b/examples/lock-app/esp32/sdkconfig.defaults index 29b42045b60791..4755d2e29635a8 100644 --- a/examples/lock-app/esp32/sdkconfig.defaults +++ b/examples/lock-app/esp32/sdkconfig.defaults @@ -52,3 +52,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/ota-provider-app/esp32/sdkconfig.defaults b/examples/ota-provider-app/esp32/sdkconfig.defaults index 9c1ccf088c9592..6a06f08a0d51fb 100644 --- a/examples/ota-provider-app/esp32/sdkconfig.defaults +++ b/examples/ota-provider-app/esp32/sdkconfig.defaults @@ -67,3 +67,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/ota-requestor-app/esp32/sdkconfig.defaults b/examples/ota-requestor-app/esp32/sdkconfig.defaults index b994220206e218..b4629c26d79412 100644 --- a/examples/ota-requestor-app/esp32/sdkconfig.defaults +++ b/examples/ota-requestor-app/esp32/sdkconfig.defaults @@ -68,3 +68,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/pigweed-app/esp32/sdkconfig.defaults b/examples/pigweed-app/esp32/sdkconfig.defaults index 8a5033a3f6f3b1..6090ca73d6c3f7 100644 --- a/examples/pigweed-app/esp32/sdkconfig.defaults +++ b/examples/pigweed-app/esp32/sdkconfig.defaults @@ -45,3 +45,6 @@ CONFIG_DEVICE_PRODUCT_ID=0x800B CONFIG_MBEDTLS_HKDF_C=y CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/temperature-measurement-app/esp32/sdkconfig.defaults b/examples/temperature-measurement-app/esp32/sdkconfig.defaults index 33c86a9673b901..81070fbfddb449 100644 --- a/examples/temperature-measurement-app/esp32/sdkconfig.defaults +++ b/examples/temperature-measurement-app/esp32/sdkconfig.defaults @@ -93,3 +93,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index bd451da8a19808..23c2b67d803b65 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -10 : [Telink] Update Docker image (Zephyr update) +11 : [ESP32] Update IDF to release v5.1.1 diff --git a/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile b/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile index 65f4eaf4a5a572..a5f01eb0c340eb 100644 --- a/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile @@ -11,7 +11,7 @@ RUN set -x \ && : # last line RUN set -x \ - && git clone --recursive -b v5.1 --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git /tmp/esp-idf \ + && git clone --recursive -b v5.1.1 --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git /tmp/esp-idf \ && : # last line FROM ghcr.io/project-chip/chip-build:${VERSION} From 09ed308d122eae991e9e0df79313e2c7553b9972 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:06:30 +0800 Subject: [PATCH 50/96] ESP32: Enable BLE Deinit for ESP32H2 after successful commissioning (#28865) --- .../esp32/common/CommonDeviceCallbacks.cpp | 56 +----------------- .../platform/esp32/common/Esp32AppServer.cpp | 58 +++++++++++++++++++ .../platform/esp32/common/Esp32AppServer.h | 1 + src/platform/ESP32/OpenthreadLauncher.c | 15 ++++- src/platform/ESP32/OpenthreadLauncher.h | 2 +- src/platform/ESP32/nimble/BLEManagerImpl.cpp | 15 ----- 6 files changed, 75 insertions(+), 72 deletions(-) diff --git a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp index eddb61524c0a74..0830c49a478cc3 100644 --- a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp @@ -16,18 +16,7 @@ * limitations under the License. */ #include "CommonDeviceCallbacks.h" - -#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#if CONFIG_BT_ENABLED -#include "esp_bt.h" -#if CONFIG_BT_NIMBLE_ENABLED -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "esp_nimble_hci.h" -#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "nimble/nimble_port.h" -#endif // CONFIG_BT_NIMBLE_ENABLED -#endif // CONFIG_BT_ENABLED -#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include "Esp32AppServer.h" #include "esp_err.h" #include "esp_heap_caps.h" @@ -62,48 +51,7 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i case DeviceEventType::kCHIPoBLEConnectionClosed: ESP_LOGI(TAG, "CHIPoBLE disconnected"); - -#if CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING - if (chip::Server::GetInstance().GetFabricTable().FabricCount() > 0) - { - esp_err_t err = ESP_OK; - -#if CONFIG_BT_NIMBLE_ENABLED - if (!ble_hs_is_enabled()) - { - ESP_LOGI(TAG, "BLE already deinited"); - break; - } - if (nimble_port_stop() != 0) - { - ESP_LOGE(TAG, "nimble_port_stop() failed"); - break; - } - vTaskDelay(100); - nimble_port_deinit(); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - err = esp_nimble_hci_and_controller_deinit(); -#endif -#endif /* CONFIG_BT_NIMBLE_ENABLED */ - -#if CONFIG_IDF_TARGET_ESP32 - err |= esp_bt_mem_release(ESP_BT_MODE_BTDM); -#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 - err |= esp_bt_mem_release(ESP_BT_MODE_BLE); -#endif - - if (err != ESP_OK) - { - ESP_LOGE(TAG, "BLE deinit failed"); - } - else - { - ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); - } - } -#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ - + Esp32AppServer::DeInitBLEIfCommissioned(); break; case DeviceEventType::kDnssdInitialized: diff --git a/examples/platform/esp32/common/Esp32AppServer.cpp b/examples/platform/esp32/common/Esp32AppServer.cpp index db787d09867b68..8baafcb458a2d7 100644 --- a/examples/platform/esp32/common/Esp32AppServer.cpp +++ b/examples/platform/esp32/common/Esp32AppServer.cpp @@ -27,6 +27,19 @@ #if CONFIG_ENABLE_ICD_SERVER #include #endif + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#if CONFIG_BT_ENABLED +#include "esp_bt.h" +#if CONFIG_BT_NIMBLE_ENABLED +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +#include "esp_nimble_hci.h" +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +#include "nimble/nimble_port.h" +#endif // CONFIG_BT_NIMBLE_ENABLED +#endif // CONFIG_BT_ENABLED +#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + #include using namespace chip; @@ -100,6 +113,50 @@ static size_t hex_string_to_binary(const char * hex_string, uint8_t * buf, size_ } #endif // CONFIG_TEST_EVENT_TRIGGER_ENABLED +void Esp32AppServer::DeInitBLEIfCommissioned(void) +{ +#if CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING + if (chip::Server::GetInstance().GetFabricTable().FabricCount() > 0) + { + esp_err_t err = ESP_OK; + +#if CONFIG_BT_NIMBLE_ENABLED + if (!ble_hs_is_enabled()) + { + ESP_LOGI(TAG, "BLE already deinited"); + return; + } + if (nimble_port_stop() != 0) + { + ESP_LOGE(TAG, "nimble_port_stop() failed"); + return; + } + vTaskDelay(100); + nimble_port_deinit(); + +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) + err = esp_nimble_hci_and_controller_deinit(); +#endif +#endif /* CONFIG_BT_NIMBLE_ENABLED */ + +#if CONFIG_IDF_TARGET_ESP32 + err |= esp_bt_mem_release(ESP_BT_MODE_BTDM); +#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 + err |= esp_bt_mem_release(ESP_BT_MODE_BLE); +#endif + + if (err != ESP_OK) + { + ESP_LOGE(TAG, "BLE deinit failed"); + } + else + { + ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); + } + } +#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ +} + void Esp32AppServer::Init(AppDelegate * sAppDelegate) { // Init ZCL Data Model and CHIP App Server @@ -136,4 +193,5 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate) chip::app::DnssdServer::Instance().StartServer(); } #endif + DeInitBLEIfCommissioned(); } diff --git a/examples/platform/esp32/common/Esp32AppServer.h b/examples/platform/esp32/common/Esp32AppServer.h index 7b1598cca5a57e..b09aa1fef972f0 100644 --- a/examples/platform/esp32/common/Esp32AppServer.h +++ b/examples/platform/esp32/common/Esp32AppServer.h @@ -22,5 +22,6 @@ #include namespace Esp32AppServer { +void DeInitBLEIfCommissioned(void); void Init(AppDelegate * context = nullptr); } // namespace Esp32AppServer diff --git a/src/platform/ESP32/OpenthreadLauncher.c b/src/platform/ESP32/OpenthreadLauncher.c index 7183767016bb89..4eaa674e4d8c48 100644 --- a/src/platform/ESP32/OpenthreadLauncher.c +++ b/src/platform/ESP32/OpenthreadLauncher.c @@ -55,9 +55,18 @@ static void ot_task_worker(void * context) vTaskDelete(NULL); } -void set_openthread_platform_config(esp_openthread_platform_config_t * config) +esp_err_t set_openthread_platform_config(esp_openthread_platform_config_t * config) { - s_platform_config = config; + if (!s_platform_config) + { + s_platform_config = (esp_openthread_platform_config_t *) malloc(sizeof(esp_openthread_platform_config_t)); + if (!s_platform_config) + { + return ESP_ERR_NO_MEM; + } + } + memcpy(s_platform_config, config, sizeof(esp_openthread_platform_config_t)); + return ESP_OK; } esp_err_t openthread_init_stack(void) @@ -77,6 +86,8 @@ esp_err_t openthread_init_stack(void) ESP_ERROR_CHECK(esp_openthread_init(s_platform_config)); // Initialize the esp_netif bindings openthread_netif = init_openthread_netif(s_platform_config); + free(s_platform_config); + s_platform_config = NULL; return ESP_OK; } diff --git a/src/platform/ESP32/OpenthreadLauncher.h b/src/platform/ESP32/OpenthreadLauncher.h index 6817a4dc5afb80..a7f4ef02747eb2 100644 --- a/src/platform/ESP32/OpenthreadLauncher.h +++ b/src/platform/ESP32/OpenthreadLauncher.h @@ -24,7 +24,7 @@ extern "C" { #endif -void set_openthread_platform_config(esp_openthread_platform_config_t * config); +esp_err_t set_openthread_platform_config(esp_openthread_platform_config_t * config); esp_err_t openthread_init_stack(void); esp_err_t openthread_launch_task(void); diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 6a9a047ab84db1..d62e5530823af0 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -211,21 +211,6 @@ void HandleIncomingBleConnection(BLEEndPoint * bleEP) CHIP_ERROR BLEManagerImpl::_Init() { -#if CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - if (ConnectivityMgr().IsThreadProvisioned()) - { - ESP_LOGI(TAG, "Thread credentials already provisioned, not initializing BLE"); -#else - if (ConnectivityMgr().IsWiFiStationProvisioned()) - { - ESP_LOGI(TAG, "WiFi station already provisioned, not initializing BLE"); -#endif /* CHIP_DEVICE_CONFIG_ENABLE_THREAD */ - esp_bt_mem_release(ESP_BT_MODE_BTDM); - return CHIP_NO_ERROR; - } -#endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ - CHIP_ERROR err; // Initialize the Chip BleLayer. From c68cc7907aa5c8d2e348bf5c4503a7633893956c Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:34:34 +0530 Subject: [PATCH 51/96] Setting the flag correctly in the callback (#29047) --- examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index 22032e33f4a928..8f738e36159dc6 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -162,6 +162,7 @@ int32_t wfx_rsi_disconnect() sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t result_length, void * arg) { + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING); temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t)); memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); if (CHECK_IF_EVENT_FAILED(event)) @@ -169,7 +170,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t SILABS_LOG("F: Join Event received with %u bytes payload\n", result_length); callback_status = *(sl_status_t *) result; wfx_rsi.join_retries += 1; - wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED); + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTED); wfx_retry_interval_handler(is_wifi_disconnection_event, wfx_rsi.join_retries++); if (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN) { From e543e10f9407759e79045ae8dcb27ca34ee48c58 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 5 Sep 2023 08:05:26 -0700 Subject: [PATCH 52/96] Add unit tests for OnboardingPayloadParser (#29030) --- .../chip/onboardingpayload/QRCodeTest.kt | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt index 1f854758f18951..afbfdd0e3e477d 100644 --- a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt @@ -315,6 +315,60 @@ class QRCodeTest { assertEquals("ABC", QRCodeOnboardingPayloadParser.extractPayload("%MT:ABC")) } + /* + * Test Parse QrCode to Expected Payload + */ + @Test + fun testParseQrCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 20043 (0x4E4B) + // Setup Pin Code: 20202021 + // Setup Discriminator: 3840 (0xF00) + + val parser = OnboardingPayloadParser() + assertThat(parser.parseQrCode("MT:W0GU2OTB00KA0648G00")) + .isEqualTo( + OnboardingPayload( + discriminator = 0xF00, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4E4B, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(DiscoveryCapability.BLE), + ) + ) + } + + /* + * Test Generate QrCode from Expected Value + */ + @Test + fun testGenerateQrCodeFromExpectedValue() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 20043 (0x4E4B) + // Setup Pin Code: 20202021 + // Setup Discriminator: 3840 (0xF00) + + val parser = OnboardingPayloadParser() + assertThat( + parser.getQrCodeFromPayload( + OnboardingPayload( + discriminator = 0xF00, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4E4B, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(DiscoveryCapability.BLE), + ) + ) + ) + .isEqualTo("MT:W0GU2OTB00KA0648G00") + } + companion object { const val kDefaultPayloadQRCode: String = "MT:M5L90MP500K64J00000" } From 72cf01097f938b7d68609d1a6e6aae9fdfe950c6 Mon Sep 17 00:00:00 2001 From: nekleo <96453741+nekleo@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:07:43 -0700 Subject: [PATCH 53/96] [Chef] Add pump device type with optional clusters enabled (#28995) * Add pump device type with optional clusters enabled to chef * Regenerated matter file --- .../devices/rootnode_pump_5f904818cc.matter | 1319 +++ .../chef/devices/rootnode_pump_5f904818cc.zap | 8307 +++++++++++++++++ 2 files changed, 9626 insertions(+) create mode 100644 examples/chef/devices/rootnode_pump_5f904818cc.matter create mode 100644 examples/chef/devices/rootnode_pump_5f904818cc.zap diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter new file mode 100644 index 00000000000000..ab82d2f670c300 --- /dev/null +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -0,0 +1,1319 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +server cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : ENUM8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : ENUM8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : ENUM8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum OnOffStartUpOnOff : ENUM8 { + kOff = 0; + kOn = 1; + kTogglePreviousOnOff = 2; + } + + bitmap Feature : BITMAP32 { + kLighting = 0x1; + kDeadFront = 0x2; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly nosubscribe attribute boolean onOff = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command Off(): DefaultSuccess = 0; + command On(): DefaultSuccess = 1; + command Toggle(): DefaultSuccess = 2; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +server cluster UnitLocalization = 45 { + enum TempUnitEnum : ENUM8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : BITMAP32 { + kTemperatureUnit = 0x1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** An interface for configuring and controlling pumps. */ +server cluster PumpConfigurationAndControl = 512 { + enum ControlModeEnum : ENUM8 { + kConstantSpeed = 0; + kConstantPressure = 1; + kProportionalPressure = 2; + kConstantFlow = 3; + kConstantTemperature = 5; + kAutomatic = 7; + } + + enum OperationModeEnum : ENUM8 { + kNormal = 0; + kMinimum = 1; + kMaximum = 2; + kLocal = 3; + } + + bitmap Feature : BITMAP32 { + kConstantPressure = 0x1; + kCompensatedPressure = 0x2; + kConstantFlow = 0x4; + kConstantSpeed = 0x8; + kConstantTemperature = 0x10; + kAutomatic = 0x20; + kLocalOperation = 0x40; + } + + bitmap PumpStatusBitmap : BITMAP16 { + kDeviceFault = 0x1; + kSupplyfault = 0x2; + kSpeedLow = 0x4; + kSpeedHigh = 0x8; + kLocalOverride = 0x10; + kRunning = 0x20; + kRemotePressure = 0x40; + kRemoteFlow = 0x80; + kRemoteTemperature = 0x100; + } + + info event SupplyVoltageLow = 0 { + } + + info event SupplyVoltageHigh = 1 { + } + + info event PowerMissingPhase = 2 { + } + + info event SystemPressureLow = 3 { + } + + info event SystemPressureHigh = 4 { + } + + critical event DryRunning = 5 { + } + + info event MotorTemperatureHigh = 6 { + } + + critical event PumpMotorFatalFailure = 7 { + } + + info event ElectronicTemperatureHigh = 8 { + } + + critical event PumpBlocked = 9 { + } + + info event SensorFailure = 10 { + } + + info event ElectronicNonFatalFailure = 11 { + } + + critical event ElectronicFatalFailure = 12 { + } + + info event GeneralFault = 13 { + } + + info event Leakage = 14 { + } + + info event AirDetection = 15 { + } + + info event TurbineOperation = 16 { + } + + readonly attribute nullable int16s maxPressure = 0; + readonly attribute nullable int16u maxSpeed = 1; + readonly attribute nullable int16u maxFlow = 2; + readonly attribute nullable int16s minConstTemp = 11; + readonly attribute nullable int16s maxConstTemp = 12; + readonly attribute PumpStatusBitmap pumpStatus = 16; + readonly attribute OperationModeEnum effectiveOperationMode = 17; + readonly attribute ControlModeEnum effectiveControlMode = 18; + readonly nosubscribe attribute nullable int16s capacity = 19; + readonly attribute nullable int16u speed = 20; + attribute access(write: manage) OperationModeEnum operationMode = 32; + attribute access(write: manage) ControlModeEnum controlMode = 33; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ +server cluster TemperatureMeasurement = 1026 { + readonly attribute nullable int16s measuredValue = 0; + readonly attribute nullable int16s minMeasuredValue = 1; + readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ +server cluster PressureMeasurement = 1027 { + bitmap Feature : BITMAP32 { + kExtended = 0x1; + } + + readonly attribute nullable int16s measuredValue = 0; + readonly attribute nullable int16s minMeasuredValue = 1; + readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of flow, and reporting flow measurements. */ +server cluster FlowMeasurement = 1028 { + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 2; + } + + server cluster AccessControl { + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + callback attribute dataModelRevision default = 17; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute capabilityMinima; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_pump = 771, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster OnOff { + ram attribute onOff default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 5; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster PumpConfigurationAndControl { + ram attribute maxPressure default = 32767; + ram attribute maxSpeed default = 65534; + ram attribute maxFlow default = 65534; + ram attribute minConstTemp default = 0; + ram attribute maxConstTemp default = 10000; + ram attribute pumpStatus default = 5; + ram attribute effectiveOperationMode default = 0; + ram attribute effectiveControlMode default = 5; + ram attribute capacity; + ram attribute speed default = 1000; + ram attribute operationMode default = 0; + ram attribute controlMode default = 5; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster TemperatureMeasurement { + ram attribute measuredValue default = 6000; + ram attribute minMeasuredValue default = -27315; + ram attribute maxMeasuredValue default = 32767; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster PressureMeasurement { + ram attribute measuredValue default = 4500; + ram attribute minMeasuredValue default = -32767; + ram attribute maxMeasuredValue default = 32767; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster FlowMeasurement { + ram attribute measuredValue default = 50; + ram attribute minMeasuredValue default = 0; + ram attribute maxMeasuredValue default = 65534; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap new file mode 100644 index 00000000000000..bd00cd5534b9fa --- /dev/null +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -0,0 +1,8307 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 2 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "17", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductAppearance", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "ProductAppearanceStruct", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 14, + "code": 771, + "profileId": 2457, + "label": "MA-pump", + "name": "MA-pump" + }, + "deviceTypes": [ + { + "id": 14, + "code": 771, + "profileId": 2457, + "label": "MA-pump", + "name": "MA-pump" + } + ], + "deviceTypeRefs": [ + 14 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 771 + ], + "deviceTypeName": "MA-pump", + "deviceTypeCode": 771, + "deviceTypeProfileId": 2457, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MaxPressure", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxSpeed", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFlow", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstPressure", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstPressure", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinCompPressure", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxCompPressure", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstSpeed", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstSpeed", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstFlow", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstFlow", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstTemp", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstTemp", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PumpStatus", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "PumpStatusBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EffectiveOperationMode", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "OperationModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EffectiveControlMode", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "ControlModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Capacity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Speed", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LifetimeRunningHours", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Power", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LifetimeEnergyConsumed", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationMode", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "OperationModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ControlMode", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "ControlModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "-27315", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pressure Measurement", + "code": 1027, + "mfgCode": null, + "define": "PRESSURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pressure Measurement", + "code": 1027, + "mfgCode": null, + "define": "PRESSURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4500", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "-32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScaledValue", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinScaledValue", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxScaledValue", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScaledTolerance", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Scale", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "50", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 2457, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file From 2e9c162e8048b839fd9780840b0d1a9d4e541959 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:11:02 +0900 Subject: [PATCH 54/96] Fix Android Commissioning Crash (#29063) --- src/lib/support/JniReferences.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 6ad7e26d215409..36f6b98e7e8a6a 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -84,12 +84,13 @@ CHIP_ERROR JniReferences::GetClassRef(JNIEnv * env, const char * clsType, jclass if (strcmp(clsType, "java/util/Optional") == 0) { cls = env->FindClass("j$/util/Optional"); + env->ExceptionClear(); } if (cls == nullptr) { - env->ExceptionClear(); cls = env->FindClass(clsType); + env->ExceptionClear(); } if (cls == nullptr) From e81a7fe57eedeb7527cdd3095fc202c018ecd5ea Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 5 Sep 2023 18:49:00 +0200 Subject: [PATCH 55/96] [Tizen] Exclude *.map file from test runner ISO (#29072) --- src/test_driver/tizen/chip_tests/BUILD.gn | 1 + third_party/tizen/tizen_sdk.gni | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/test_driver/tizen/chip_tests/BUILD.gn b/src/test_driver/tizen/chip_tests/BUILD.gn index 829371df7cc620..01b0e5e70246be 100644 --- a/src/test_driver/tizen/chip_tests/BUILD.gn +++ b/src/test_driver/tizen/chip_tests/BUILD.gn @@ -30,6 +30,7 @@ tizen_qemu_mkisofs("chip-tests-runner") { # rebuild of the ISO image, so the test will be run with old # binaries. assets_non_tracked = [ rebase_path("${root_build_dir}/tests") ] + assets_non_tracked_exclude_globs = [ "*.map" ] } tizen_qemu_run("chip-tests") { diff --git a/third_party/tizen/tizen_sdk.gni b/third_party/tizen/tizen_sdk.gni index 3c8704a8491a13..ebbc8dadd077d0 100644 --- a/third_party/tizen/tizen_sdk.gni +++ b/third_party/tizen/tizen_sdk.gni @@ -190,10 +190,26 @@ template("tizen_qemu_mkisofs") { "-input-charset=default", "-VCHIP", # Volume ID = CHIP "-JRU", # Joliet + Rock Ridge with untranslated filenames + ] + + # Exclude files from the ISO image which might otherwise be included + # by non-tracked assets in case of adding entire directory. This will + # not exclude files added explicitly. + if (defined(invoker.assets_non_tracked_exclude_globs)) { + foreach(glob, invoker.assets_non_tracked_exclude_globs) { + args += [ + "-m", + glob, + ] + } + } + + args += [ "-o", rebase_path(image_file), rebase_path(invoker.runner), ] + if (defined(invoker.assets)) { args += invoker.assets inputs += invoker.assets From bea333a8a8d962077bf336f607dfa8ada92c3986 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 14:03:09 -0400 Subject: [PATCH 56/96] Update Darwin availability annotations. (#29038) --- .../CHIP/templates/availability.yaml | 37 +++++++++++++++---- .../MTRAttributeTLVValueDecoder.mm | 4 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 32 ++++++++-------- .../CHIP/zap-generated/MTRCallbackBridge.h | 11 ++++-- .../CHIP/zap-generated/MTRClusterConstants.h | 4 +- .../CHIP/zap-generated/MTRClusters.h | 4 +- .../CHIP/zap-generated/MTRStructsObjc.h | 10 ++--- .../zap-generated/cluster/Commands.h | 12 ++++++ 8 files changed, 78 insertions(+), 36 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index b838c64d8d0d15..22376a7ff87412 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7615,18 +7615,36 @@ - TimeFailure - MissingTrustedTimeSource -- release: "Future" - versions: "future" +- release: "Fall 2023 #2" + versions: + ios: "17.1" + macos: "14.1" + watchos: "10.1" + tvos: "17.1" introduced: + bitmaps: + TimeFormatLocalization: + - Feature + bitmap values: + OnOff: + Feature: + - DeadFront + TimeFormatLocalization: + Feature: + - CalendarFormat + provisional: attributes: + # New things, not quite finalized. PowerSource: - EndpointList Descriptor: - TagList structs: + # New things, not quite finalized. Descriptor: - SemanticTagStruct struct fields: + # New things, not quite finalized. Descriptor: SemanticTagStruct: - mfgCode @@ -7634,20 +7652,22 @@ - tag - label bitmaps: + # CacheAndSync is provisional in the spec. GroupKeyManagement: - Feature + # New things, not quite finalized. Descriptor: - Feature bitmap values: - OnOff: + # New things, not quite finalized. + Descriptor: Feature: - - DeadFront + - TagList + # CacheAndSync is provisional in the spec. GroupKeyManagement: Feature: - CacheAndSync - Descriptor: - Feature: - - TagList + # Scenes are generally provisional for now. Scenes: Feature: - Explicit @@ -7662,3 +7682,6 @@ - ProxyConfiguration - ProxyDiscovery - ProxyValid + +- release: "Future" + versions: "future" diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 14d0fb2f4bb436..d6490491f078a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -1778,6 +1778,7 @@ static id _Nullable DecodeAttributeValueForDescriptorCluster( } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::TagList::Id: { using TypeInfo = Attributes::TagList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -1825,6 +1826,7 @@ static id _Nullable DecodeAttributeValueForDescriptorCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -4604,6 +4606,7 @@ static id _Nullable DecodeAttributeValueForPowerSourceCluster( } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::EndpointList::Id: { using TypeInfo = Attributes::EndpointList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -4630,6 +4633,7 @@ static id _Nullable DecodeAttributeValueForPowerSourceCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 8f95cdc8da0b9c..64750300422587 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -1754,16 +1754,16 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeTagListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeTagListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeTagListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -3974,16 +3974,16 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeEndpointListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeEndpointListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeEndpointListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -25105,9 +25105,9 @@ typedef NS_OPTIONS(uint8_t, MTRGroupsNameSupportBitmap) { typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureSceneNames API_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x1, - MTRScenesFeatureExplicit MTR_NEWLY_AVAILABLE = 0x2, - MTRScenesFeatureTableSize MTR_NEWLY_AVAILABLE = 0x4, - MTRScenesFeatureFabricScenes MTR_NEWLY_AVAILABLE = 0x8, + MTRScenesFeatureExplicit MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRScenesFeatureTableSize MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRScenesFeatureFabricScenes MTR_PROVISIONALLY_AVAILABLE = 0x8, } API_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { @@ -25141,7 +25141,7 @@ typedef NS_ENUM(uint8_t, MTROnOffStartUpOnOff) { typedef NS_OPTIONS(uint32_t, MTROnOffFeature) { MTROnOffFeatureLighting API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTROnOffFeatureDeadFront MTR_NEWLY_AVAILABLE = 0x2, + MTROnOffFeatureDeadFront API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)) = 0x2, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTROnOffControl) { @@ -25170,8 +25170,8 @@ typedef NS_OPTIONS(uint8_t, MTRLevelControlOptions) { } API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); typedef NS_OPTIONS(uint32_t, MTRDescriptorFeature) { - MTRDescriptorFeatureTagList MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRDescriptorFeatureTagList MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRAccessControlEntryAuthMode) { MTRAccessControlEntryAuthModePASE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, @@ -25520,8 +25520,8 @@ typedef NS_ENUM(uint8_t, MTRTimeFormatLocalizationHourFormat) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRTimeFormatLocalizationFeature) { - MTRTimeFormatLocalizationFeatureCalendarFormat MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRTimeFormatLocalizationFeatureCalendarFormat API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)) = 0x1, +} API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)); typedef NS_ENUM(uint8_t, MTRUnitLocalizationTempUnit) { MTRUnitLocalizationTempUnitFahrenheit API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, @@ -26444,8 +26444,8 @@ typedef NS_ENUM(uint8_t, MTRGroupKeyManagementGroupKeySecurityPolicy) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRGroupKeyManagementFeature) { - MTRGroupKeyManagementFeatureCacheAndSync MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRGroupKeyManagementFeatureCacheAndSync MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRICDManagementFeature) { MTRICDManagementFeatureCheckInProtocolSupport MTR_PROVISIONALLY_AVAILABLE = 0x1, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 0cc7f3684f1c80..44679818f4d78b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -3904,7 +3904,8 @@ class MTRDescriptorPartsListListAttributeCallbackSubscriptionBridge : public MTR MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRDescriptorTagListListAttributeCallbackBridge : public MTRCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRDescriptorTagListListAttributeCallbackBridge + : public MTRCallbackBridge { public: MTRDescriptorTagListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : @@ -3919,7 +3920,8 @@ class MTRDescriptorTagListListAttributeCallbackBridge : public MTRCallbackBridge value); }; -class MTRDescriptorTagListListAttributeCallbackSubscriptionBridge : public MTRDescriptorTagListListAttributeCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRDescriptorTagListListAttributeCallbackSubscriptionBridge + : public MTRDescriptorTagListListAttributeCallbackBridge { public: MTRDescriptorTagListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, @@ -5849,7 +5851,8 @@ class MTRPowerSourceActiveBatChargeFaultsListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRPowerSourceEndpointListListAttributeCallbackBridge : public MTRCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRPowerSourceEndpointListListAttributeCallbackBridge + : public MTRCallbackBridge { public: MTRPowerSourceEndpointListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : @@ -5861,7 +5864,7 @@ class MTRPowerSourceEndpointListListAttributeCallbackBridge : public MTRCallback static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRPowerSourceEndpointListListAttributeCallbackSubscriptionBridge +class MTR_PROVISIONALLY_AVAILABLE MTRPowerSourceEndpointListListAttributeCallbackSubscriptionBridge : public MTRPowerSourceEndpointListListAttributeCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7f0f5a82834061..6f7d4d529419c2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -915,7 +915,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { = 0x00000002, MTRAttributeIDTypeClusterDescriptorAttributePartsListID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, - MTRAttributeIDTypeClusterDescriptorAttributeTagListID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterDescriptorAttributeTagListID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, MTRAttributeIDTypeClusterDescriptorAttributeGeneratedCommandListID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -1791,7 +1791,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterPowerSourceAttributeActiveBatChargeFaultsID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000001E, - MTRAttributeIDTypeClusterPowerSourceAttributeEndpointListID MTR_NEWLY_AVAILABLE = 0x0000001F, + MTRAttributeIDTypeClusterPowerSourceAttributeEndpointListID MTR_PROVISIONALLY_AVAILABLE = 0x0000001F, MTRAttributeIDTypeClusterPowerSourceAttributeGeneratedCommandListID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 77495c0ef94bfe..14355f269b5f41 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -749,7 +749,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary *)readAttributePartsListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary *)readAttributeTagListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (NSDictionary *)readAttributeTagListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -1511,7 +1511,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary *)readAttributeActiveBatChargeFaultsWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index cb5ffe460ba0af..9742181dc8153b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -50,12 +50,12 @@ MTR_DEPRECATED( "Please use MTRDescriptorClusterDeviceTypeStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end -MTR_NEWLY_AVAILABLE +MTR_PROVISIONALLY_AVAILABLE @interface MTRDescriptorClusterSemanticTagStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull namespaceID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull tag MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nullable label MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull namespaceID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull tag MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable label MTR_PROVISIONALLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index d80f332a2f2526..83b5c849f16e53 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -10096,6 +10096,8 @@ class SubscribeAttributeDescriptorPartsList : public SubscribeAttribute { } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute TagList */ @@ -10174,6 +10176,8 @@ class SubscribeAttributeDescriptorTagList : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -22772,6 +22776,8 @@ class SubscribeAttributePowerSourceActiveBatChargeFaults : public SubscribeAttri } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute EndpointList */ @@ -22850,6 +22856,8 @@ class SubscribeAttributePowerSourceEndpointList : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -147946,8 +147954,10 @@ void registerClusterDescriptor(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // @@ -148446,8 +148456,10 @@ void registerClusterPowerSource(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // From 14cbb3235bbae9a847a6b86703c3663bc21e0b6d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 14:04:23 -0400 Subject: [PATCH 57/96] Add a config define for Darwin per-controller storage. (#29037) It's not quite ready yet; make sure we don't accidentally ship it. --- .github/workflows/darwin.yaml | 2 ++ src/darwin/Framework/CHIP/MTRDefines.h | 10 +++++++- .../Framework/CHIP/MTRDeviceController.h | 2 ++ .../CHIP/MTRDeviceControllerDataStore.h | 4 +++ .../CHIP/MTRDeviceControllerFactory.h | 10 ++++++++ .../CHIP/MTRDeviceControllerFactory.mm | 3 +++ .../MTRDeviceControllerStartupParameters.h | 16 +++++++++++- ...eviceControllerStartupParameters_Wrapper.h | 25 +++++++++++++++++++ .../CHIP/MTRDeviceControllerStartupParams.mm | 4 +++ ...TRDeviceControllerStartupParams_Internal.h | 4 +++ .../CHIP/MTRDeviceControllerStorageDelegate.h | 16 +++++++++++- ...RDeviceControllerStorageDelegate_Wrapper.h | 25 +++++++++++++++++++ .../CHIP/MTRDeviceController_Internal.h | 11 ++++++++ src/darwin/Framework/CHIP/Matter.h | 4 +++ .../CHIPTests/MTRControllerAdvertisingTests.m | 4 +++ .../CHIPTests/MTRPerControllerStorageTests.m | 4 +++ .../TestHelpers/MTRTestPerControllerStorage.h | 4 +++ .../TestHelpers/MTRTestPerControllerStorage.m | 4 +++ 18 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 1eddaec04a8667..99306feef42225 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -116,6 +116,8 @@ jobs: # -enableUndefinedBehaviorSanitizer instruments the code in Matter.framework, # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO > >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) + # And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned on. + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2) # -enableThreadSanitizer instruments the code in Matter.framework, # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_TSAN=YES xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_TSAN=YES CHIP_IS_BLE=NO > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) diff --git a/src/darwin/Framework/CHIP/MTRDefines.h b/src/darwin/Framework/CHIP/MTRDefines.h index dab6250019e325..206ae4d856fcc5 100644 --- a/src/darwin/Framework/CHIP/MTRDefines.h +++ b/src/darwin/Framework/CHIP/MTRDefines.h @@ -53,12 +53,20 @@ #define MTR_NEWLY_AVAILABLE #endif -#if defined(MTR_ENABLE_PROVISIONAL) && MTR_ENABLE_PROVISIONAL +#if !defined(MTR_ENABLE_PROVISIONAL) +#define MTR_ENABLE_PROVISIONAL 0 +#endif + +#if MTR_ENABLE_PROVISIONAL #define MTR_PROVISIONALLY_AVAILABLE MTR_NEWLY_AVAILABLE #else #define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE MTR_HIDDEN #endif +#ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED +#define MTR_PER_CONTROLLER_STORAGE_ENABLED 0 +#endif + #pragma mark - Types typedef NSData * MTRTLVBytes; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index 670e12bbd0caaf..d8636796707946 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -47,10 +47,12 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS */ @property (readonly, nonatomic, getter=isRunning) BOOL running; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * The ID assigned to this controller at creation time. */ @property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Return the Node ID assigned to the controller. Will return nil if the diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h index 8d10c7af3e810b..3abab9ea48adcc 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h @@ -17,7 +17,11 @@ #import #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h index 6471db8b005ccb..5cb4b7c7fd188f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h @@ -22,7 +22,12 @@ #import #import +#import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +@class MTRDeviceControllerStartupParameters; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED NS_ASSUME_NONNULL_BEGIN @@ -93,12 +98,15 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (instancetype)initWithStorage:(id)storage; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /* * Initialize the device controller factory without storage. In this mode, * device controllers will need to have per-controller storage provided to allow * storing controller-specific information. */ - (instancetype)init MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + @end API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @@ -180,6 +188,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Create an MTRDeviceController. Returns nil on failure. * @@ -191,6 +200,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 195fb61f5c7b6a..31b261ad74b79a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -34,6 +34,9 @@ #import "MTRPersistentStorageDelegateBridge.h" #import "MTRSessionResumptionStorageBridge.h" #import "NSDataSpanConversion.h" +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h index 0fca31906c2e3b..7b69f0f3d96531 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h @@ -15,13 +15,22 @@ */ #import - #import + +#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) +#error Internal includes should not happen from the umbrella header +#endif + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) + #import #import NS_ASSUME_NONNULL_BEGIN +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_HIDDEN +#endif MTR_NEWLY_AVAILABLE @interface MTRDeviceControllerStartupParameters : NSObject @@ -68,6 +77,9 @@ MTR_NEWLY_AVAILABLE @end +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_HIDDEN +#endif MTR_NEWLY_AVAILABLE @interface MTRDeviceControllerExternalCertificateStartupParameters : MTRDeviceControllerStartupParameters @@ -119,3 +131,5 @@ MTR_NEWLY_AVAILABLE @end NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h new file mode 100644 index 00000000000000..537958dabf37fb --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2023 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 + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#error Should be including Matter/MTRDeviceControllerStartupParameters.h +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + +#define MTR_INTERNAL_INCLUDE +#import +#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 7bbcea96183035..3da8a906c0886d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -23,7 +23,11 @@ #import "MTRP256KeypairBridge.h" #import "NSDataSpanConversion.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 734197ef72d2d6..9d52067d510982 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -20,7 +20,11 @@ #import #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h index 1fee9c65ae460c..2a322eb07f799a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h @@ -15,8 +15,15 @@ */ #import +#import #import +#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) +#error Internal includes should not happen from the umbrella header +#endif + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) + NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSUInteger, MTRStorageSecurityLevel) { @@ -105,6 +112,13 @@ MTR_NEWLY_AVAILABLE @end // TODO: FIXME: Is this a sane place to put this API? -MTR_EXTERN MTR_NEWLY_AVAILABLE NSSet * MTRDeviceControllerStorageClasses(void); +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_EXTERN +#else +MTR_HIDDEN +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_NEWLY_AVAILABLE NSSet * MTRDeviceControllerStorageClasses(void); NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h new file mode 100644 index 00000000000000..774fff9f48a179 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2023 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 + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#error Should be including Matter/MTRDeviceControllerStorageDelegate.h +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + +#define MTR_INTERNAL_INCLUDE +#import +#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 6ff5843f622513..2f86a4edb88fec 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -32,7 +32,11 @@ #import "MTRDeviceControllerDataStore.h" #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import @class MTRDeviceControllerStartupParamsInternal; @@ -51,6 +55,13 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController () +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +/** + * The ID assigned to this controller at creation time. + */ +@property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #pragma mark - MTRDeviceControllerFactory methods /** diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 26c74cd80487d2..63c067f48d084d 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -17,6 +17,8 @@ #import +#define MTR_INCLUDED_FROM_UMBRELLA_HEADER + #import #import #import @@ -57,3 +59,5 @@ #import #import #import + +#undef MTR_INCLUDED_FROM_UMBRELLA_HEADER diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m index 1276e0ce845bca..549d66ec3826a5 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -24,6 +24,8 @@ #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + static const uint16_t kTestVendorId = 0xFFF1u; static const uint16_t kTimeoutInSeconds = 3; @@ -295,3 +297,5 @@ - (void)test001_CheckAdvertisingAsExpected } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 894eb5f3893464..f81cc23af4e44e 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -25,6 +25,8 @@ #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; @@ -1055,3 +1057,5 @@ - (void)test007_TestMultipleControllers } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h index b3052a9929a1af..427d537e07b485 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h @@ -17,6 +17,8 @@ #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + NS_ASSUME_NONNULL_BEGIN @interface MTRTestPerControllerStorage : NSObject @@ -41,3 +43,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m index 1898bd14832cf9..1a453d5eaec281 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m @@ -18,6 +18,8 @@ #import "MTRTestPerControllerStorage.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + @interface MTRTestPerControllerStorage () @property (nonatomic, readonly) NSMutableDictionary * storage; @end @@ -83,3 +85,5 @@ - (BOOL)controller:(MTRDeviceController *)controller } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED From 8a898ef58beb7ab3a5697a43d397d4c5470391d5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 17:36:19 -0400 Subject: [PATCH 58/96] Make MTRDecodeAttributeValue support global attributes in custom clusters. (#29022) For global attributes we know the schema even if the cluster is custom. --- .../MTRAttributeTLVValueDecoder-src.zapt | 44 + .../MTRAttributeTLVValueDecoder.mm | 24472 ++++------------ .../CHIPTests/MTRDataValueParserTests.m | 55 + 3 files changed, 6316 insertions(+), 18255 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt index ec2c1f7d3b70f7..2b70a99a06701d 100644 --- a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt @@ -12,10 +12,48 @@ #include #include #include +#include using namespace chip; using namespace chip::app; +static id _Nullable DecodeGlobalAttributeValue(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Globals; + switch (aAttributeId) { + {{#zcl_attributes_server removeKeys='isOptional'}} + {{#unless clusterRef}} + {{#if (isSupported "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + {{#if (isProvisional "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + #if MTR_ENABLE_PROVISIONAL + {{/if}} + case Attributes::{{asUpperCamelCase name}}::Id: { + using TypeInfo = Attributes::{{asUpperCamelCase name}}::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nil; + } + {{asObjectiveCType type ""}} value; + {{>decode_value target="value" source="cppValue" cluster="" errorCode="*aError = err; return nil;" depth=0}} + return value; + } + {{#if (isProvisional "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + #endif // MTR_ENABLE_PROVISIONAL + {{/if}} + {{/if}} + {{/unless}} + {{/zcl_attributes_server}} + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} + {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcronyms=true}}Cluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) @@ -23,6 +61,7 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron using namespace Clusters::{{asUpperCamelCase name}}; switch (aAttributeId) { {{#zcl_attributes_server removeKeys='isOptional'}} + {{#if clusterRef}} {{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if (isProvisional (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} #if MTR_ENABLE_PROVISIONAL @@ -43,6 +82,7 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron #endif // MTR_ENABLE_PROVISIONAL {{/if}} {{/if}} + {{/if}} {{/zcl_attributes_server}} default: { break; @@ -57,6 +97,10 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { + if (IsGlobalAttribute(aPath.mAttributeId)) { + return DecodeGlobalAttributeValue(aPath.mAttributeId, aReader, aError); + } + switch (aPath.mClusterId) { {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index d6490491f078a3..8df1187874fd12 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -26,37 +26,16 @@ #include #include #include +#include #include using namespace chip; using namespace chip::app; -static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeGlobalAttributeValue(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Identify; + using namespace Clusters::Globals; switch (aAttributeId) { - case Attributes::IdentifyTime::Id: { - using TypeInfo = Attributes::IdentifyTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::IdentifyType::Id: { - using TypeInfo = Attributes::IdentifyType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -193,147 +172,54 @@ static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttribut *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForGroupsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) + +static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Groups; + using namespace Clusters::Identify; switch (aAttributeId) { - case Attributes::NameSupport::Id: { - using TypeInfo = Attributes::NameSupport::TypeInfo; + case Attributes::IdentifyTime::Id: { + using TypeInfo = Attributes::IdentifyTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::IdentifyType::Id: { + using TypeInfo = Attributes::IdentifyType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; + default: { + break; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGroupsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Groups; + switch (aAttributeId) { + case Attributes::NameSupport::Id: { + using TypeInfo = Attributes::NameSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } default: { @@ -444,132 +330,110 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OnOff; + switch (aAttributeId) { + case Attributes::OnOff::Id: { + using TypeInfo = Attributes::OnOff::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::GlobalSceneControl::Id: { + using TypeInfo = Attributes::GlobalSceneControl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OnTime::Id: { + using TypeInfo = Attributes::OnTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::OffWaitTime::Id: { + using TypeInfo = Attributes::OffWaitTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::StartUpOnOff::Id: { + using TypeInfo = Attributes::StartUpOnOff::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OnOffSwitchConfiguration; + switch (aAttributeId) { + case Attributes::SwitchType::Id: { + using TypeInfo = Attributes::SwitchType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::SwitchActions::Id: { + using TypeInfo = Attributes::SwitchActions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -580,45 +444,61 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForLevelControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OnOff; + using namespace Clusters::LevelControl; switch (aAttributeId) { - case Attributes::OnOff::Id: { - using TypeInfo = Attributes::OnOff::TypeInfo; + case Attributes::CurrentLevel::Id: { + using TypeInfo = Attributes::CurrentLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::RemainingTime::Id: { + using TypeInfo = Attributes::RemainingTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GlobalSceneControl::Id: { - using TypeInfo = Attributes::GlobalSceneControl::TypeInfo; + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OnTime::Id: { - using TypeInfo = Attributes::OnTime::TypeInfo; + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OffWaitTime::Id: { - using TypeInfo = Attributes::OffWaitTime::TypeInfo; + case Attributes::CurrentFrequency::Id: { + using TypeInfo = Attributes::CurrentFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -628,147 +508,123 @@ static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::StartUpOnOff::Id: { - using TypeInfo = Attributes::StartUpOnOff::TypeInfo; + case Attributes::MinFrequency::Id: { + using TypeInfo = Attributes::MinFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::MaxFrequency::Id: { + using TypeInfo = Attributes::MaxFrequency::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Options::Id: { + using TypeInfo = Attributes::Options::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::OnOffTransitionTime::Id: { + using TypeInfo = Attributes::OnOffTransitionTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::OnLevel::Id: { + using TypeInfo = Attributes::OnLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OnTransitionTime::Id: { + using TypeInfo = Attributes::OnTransitionTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::OffTransitionTime::Id: { + using TypeInfo = Attributes::OffTransitionTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::DefaultMoveRate::Id: { + using TypeInfo = Attributes::DefaultMoveRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::StartUpCurrentLevel::Id: { + using TypeInfo = Attributes::StartUpCurrentLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } default: { @@ -779,24 +635,94 @@ static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( +static id _Nullable DecodeAttributeValueForBinaryInputBasicCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OnOffSwitchConfiguration; + using namespace Clusters::BinaryInputBasic; switch (aAttributeId) { - case Attributes::SwitchType::Id: { - using TypeInfo = Attributes::SwitchType::TypeInfo; + case Attributes::ActiveText::Id: { + using TypeInfo = Attributes::ActiveText::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::InactiveText::Id: { + using TypeInfo = Attributes::InactiveText::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::OutOfService::Id: { + using TypeInfo = Attributes::OutOfService::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Polarity::Id: { + using TypeInfo = Attributes::Polarity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::SwitchActions::Id: { - using TypeInfo = Attributes::SwitchActions::TypeInfo; + case Attributes::PresentValue::Id: { + using TypeInfo = Attributes::PresentValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Reliability::Id: { + using TypeInfo = Attributes::Reliability::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -806,8 +732,56 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::StatusFlags::Id: { + using TypeInfo = Attributes::StatusFlags::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::ApplicationType::Id: { + using TypeInfo = Attributes::ApplicationType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPulseWidthModulationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PulseWidthModulation; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDescriptorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Descriptor; + switch (aAttributeId) { + case Attributes::DeviceTypeList::Id: { + using TypeInfo = Attributes::DeviceTypeList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -819,8 +793,10 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRDescriptorClusterDeviceTypeStruct * newElement_0; + newElement_0 = [MTRDescriptorClusterDeviceTypeStruct new]; + newElement_0.deviceType = [NSNumber numberWithUnsignedInt:entry_0.deviceType]; + newElement_0.revision = [NSNumber numberWithUnsignedShort:entry_0.revision]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -832,8 +808,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ServerList::Id: { + using TypeInfo = Attributes::ServerList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -858,9 +834,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ClientList::Id: { + using TypeInfo = Attributes::ClientList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -885,9 +860,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PartsList::Id: { + using TypeInfo = Attributes::PartsList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -900,7 +874,7 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -912,28 +886,55 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::TagList::Id: { + using TypeInfo = Attributes::TagList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRDescriptorClusterSemanticTagStruct * newElement_0; + newElement_0 = [MTRDescriptorClusterSemanticTagStruct new]; + if (entry_0.mfgCode.IsNull()) { + newElement_0.mfgCode = nil; + } else { + newElement_0.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.mfgCode.Value())]; + } + newElement_0.namespaceID = [NSNumber numberWithUnsignedChar:entry_0.namespaceID]; + newElement_0.tag = [NSNumber numberWithUnsignedChar:entry_0.tag]; + if (entry_0.label.HasValue()) { + if (entry_0.label.Value().IsNull()) { + newElement_0.label = nil; + } else { + newElement_0.label = AsString(entry_0.label.Value().Value()); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + newElement_0.label = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -942,10952 +943,57 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForLevelControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForBindingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::LevelControl; + using namespace Clusters::Binding; switch (aAttributeId) { - case Attributes::CurrentLevel::Id: { - using TypeInfo = Attributes::CurrentLevel::TypeInfo; + case Attributes::Binding::Id: { + using TypeInfo = Attributes::Binding::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRBindingClusterTargetStruct * newElement_0; + newElement_0 = [MTRBindingClusterTargetStruct new]; + if (entry_0.node.HasValue()) { + newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; + } else { + newElement_0.node = nil; + } + if (entry_0.group.HasValue()) { + newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; + } else { + newElement_0.group = nil; + } + if (entry_0.endpoint.HasValue()) { + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; + } else { + newElement_0.endpoint = nil; + } + if (entry_0.cluster.HasValue()) { + newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; + } else { + newElement_0.cluster = nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::RemainingTime::Id: { - using TypeInfo = Attributes::RemainingTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MinLevel::Id: { - using TypeInfo = Attributes::MinLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MaxLevel::Id: { - using TypeInfo = Attributes::MaxLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CurrentFrequency::Id: { - using TypeInfo = Attributes::CurrentFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MinFrequency::Id: { - using TypeInfo = Attributes::MinFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MaxFrequency::Id: { - using TypeInfo = Attributes::MaxFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Options::Id: { - using TypeInfo = Attributes::Options::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::OnOffTransitionTime::Id: { - using TypeInfo = Attributes::OnOffTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::OnLevel::Id: { - using TypeInfo = Attributes::OnLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnTransitionTime::Id: { - using TypeInfo = Attributes::OnTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::OffTransitionTime::Id: { - using TypeInfo = Attributes::OffTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::DefaultMoveRate::Id: { - using TypeInfo = Attributes::DefaultMoveRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::StartUpCurrentLevel::Id: { - using TypeInfo = Attributes::StartUpCurrentLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBinaryInputBasicCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BinaryInputBasic; - switch (aAttributeId) { - case Attributes::ActiveText::Id: { - using TypeInfo = Attributes::ActiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::InactiveText::Id: { - using TypeInfo = Attributes::InactiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::OutOfService::Id: { - using TypeInfo = Attributes::OutOfService::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Polarity::Id: { - using TypeInfo = Attributes::Polarity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::PresentValue::Id: { - using TypeInfo = Attributes::PresentValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Reliability::Id: { - using TypeInfo = Attributes::Reliability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::StatusFlags::Id: { - using TypeInfo = Attributes::StatusFlags::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::ApplicationType::Id: { - using TypeInfo = Attributes::ApplicationType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPulseWidthModulationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PulseWidthModulation; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForDescriptorCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Descriptor; - switch (aAttributeId) { - case Attributes::DeviceTypeList::Id: { - using TypeInfo = Attributes::DeviceTypeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRDescriptorClusterDeviceTypeStruct * newElement_0; - newElement_0 = [MTRDescriptorClusterDeviceTypeStruct new]; - newElement_0.deviceType = [NSNumber numberWithUnsignedInt:entry_0.deviceType]; - newElement_0.revision = [NSNumber numberWithUnsignedShort:entry_0.revision]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ServerList::Id: { - using TypeInfo = Attributes::ServerList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ClientList::Id: { - using TypeInfo = Attributes::ClientList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::PartsList::Id: { - using TypeInfo = Attributes::PartsList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::TagList::Id: { - using TypeInfo = Attributes::TagList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRDescriptorClusterSemanticTagStruct * newElement_0; - newElement_0 = [MTRDescriptorClusterSemanticTagStruct new]; - if (entry_0.mfgCode.IsNull()) { - newElement_0.mfgCode = nil; - } else { - newElement_0.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.mfgCode.Value())]; - } - newElement_0.namespaceID = [NSNumber numberWithUnsignedChar:entry_0.namespaceID]; - newElement_0.tag = [NSNumber numberWithUnsignedChar:entry_0.tag]; - if (entry_0.label.HasValue()) { - if (entry_0.label.Value().IsNull()) { - newElement_0.label = nil; - } else { - newElement_0.label = AsString(entry_0.label.Value().Value()); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - } else { - newElement_0.label = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBindingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Binding; - switch (aAttributeId) { - case Attributes::Binding::Id: { - using TypeInfo = Attributes::Binding::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRBindingClusterTargetStruct * newElement_0; - newElement_0 = [MTRBindingClusterTargetStruct new]; - if (entry_0.node.HasValue()) { - newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; - } else { - newElement_0.node = nil; - } - if (entry_0.group.HasValue()) { - newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; - } else { - newElement_0.group = nil; - } - if (entry_0.endpoint.HasValue()) { - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; - } else { - newElement_0.endpoint = nil; - } - if (entry_0.cluster.HasValue()) { - newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; - } else { - newElement_0.cluster = nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAccessControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AccessControl; - switch (aAttributeId) { - case Attributes::Acl::Id: { - using TypeInfo = Attributes::Acl::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAccessControlClusterAccessControlEntryStruct * newElement_0; - newElement_0 = [MTRAccessControlClusterAccessControlEntryStruct new]; - newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; - newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; - if (entry_0.subjects.IsNull()) { - newElement_0.subjects = nil; - } else { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_0.subjects.Value().begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - NSNumber * newElement_3; - newElement_3 = [NSNumber numberWithUnsignedLongLong:entry_3]; - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.subjects = array_3; - } - } - if (entry_0.targets.IsNull()) { - newElement_0.targets = nil; - } else { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_0.targets.Value().begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTRAccessControlClusterAccessControlTargetStruct * newElement_3; - newElement_3 = [MTRAccessControlClusterAccessControlTargetStruct new]; - if (entry_3.cluster.IsNull()) { - newElement_3.cluster = nil; - } else { - newElement_3.cluster = [NSNumber numberWithUnsignedInt:entry_3.cluster.Value()]; - } - if (entry_3.endpoint.IsNull()) { - newElement_3.endpoint = nil; - } else { - newElement_3.endpoint = [NSNumber numberWithUnsignedShort:entry_3.endpoint.Value()]; - } - if (entry_3.deviceType.IsNull()) { - newElement_3.deviceType = nil; - } else { - newElement_3.deviceType = [NSNumber numberWithUnsignedInt:entry_3.deviceType.Value()]; - } - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.targets = array_3; - } - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::Extension::Id: { - using TypeInfo = Attributes::Extension::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAccessControlClusterAccessControlExtensionStruct * newElement_0; - newElement_0 = [MTRAccessControlClusterAccessControlExtensionStruct new]; - newElement_0.data = AsData(entry_0.data); - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SubjectsPerAccessControlEntry::Id: { - using TypeInfo = Attributes::SubjectsPerAccessControlEntry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::TargetsPerAccessControlEntry::Id: { - using TypeInfo = Attributes::TargetsPerAccessControlEntry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AccessControlEntriesPerFabric::Id: { - using TypeInfo = Attributes::AccessControlEntriesPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForActionsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Actions; - switch (aAttributeId) { - case Attributes::ActionList::Id: { - using TypeInfo = Attributes::ActionList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRActionsClusterActionStruct * newElement_0; - newElement_0 = [MTRActionsClusterActionStruct new]; - newElement_0.actionID = [NSNumber numberWithUnsignedShort:entry_0.actionID]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; - newElement_0.supportedCommands = [NSNumber numberWithUnsignedShort:entry_0.supportedCommands.Raw()]; - newElement_0.state = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.state)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::EndpointLists::Id: { - using TypeInfo = Attributes::EndpointLists::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRActionsClusterEndpointListStruct * newElement_0; - newElement_0 = [MTRActionsClusterEndpointListStruct new]; - newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.endpoints.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.endpoints = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SetupURL::Id: { - using TypeInfo = Attributes::SetupURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBasicInformationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BasicInformation; - switch (aAttributeId) { - case Attributes::DataModelRevision::Id: { - using TypeInfo = Attributes::DataModelRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Location::Id: { - using TypeInfo = Attributes::Location::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::LocalConfigDisabled::Id: { - using TypeInfo = Attributes::LocalConfigDisabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::CapabilityMinima::Id: { - using TypeInfo = Attributes::CapabilityMinima::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBasicInformationClusterCapabilityMinimaStruct * _Nonnull value; - value = [MTRBasicInformationClusterCapabilityMinimaStruct new]; - value.caseSessionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.caseSessionsPerFabric]; - value.subscriptionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.subscriptionsPerFabric]; - return value; - } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBasicInformationClusterProductAppearanceStruct * _Nonnull value; - value = [MTRBasicInformationClusterProductAppearanceStruct new]; - value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; - if (cppValue.primaryColor.IsNull()) { - value.primaryColor = nil; - } else { - value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOTASoftwareUpdateProviderCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OtaSoftwareUpdateProvider; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOTASoftwareUpdateRequestorCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OtaSoftwareUpdateRequestor; - switch (aAttributeId) { - case Attributes::DefaultOTAProviders::Id: { - using TypeInfo = Attributes::DefaultOTAProviders::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROTASoftwareUpdateRequestorClusterProviderLocation * newElement_0; - newElement_0 = [MTROTASoftwareUpdateRequestorClusterProviderLocation new]; - newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::UpdatePossible::Id: { - using TypeInfo = Attributes::UpdatePossible::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UpdateState::Id: { - using TypeInfo = Attributes::UpdateState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::UpdateStateProgress::Id: { - using TypeInfo = Attributes::UpdateStateProgress::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLocalizationConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LocalizationConfiguration; - switch (aAttributeId) { - case Attributes::ActiveLocale::Id: { - using TypeInfo = Attributes::ActiveLocale::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SupportedLocales::Id: { - using TypeInfo = Attributes::SupportedLocales::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTimeFormatLocalizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TimeFormatLocalization; - switch (aAttributeId) { - case Attributes::HourFormat::Id: { - using TypeInfo = Attributes::HourFormat::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ActiveCalendarType::Id: { - using TypeInfo = Attributes::ActiveCalendarType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::SupportedCalendarTypes::Id: { - using TypeInfo = Attributes::SupportedCalendarTypes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForUnitLocalizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::UnitLocalization; - switch (aAttributeId) { - case Attributes::TemperatureUnit::Id: { - using TypeInfo = Attributes::TemperatureUnit::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPowerSourceConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PowerSourceConfiguration; - switch (aAttributeId) { - case Attributes::Sources::Id: { - using TypeInfo = Attributes::Sources::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPowerSourceCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PowerSource; - switch (aAttributeId) { - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::Order::Id: { - using TypeInfo = Attributes::Order::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::WiredAssessedInputVoltage::Id: { - using TypeInfo = Attributes::WiredAssessedInputVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::WiredAssessedInputFrequency::Id: { - using TypeInfo = Attributes::WiredAssessedInputFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::WiredCurrentType::Id: { - using TypeInfo = Attributes::WiredCurrentType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::WiredAssessedCurrent::Id: { - using TypeInfo = Attributes::WiredAssessedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::WiredNominalVoltage::Id: { - using TypeInfo = Attributes::WiredNominalVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::WiredMaximumCurrent::Id: { - using TypeInfo = Attributes::WiredMaximumCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::WiredPresent::Id: { - using TypeInfo = Attributes::WiredPresent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::ActiveWiredFaults::Id: { - using TypeInfo = Attributes::ActiveWiredFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::BatVoltage::Id: { - using TypeInfo = Attributes::BatVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatPercentRemaining::Id: { - using TypeInfo = Attributes::BatPercentRemaining::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::BatTimeRemaining::Id: { - using TypeInfo = Attributes::BatTimeRemaining::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatChargeLevel::Id: { - using TypeInfo = Attributes::BatChargeLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatReplacementNeeded::Id: { - using TypeInfo = Attributes::BatReplacementNeeded::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::BatReplaceability::Id: { - using TypeInfo = Attributes::BatReplaceability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatPresent::Id: { - using TypeInfo = Attributes::BatPresent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::ActiveBatFaults::Id: { - using TypeInfo = Attributes::ActiveBatFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::BatReplacementDescription::Id: { - using TypeInfo = Attributes::BatReplacementDescription::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatCommonDesignation::Id: { - using TypeInfo = Attributes::BatCommonDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatANSIDesignation::Id: { - using TypeInfo = Attributes::BatANSIDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatIECDesignation::Id: { - using TypeInfo = Attributes::BatIECDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatApprovedChemistry::Id: { - using TypeInfo = Attributes::BatApprovedChemistry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatCapacity::Id: { - using TypeInfo = Attributes::BatCapacity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::BatQuantity::Id: { - using TypeInfo = Attributes::BatQuantity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BatChargeState::Id: { - using TypeInfo = Attributes::BatChargeState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatTimeToFullCharge::Id: { - using TypeInfo = Attributes::BatTimeToFullCharge::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatFunctionalWhileCharging::Id: { - using TypeInfo = Attributes::BatFunctionalWhileCharging::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::BatChargingCurrent::Id: { - using TypeInfo = Attributes::BatChargingCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::ActiveBatChargeFaults::Id: { - using TypeInfo = Attributes::ActiveBatChargeFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EndpointList::Id: { - using TypeInfo = Attributes::EndpointList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GeneralCommissioning; - switch (aAttributeId) { - case Attributes::Breadcrumb::Id: { - using TypeInfo = Attributes::Breadcrumb::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::BasicCommissioningInfo::Id: { - using TypeInfo = Attributes::BasicCommissioningInfo::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull value; - value = [MTRGeneralCommissioningClusterBasicCommissioningInfo new]; - value.failSafeExpiryLengthSeconds = [NSNumber numberWithUnsignedShort:cppValue.failSafeExpiryLengthSeconds]; - value.maxCumulativeFailsafeSeconds = [NSNumber numberWithUnsignedShort:cppValue.maxCumulativeFailsafeSeconds]; - return value; - } - case Attributes::RegulatoryConfig::Id: { - using TypeInfo = Attributes::RegulatoryConfig::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::LocationCapability::Id: { - using TypeInfo = Attributes::LocationCapability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::SupportsConcurrentConnection::Id: { - using TypeInfo = Attributes::SupportsConcurrentConnection::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::NetworkCommissioning; - switch (aAttributeId) { - case Attributes::MaxNetworks::Id: { - using TypeInfo = Attributes::MaxNetworks::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::Networks::Id: { - using TypeInfo = Attributes::Networks::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRNetworkCommissioningClusterNetworkInfoStruct * newElement_0; - newElement_0 = [MTRNetworkCommissioningClusterNetworkInfoStruct new]; - newElement_0.networkID = AsData(entry_0.networkID); - newElement_0.connected = [NSNumber numberWithBool:entry_0.connected]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ScanMaxTimeSeconds::Id: { - using TypeInfo = Attributes::ScanMaxTimeSeconds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::ConnectMaxTimeSeconds::Id: { - using TypeInfo = Attributes::ConnectMaxTimeSeconds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::InterfaceEnabled::Id: { - using TypeInfo = Attributes::InterfaceEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::LastNetworkingStatus::Id: { - using TypeInfo = Attributes::LastNetworkingStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::LastNetworkID::Id: { - using TypeInfo = Attributes::LastNetworkID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::LastConnectErrorValue::Id: { - using TypeInfo = Attributes::LastConnectErrorValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithInt:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForDiagnosticLogsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::DiagnosticLogs; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGeneralDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GeneralDiagnostics; - switch (aAttributeId) { - case Attributes::NetworkInterfaces::Id: { - using TypeInfo = Attributes::NetworkInterfaces::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGeneralDiagnosticsClusterNetworkInterface * newElement_0; - newElement_0 = [MTRGeneralDiagnosticsClusterNetworkInterface new]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.isOperational = [NSNumber numberWithBool:entry_0.isOperational]; - if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { - newElement_0.offPremiseServicesReachableIPv4 = nil; - } else { - newElement_0.offPremiseServicesReachableIPv4 = - [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; - } - if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { - newElement_0.offPremiseServicesReachableIPv6 = nil; - } else { - newElement_0.offPremiseServicesReachableIPv6 = - [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; - } - newElement_0.hardwareAddress = AsData(entry_0.hardwareAddress); - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.IPv4Addresses.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = AsData(entry_2); - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.iPv4Addresses = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.IPv6Addresses.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = AsData(entry_2); - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.iPv6Addresses = array_2; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::RebootCount::Id: { - using TypeInfo = Attributes::RebootCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::UpTime::Id: { - using TypeInfo = Attributes::UpTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::TotalOperationalHours::Id: { - using TypeInfo = Attributes::TotalOperationalHours::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::BootReason::Id: { - using TypeInfo = Attributes::BootReason::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ActiveHardwareFaults::Id: { - using TypeInfo = Attributes::ActiveHardwareFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ActiveRadioFaults::Id: { - using TypeInfo = Attributes::ActiveRadioFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ActiveNetworkFaults::Id: { - using TypeInfo = Attributes::ActiveNetworkFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::TestEventTriggersEnabled::Id: { - using TypeInfo = Attributes::TestEventTriggersEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSoftwareDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::SoftwareDiagnostics; - switch (aAttributeId) { - case Attributes::ThreadMetrics::Id: { - using TypeInfo = Attributes::ThreadMetrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRSoftwareDiagnosticsClusterThreadMetricsStruct * newElement_0; - newElement_0 = [MTRSoftwareDiagnosticsClusterThreadMetricsStruct new]; - newElement_0.id = [NSNumber numberWithUnsignedLongLong:entry_0.id]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - if (entry_0.stackFreeCurrent.HasValue()) { - newElement_0.stackFreeCurrent = [NSNumber numberWithUnsignedInt:entry_0.stackFreeCurrent.Value()]; - } else { - newElement_0.stackFreeCurrent = nil; - } - if (entry_0.stackFreeMinimum.HasValue()) { - newElement_0.stackFreeMinimum = [NSNumber numberWithUnsignedInt:entry_0.stackFreeMinimum.Value()]; - } else { - newElement_0.stackFreeMinimum = nil; - } - if (entry_0.stackSize.HasValue()) { - newElement_0.stackSize = [NSNumber numberWithUnsignedInt:entry_0.stackSize.Value()]; - } else { - newElement_0.stackSize = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentHeapFree::Id: { - using TypeInfo = Attributes::CurrentHeapFree::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CurrentHeapUsed::Id: { - using TypeInfo = Attributes::CurrentHeapUsed::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CurrentHeapHighWatermark::Id: { - using TypeInfo = Attributes::CurrentHeapHighWatermark::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForThreadNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ThreadNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::Channel::Id: { - using TypeInfo = Attributes::Channel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::RoutingRole::Id: { - using TypeInfo = Attributes::RoutingRole::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::NetworkName::Id: { - using TypeInfo = Attributes::NetworkName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsString(cppValue.Value()); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - return value; - } - case Attributes::PanId::Id: { - using TypeInfo = Attributes::PanId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::ExtendedPanId::Id: { - using TypeInfo = Attributes::ExtendedPanId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::MeshLocalPrefix::Id: { - using TypeInfo = Attributes::MeshLocalPrefix::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::NeighborTable::Id: { - using TypeInfo = Attributes::NeighborTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRThreadNetworkDiagnosticsClusterNeighborTableStruct * newElement_0; - newElement_0 = [MTRThreadNetworkDiagnosticsClusterNeighborTableStruct new]; - newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; - newElement_0.age = [NSNumber numberWithUnsignedInt:entry_0.age]; - newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; - newElement_0.linkFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.linkFrameCounter]; - newElement_0.mleFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.mleFrameCounter]; - newElement_0.lqi = [NSNumber numberWithUnsignedChar:entry_0.lqi]; - if (entry_0.averageRssi.IsNull()) { - newElement_0.averageRssi = nil; - } else { - newElement_0.averageRssi = [NSNumber numberWithChar:entry_0.averageRssi.Value()]; - } - if (entry_0.lastRssi.IsNull()) { - newElement_0.lastRssi = nil; - } else { - newElement_0.lastRssi = [NSNumber numberWithChar:entry_0.lastRssi.Value()]; - } - newElement_0.frameErrorRate = [NSNumber numberWithUnsignedChar:entry_0.frameErrorRate]; - newElement_0.messageErrorRate = [NSNumber numberWithUnsignedChar:entry_0.messageErrorRate]; - newElement_0.rxOnWhenIdle = [NSNumber numberWithBool:entry_0.rxOnWhenIdle]; - newElement_0.fullThreadDevice = [NSNumber numberWithBool:entry_0.fullThreadDevice]; - newElement_0.fullNetworkData = [NSNumber numberWithBool:entry_0.fullNetworkData]; - newElement_0.isChild = [NSNumber numberWithBool:entry_0.isChild]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::RouteTable::Id: { - using TypeInfo = Attributes::RouteTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRThreadNetworkDiagnosticsClusterRouteTableStruct * newElement_0; - newElement_0 = [MTRThreadNetworkDiagnosticsClusterRouteTableStruct new]; - newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; - newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; - newElement_0.routerId = [NSNumber numberWithUnsignedChar:entry_0.routerId]; - newElement_0.nextHop = [NSNumber numberWithUnsignedChar:entry_0.nextHop]; - newElement_0.pathCost = [NSNumber numberWithUnsignedChar:entry_0.pathCost]; - newElement_0.lqiIn = [NSNumber numberWithUnsignedChar:entry_0.LQIIn]; - newElement_0.lqiOut = [NSNumber numberWithUnsignedChar:entry_0.LQIOut]; - newElement_0.age = [NSNumber numberWithUnsignedChar:entry_0.age]; - newElement_0.allocated = [NSNumber numberWithBool:entry_0.allocated]; - newElement_0.linkEstablished = [NSNumber numberWithBool:entry_0.linkEstablished]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::PartitionId::Id: { - using TypeInfo = Attributes::PartitionId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::Weighting::Id: { - using TypeInfo = Attributes::Weighting::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::DataVersion::Id: { - using TypeInfo = Attributes::DataVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::StableDataVersion::Id: { - using TypeInfo = Attributes::StableDataVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::LeaderRouterId::Id: { - using TypeInfo = Attributes::LeaderRouterId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::DetachedRoleCount::Id: { - using TypeInfo = Attributes::DetachedRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ChildRoleCount::Id: { - using TypeInfo = Attributes::ChildRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::RouterRoleCount::Id: { - using TypeInfo = Attributes::RouterRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::LeaderRoleCount::Id: { - using TypeInfo = Attributes::LeaderRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AttachAttemptCount::Id: { - using TypeInfo = Attributes::AttachAttemptCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::PartitionIdChangeCount::Id: { - using TypeInfo = Attributes::PartitionIdChangeCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::BetterPartitionAttachAttemptCount::Id: { - using TypeInfo = Attributes::BetterPartitionAttachAttemptCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ParentChangeCount::Id: { - using TypeInfo = Attributes::ParentChangeCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::TxTotalCount::Id: { - using TypeInfo = Attributes::TxTotalCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxUnicastCount::Id: { - using TypeInfo = Attributes::TxUnicastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBroadcastCount::Id: { - using TypeInfo = Attributes::TxBroadcastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxAckRequestedCount::Id: { - using TypeInfo = Attributes::TxAckRequestedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxAckedCount::Id: { - using TypeInfo = Attributes::TxAckedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxNoAckRequestedCount::Id: { - using TypeInfo = Attributes::TxNoAckRequestedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDataCount::Id: { - using TypeInfo = Attributes::TxDataCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDataPollCount::Id: { - using TypeInfo = Attributes::TxDataPollCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBeaconCount::Id: { - using TypeInfo = Attributes::TxBeaconCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBeaconRequestCount::Id: { - using TypeInfo = Attributes::TxBeaconRequestCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxOtherCount::Id: { - using TypeInfo = Attributes::TxOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxRetryCount::Id: { - using TypeInfo = Attributes::TxRetryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDirectMaxRetryExpiryCount::Id: { - using TypeInfo = Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxIndirectMaxRetryExpiryCount::Id: { - using TypeInfo = Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrCcaCount::Id: { - using TypeInfo = Attributes::TxErrCcaCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrAbortCount::Id: { - using TypeInfo = Attributes::TxErrAbortCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrBusyChannelCount::Id: { - using TypeInfo = Attributes::TxErrBusyChannelCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxTotalCount::Id: { - using TypeInfo = Attributes::RxTotalCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxUnicastCount::Id: { - using TypeInfo = Attributes::RxUnicastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBroadcastCount::Id: { - using TypeInfo = Attributes::RxBroadcastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDataCount::Id: { - using TypeInfo = Attributes::RxDataCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDataPollCount::Id: { - using TypeInfo = Attributes::RxDataPollCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBeaconCount::Id: { - using TypeInfo = Attributes::RxBeaconCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBeaconRequestCount::Id: { - using TypeInfo = Attributes::RxBeaconRequestCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxOtherCount::Id: { - using TypeInfo = Attributes::RxOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxAddressFilteredCount::Id: { - using TypeInfo = Attributes::RxAddressFilteredCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDestAddrFilteredCount::Id: { - using TypeInfo = Attributes::RxDestAddrFilteredCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDuplicatedCount::Id: { - using TypeInfo = Attributes::RxDuplicatedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrNoFrameCount::Id: { - using TypeInfo = Attributes::RxErrNoFrameCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrUnknownNeighborCount::Id: { - using TypeInfo = Attributes::RxErrUnknownNeighborCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrInvalidSrcAddrCount::Id: { - using TypeInfo = Attributes::RxErrInvalidSrcAddrCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrSecCount::Id: { - using TypeInfo = Attributes::RxErrSecCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrFcsCount::Id: { - using TypeInfo = Attributes::RxErrFcsCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrOtherCount::Id: { - using TypeInfo = Attributes::RxErrOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveTimestamp::Id: { - using TypeInfo = Attributes::ActiveTimestamp::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::PendingTimestamp::Id: { - using TypeInfo = Attributes::PendingTimestamp::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::Delay::Id: { - using TypeInfo = Attributes::Delay::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::SecurityPolicy::Id: { - using TypeInfo = Attributes::SecurityPolicy::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRThreadNetworkDiagnosticsClusterSecurityPolicy new]; - value.rotationTime = [NSNumber numberWithUnsignedShort:cppValue.Value().rotationTime]; - value.flags = [NSNumber numberWithUnsignedShort:cppValue.Value().flags]; - } - return value; - } - case Attributes::ChannelPage0Mask::Id: { - using TypeInfo = Attributes::ChannelPage0Mask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::OperationalDatasetComponents::Id: { - using TypeInfo = Attributes::OperationalDatasetComponents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents new]; - value.activeTimestampPresent = [NSNumber numberWithBool:cppValue.Value().activeTimestampPresent]; - value.pendingTimestampPresent = [NSNumber numberWithBool:cppValue.Value().pendingTimestampPresent]; - value.masterKeyPresent = [NSNumber numberWithBool:cppValue.Value().masterKeyPresent]; - value.networkNamePresent = [NSNumber numberWithBool:cppValue.Value().networkNamePresent]; - value.extendedPanIdPresent = [NSNumber numberWithBool:cppValue.Value().extendedPanIdPresent]; - value.meshLocalPrefixPresent = [NSNumber numberWithBool:cppValue.Value().meshLocalPrefixPresent]; - value.delayPresent = [NSNumber numberWithBool:cppValue.Value().delayPresent]; - value.panIdPresent = [NSNumber numberWithBool:cppValue.Value().panIdPresent]; - value.channelPresent = [NSNumber numberWithBool:cppValue.Value().channelPresent]; - value.pskcPresent = [NSNumber numberWithBool:cppValue.Value().pskcPresent]; - value.securityPolicyPresent = [NSNumber numberWithBool:cppValue.Value().securityPolicyPresent]; - value.channelMaskPresent = [NSNumber numberWithBool:cppValue.Value().channelMaskPresent]; - } - return value; - } - case Attributes::ActiveNetworkFaultsList::Id: { - using TypeInfo = Attributes::ActiveNetworkFaultsList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForWiFiNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::WiFiNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::Bssid::Id: { - using TypeInfo = Attributes::Bssid::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::SecurityType::Id: { - using TypeInfo = Attributes::SecurityType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::WiFiVersion::Id: { - using TypeInfo = Attributes::WiFiVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::ChannelNumber::Id: { - using TypeInfo = Attributes::ChannelNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::Rssi::Id: { - using TypeInfo = Attributes::Rssi::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithChar:cppValue.Value()]; - } - return value; - } - case Attributes::BeaconLostCount::Id: { - using TypeInfo = Attributes::BeaconLostCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BeaconRxCount::Id: { - using TypeInfo = Attributes::BeaconRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketMulticastRxCount::Id: { - using TypeInfo = Attributes::PacketMulticastRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketMulticastTxCount::Id: { - using TypeInfo = Attributes::PacketMulticastTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketUnicastRxCount::Id: { - using TypeInfo = Attributes::PacketUnicastRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketUnicastTxCount::Id: { - using TypeInfo = Attributes::PacketUnicastTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::CurrentMaxRate::Id: { - using TypeInfo = Attributes::CurrentMaxRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForEthernetNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::EthernetNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::PHYRate::Id: { - using TypeInfo = Attributes::PHYRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::FullDuplex::Id: { - using TypeInfo = Attributes::FullDuplex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithBool:cppValue.Value()]; - } - return value; - } - case Attributes::PacketRxCount::Id: { - using TypeInfo = Attributes::PacketRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::PacketTxCount::Id: { - using TypeInfo = Attributes::PacketTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::TxErrCount::Id: { - using TypeInfo = Attributes::TxErrCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CollisionCount::Id: { - using TypeInfo = Attributes::CollisionCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CarrierDetect::Id: { - using TypeInfo = Attributes::CarrierDetect::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithBool:cppValue.Value()]; - } - return value; - } - case Attributes::TimeSinceReset::Id: { - using TypeInfo = Attributes::TimeSinceReset::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTimeSynchronizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TimeSynchronization; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::UTCTime::Id: { - using TypeInfo = Attributes::UTCTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Granularity::Id: { - using TypeInfo = Attributes::Granularity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeSource::Id: { - using TypeInfo = Attributes::TimeSource::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TrustedTimeSource::Id: { - using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRTimeSynchronizationClusterTrustedTimeSourceStruct new]; - value.fabricIndex = [NSNumber numberWithUnsignedChar:cppValue.Value().fabricIndex]; - value.nodeID = [NSNumber numberWithUnsignedLongLong:cppValue.Value().nodeID]; - value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DefaultNTP::Id: { - using TypeInfo = Attributes::DefaultNTP::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsString(cppValue.Value()); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZone::Id: { - using TypeInfo = Attributes::TimeZone::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTimeSynchronizationClusterTimeZoneStruct * newElement_0; - newElement_0 = [MTRTimeSynchronizationClusterTimeZoneStruct new]; - newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; - newElement_0.validAt = [NSNumber numberWithUnsignedLongLong:entry_0.validAt]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DSTOffset::Id: { - using TypeInfo = Attributes::DSTOffset::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTimeSynchronizationClusterDSTOffsetStruct * newElement_0; - newElement_0 = [MTRTimeSynchronizationClusterDSTOffsetStruct new]; - newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; - newElement_0.validStarting = [NSNumber numberWithUnsignedLongLong:entry_0.validStarting]; - if (entry_0.validUntil.IsNull()) { - newElement_0.validUntil = nil; - } else { - newElement_0.validUntil = [NSNumber numberWithUnsignedLongLong:entry_0.validUntil.Value()]; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LocalTime::Id: { - using TypeInfo = Attributes::LocalTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZoneDatabase::Id: { - using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::NTPServerAvailable::Id: { - using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZoneListMaxSize::Id: { - using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DSTOffsetListMaxSize::Id: { - using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportsDNSResolve::Id: { - using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBridgedDeviceBasicInformationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BridgedDeviceBasicInformation; - switch (aAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nonnull value; - value = [MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct new]; - value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; - if (cppValue.primaryColor.IsNull()) { - value.primaryColor = nil; - } else { - value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSwitchCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Switch; - switch (aAttributeId) { - case Attributes::NumberOfPositions::Id: { - using TypeInfo = Attributes::NumberOfPositions::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CurrentPosition::Id: { - using TypeInfo = Attributes::CurrentPosition::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MultiPressMax::Id: { - using TypeInfo = Attributes::MultiPressMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAdministratorCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AdministratorCommissioning; - switch (aAttributeId) { - case Attributes::WindowStatus::Id: { - using TypeInfo = Attributes::WindowStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::AdminFabricIndex::Id: { - using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::AdminVendorId::Id: { - using TypeInfo = Attributes::AdminVendorId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOperationalCredentialsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OperationalCredentials; - switch (aAttributeId) { - case Attributes::NOCs::Id: { - using TypeInfo = Attributes::NOCs::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROperationalCredentialsClusterNOCStruct * newElement_0; - newElement_0 = [MTROperationalCredentialsClusterNOCStruct new]; - newElement_0.noc = AsData(entry_0.noc); - if (entry_0.icac.IsNull()) { - newElement_0.icac = nil; - } else { - newElement_0.icac = AsData(entry_0.icac.Value()); - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::Fabrics::Id: { - using TypeInfo = Attributes::Fabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROperationalCredentialsClusterFabricDescriptorStruct * newElement_0; - newElement_0 = [MTROperationalCredentialsClusterFabricDescriptorStruct new]; - newElement_0.rootPublicKey = AsData(entry_0.rootPublicKey); - newElement_0.vendorID = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.vendorID)]; - newElement_0.fabricID = [NSNumber numberWithUnsignedLongLong:entry_0.fabricID]; - newElement_0.nodeID = [NSNumber numberWithUnsignedLongLong:entry_0.nodeID]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SupportedFabrics::Id: { - using TypeInfo = Attributes::SupportedFabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CommissionedFabrics::Id: { - using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::TrustedRootCertificates::Id: { - using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = AsData(entry_0); - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentFabricIndex::Id: { - using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGroupKeyManagementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GroupKeyManagement; - switch (aAttributeId) { - case Attributes::GroupKeyMap::Id: { - using TypeInfo = Attributes::GroupKeyMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; - newElement_0 = [MTRGroupKeyManagementClusterGroupKeyMapStruct new]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GroupTable::Id: { - using TypeInfo = Attributes::GroupTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; - newElement_0 = [MTRGroupKeyManagementClusterGroupInfoMapStruct new]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.endpoints.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSNumber * newElement_2; - newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.endpoints = array_2; - } - if (entry_0.groupName.HasValue()) { - newElement_0.groupName = AsString(entry_0.groupName.Value()); - if (newElement_0.groupName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.groupName = nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::MaxGroupsPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MaxGroupKeysPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFixedLabelCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FixedLabel; - switch (aAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRFixedLabelClusterLabelStruct * newElement_0; - newElement_0 = [MTRFixedLabelClusterLabelStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.value = AsString(entry_0.value); - if (newElement_0.value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForUserLabelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::UserLabel; - switch (aAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUserLabelClusterLabelStruct * newElement_0; - newElement_0 = [MTRUserLabelClusterLabelStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.value = AsString(entry_0.value); - if (newElement_0.value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBooleanStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BooleanState; - switch (aAttributeId) { - case Attributes::StateValue::Id: { - using TypeInfo = Attributes::StateValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForICDManagementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IcdManagement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::IdleModeInterval::Id: { - using TypeInfo = Attributes::IdleModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ActiveModeInterval::Id: { - using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ActiveModeThreshold::Id: { - using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::RegisteredClients::Id: { - using TypeInfo = Attributes::RegisteredClients::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; - newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; - newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; - newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; - newElement_0.key = AsData(entry_0.key); - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ICDCounter::Id: { - using TypeInfo = Attributes::ICDCounter::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClientsSupportedPerFabric::Id: { - using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForModeSelectCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ModeSelect; - switch (aAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::StandardNamespace::Id: { - using TypeInfo = Attributes::StandardNamespace::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRModeSelectClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRModeSelectClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.semanticTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterSemanticTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.semanticTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLaundryWasherModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LaundryWasherMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRLaundryWasherModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRLaundryWasherModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRLaundryWasherModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRLaundryWasherModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRefrigeratorAndTemperatureControlledCabinetModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RefrigeratorAndTemperatureControlledCabinetMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLaundryWasherControlsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LaundryWasherControls; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SpinSpeeds::Id: { - using TypeInfo = Attributes::SpinSpeeds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SpinSpeedCurrent::Id: { - using TypeInfo = Attributes::SpinSpeedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::NumberOfRinses::Id: { - using TypeInfo = Attributes::NumberOfRinses::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedRinses::Id: { - using TypeInfo = Attributes::SupportedRinses::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCRunModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcRunMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCRunModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRVCRunModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRVCRunModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRVCRunModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCCleanModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcCleanMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCCleanModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRVCCleanModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRVCCleanModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRVCCleanModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTemperatureControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TemperatureControl; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::TemperatureSetpoint::Id: { - using TypeInfo = Attributes::TemperatureSetpoint::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinTemperature::Id: { - using TypeInfo = Attributes::MinTemperature::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxTemperature::Id: { - using TypeInfo = Attributes::MaxTemperature::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Step::Id: { - using TypeInfo = Attributes::Step::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SelectedTemperatureLevel::Id: { - using TypeInfo = Attributes::SelectedTemperatureLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedTemperatureLevels::Id: { - using TypeInfo = Attributes::SupportedTemperatureLevels::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RefrigeratorAlarm; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Mask::Id: { - using TypeInfo = Attributes::Mask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::State::Id: { - using TypeInfo = Attributes::State::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Supported::Id: { - using TypeInfo = Attributes::Supported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -11896,14 +1002,13 @@ static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDishwasherModeCluster( +static id _Nullable DecodeAttributeValueForAccessControlCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DishwasherMode; + using namespace Clusters::AccessControl; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; + case Attributes::Acl::Id: { + using TypeInfo = Attributes::Acl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -11915,37 +1020,66 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRDishwasherModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRDishwasherModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRDishwasherModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRDishwasherModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; + MTRAccessControlClusterAccessControlEntryStruct * newElement_0; + newElement_0 = [MTRAccessControlClusterAccessControlEntryStruct new]; + newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; + newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; + if (entry_0.subjects.IsNull()) { + newElement_0.subjects = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.subjects.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedLongLong:entry_3]; + [array_3 addObject:newElement_3]; } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.subjects = array_3; } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; + } + if (entry_0.targets.IsNull()) { + newElement_0.targets = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.targets.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRAccessControlClusterAccessControlTargetStruct * newElement_3; + newElement_3 = [MTRAccessControlClusterAccessControlTargetStruct new]; + if (entry_3.cluster.IsNull()) { + newElement_3.cluster = nil; + } else { + newElement_3.cluster = [NSNumber numberWithUnsignedInt:entry_3.cluster.Value()]; + } + if (entry_3.endpoint.IsNull()) { + newElement_3.endpoint = nil; + } else { + newElement_3.endpoint = [NSNumber numberWithUnsignedShort:entry_3.endpoint.Value()]; + } + if (entry_3.deviceType.IsNull()) { + newElement_3.deviceType = nil; + } else { + newElement_3.deviceType = [NSNumber numberWithUnsignedInt:entry_3.deviceType.Value()]; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.targets = array_3; } - newElement_0.modeTags = array_2; } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -11957,113 +1091,8 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Extension::Id: { + using TypeInfo = Attributes::Extension::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12075,8 +1104,10 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRAccessControlClusterAccessControlExtensionStruct * newElement_0; + newElement_0 = [MTRAccessControlClusterAccessControlExtensionStruct new]; + newElement_0.data = AsData(entry_0.data); + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12088,51 +1119,30 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SubjectsPerAccessControlEntry::Id: { + using TypeInfo = Attributes::SubjectsPerAccessControlEntry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::TargetsPerAccessControlEntry::Id: { + using TypeInfo = Attributes::TargetsPerAccessControlEntry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::AccessControlEntriesPerFabric::Id: { + using TypeInfo = Attributes::AccessControlEntriesPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12142,7 +1152,6 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -12151,27 +1160,12 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForAirQualityCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForActionsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::AirQuality; + using namespace Clusters::Actions; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::AirQuality::Id: { - using TypeInfo = Attributes::AirQuality::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ActionList::Id: { + using TypeInfo = Attributes::ActionList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12183,8 +1177,19 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRActionsClusterActionStruct * newElement_0; + newElement_0 = [MTRActionsClusterActionStruct new]; + newElement_0.actionID = [NSNumber numberWithUnsignedShort:entry_0.actionID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; + newElement_0.supportedCommands = [NSNumber numberWithUnsignedShort:entry_0.supportedCommands.Raw()]; + newElement_0.state = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.state)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12196,10 +1201,8 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::EndpointLists::Id: { + using TypeInfo = Attributes::EndpointLists::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12211,8 +1214,32 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRActionsClusterEndpointListStruct * newElement_0; + newElement_0 = [MTRActionsClusterEndpointListStruct new]; + newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.endpoints = array_2; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12224,79 +1251,91 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SetupURL::Id: { + using TypeInfo = Attributes::SetupURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBasicInformationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BasicInformation; + switch (aAttributeId) { + case Attributes::DataModelRevision::Id: { + using TypeInfo = Attributes::DataModelRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12306,248 +1345,268 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::SmokeCoAlarm; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::ExpressedState::Id: { - using TypeInfo = Attributes::ExpressedState::TypeInfo; + case Attributes::Location::Id: { + using TypeInfo = Attributes::Location::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SmokeState::Id: { - using TypeInfo = Attributes::SmokeState::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::COState::Id: { - using TypeInfo = Attributes::COState::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::BatteryAlert::Id: { - using TypeInfo = Attributes::BatteryAlert::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DeviceMuted::Id: { - using TypeInfo = Attributes::DeviceMuted::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TestInProgress::Id: { - using TypeInfo = Attributes::TestInProgress::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::HardwareFaultAlert::Id: { - using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EndOfServiceAlert::Id: { - using TypeInfo = Attributes::EndOfServiceAlert::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InterconnectSmokeAlarm::Id: { - using TypeInfo = Attributes::InterconnectSmokeAlarm::TypeInfo; + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InterconnectCOAlarm::Id: { - using TypeInfo = Attributes::InterconnectCOAlarm::TypeInfo; + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ContaminationState::Id: { - using TypeInfo = Attributes::ContaminationState::TypeInfo; + case Attributes::LocalConfigDisabled::Id: { + using TypeInfo = Attributes::LocalConfigDisabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SmokeSensitivityLevel::Id: { - using TypeInfo = Attributes::SmokeSensitivityLevel::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ExpiryDate::Id: { - using TypeInfo = Attributes::ExpiryDate::TypeInfo; + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CapabilityMinima::Id: { + using TypeInfo = Attributes::CapabilityMinima::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + MTRBasicInformationClusterCapabilityMinimaStruct * _Nonnull value; + value = [MTRBasicInformationClusterCapabilityMinimaStruct new]; + value.caseSessionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.caseSessionsPerFabric]; + value.subscriptionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.subscriptionsPerFabric]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRBasicInformationClusterProductAppearanceStruct * _Nonnull value; + value = [MTRBasicInformationClusterProductAppearanceStruct new]; + value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; + if (cppValue.primaryColor.IsNull()) { + value.primaryColor = nil; + } else { + value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOTASoftwareUpdateProviderCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OtaSoftwareUpdateProvider; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOTASoftwareUpdateRequestorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OtaSoftwareUpdateRequestor; + switch (aAttributeId) { + case Attributes::DefaultOTAProviders::Id: { + using TypeInfo = Attributes::DefaultOTAProviders::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12559,8 +1618,11 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTROTASoftwareUpdateRequestorClusterProviderLocation * newElement_0; + newElement_0 = [MTROTASoftwareUpdateRequestorClusterProviderLocation new]; + newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12572,61 +1634,43 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::UpdatePossible::Id: { + using TypeInfo = Attributes::UpdatePossible::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::UpdateState::Id: { + using TypeInfo = Attributes::UpdateState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::UpdateStateProgress::Id: { + using TypeInfo = Attributes::UpdateStateProgress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -12635,66 +1679,95 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( +static id _Nullable DecodeAttributeValueForLocalizationConfigurationCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DishwasherAlarm; + using namespace Clusters::LocalizationConfiguration; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Mask::Id: { - using TypeInfo = Attributes::Mask::TypeInfo; + case Attributes::ActiveLocale::Id: { + using TypeInfo = Attributes::ActiveLocale::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Latch::Id: { - using TypeInfo = Attributes::Latch::TypeInfo; + case Attributes::SupportedLocales::Id: { + using TypeInfo = Attributes::SupportedLocales::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::State::Id: { - using TypeInfo = Attributes::State::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTimeFormatLocalizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TimeFormatLocalization; + switch (aAttributeId) { + case Attributes::HourFormat::Id: { + using TypeInfo = Attributes::HourFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Supported::Id: { - using TypeInfo = Attributes::Supported::TypeInfo; + case Attributes::ActiveCalendarType::Id: { + using TypeInfo = Attributes::ActiveCalendarType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::SupportedCalendarTypes::Id: { + using TypeInfo = Attributes::SupportedCalendarTypes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12707,7 +1780,7 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12719,10 +1792,45 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForUnitLocalizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::UnitLocalization; + switch (aAttributeId) { + case Attributes::TemperatureUnit::Id: { + using TypeInfo = Attributes::TemperatureUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPowerSourceConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PowerSourceConfiguration; + switch (aAttributeId) { + case Attributes::Sources::Id: { + using TypeInfo = Attributes::Sources::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12735,7 +1843,7 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12747,176 +1855,148 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPowerSourceCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PowerSource; + switch (aAttributeId) { + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::Order::Id: { + using TypeInfo = Attributes::Order::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::WiredAssessedInputVoltage::Id: { + using TypeInfo = Attributes::WiredAssessedInputVoltage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::WiredAssessedInputFrequency::Id: { + using TypeInfo = Attributes::WiredAssessedInputFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WiredCurrentType::Id: { + using TypeInfo = Attributes::WiredCurrentType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOperationalStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OperationalState; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::PhaseList::Id: { - using TypeInfo = Attributes::PhaseList::TypeInfo; + case Attributes::WiredAssessedCurrent::Id: { + using TypeInfo = Attributes::WiredAssessedCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSString * newElement_1; - newElement_1 = AsString(entry_1); - if (newElement_1 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_1; - } + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentPhase::Id: { - using TypeInfo = Attributes::CurrentPhase::TypeInfo; + case Attributes::WiredNominalVoltage::Id: { + using TypeInfo = Attributes::WiredNominalVoltage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CountdownTime::Id: { - using TypeInfo = Attributes::CountdownTime::TypeInfo; + case Attributes::WiredMaximumCurrent::Id: { + using TypeInfo = Attributes::WiredMaximumCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::WiredPresent::Id: { + using TypeInfo = Attributes::WiredPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalStateList::Id: { - using TypeInfo = Attributes::OperationalStateList::TypeInfo; + case Attributes::ActiveWiredFaults::Id: { + using TypeInfo = Attributes::ActiveWiredFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12928,19 +2008,8 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTROperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; - if (entry_0.operationalStateLabel.HasValue()) { - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.operationalStateLabel = nil; - } + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12952,141 +2021,97 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalState::Id: { - using TypeInfo = Attributes::OperationalState::TypeInfo; + case Attributes::BatVoltage::Id: { + using TypeInfo = Attributes::BatVoltage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalError::Id: { - using TypeInfo = Attributes::OperationalError::TypeInfo; + case Attributes::BatPercentRemaining::Id: { + using TypeInfo = Attributes::BatPercentRemaining::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTROperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTROperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; - if (cppValue.errorStateLabel.HasValue()) { - value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); - if (value.errorStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.errorStateLabel = nil; - } - if (cppValue.errorStateDetails.HasValue()) { - value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); - if (value.errorStateDetails == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { - value.errorStateDetails = nil; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::BatTimeRemaining::Id: { + using TypeInfo = Attributes::BatTimeRemaining::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::BatChargeLevel::Id: { + using TypeInfo = Attributes::BatChargeLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::BatReplacementNeeded::Id: { + using TypeInfo = Attributes::BatReplacementNeeded::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::BatReplaceability::Id: { + using TypeInfo = Attributes::BatReplaceability::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::BatPresent::Id: { + using TypeInfo = Attributes::BatPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ActiveBatFaults::Id: { + using TypeInfo = Attributes::ActiveBatFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13099,7 +2124,7 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13111,159 +2136,89 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::BatReplacementDescription::Id: { + using TypeInfo = Attributes::BatReplacementDescription::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::BatCommonDesignation::Id: { + using TypeInfo = Attributes::BatCommonDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcOperationalState; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::PhaseList::Id: { - using TypeInfo = Attributes::PhaseList::TypeInfo; + case Attributes::BatANSIDesignation::Id: { + using TypeInfo = Attributes::BatANSIDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSString * newElement_1; - newElement_1 = AsString(entry_1); - if (newElement_1 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_1; - } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentPhase::Id: { - using TypeInfo = Attributes::CurrentPhase::TypeInfo; + case Attributes::BatIECDesignation::Id: { + using TypeInfo = Attributes::BatIECDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CountdownTime::Id: { - using TypeInfo = Attributes::CountdownTime::TypeInfo; + case Attributes::BatApprovedChemistry::Id: { + using TypeInfo = Attributes::BatApprovedChemistry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalStateList::Id: { - using TypeInfo = Attributes::OperationalStateList::TypeInfo; + case Attributes::BatCapacity::Id: { + using TypeInfo = Attributes::BatCapacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; - if (entry_0.operationalStateLabel.HasValue()) { - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.operationalStateLabel = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalState::Id: { - using TypeInfo = Attributes::OperationalState::TypeInfo; + case Attributes::BatQuantity::Id: { + using TypeInfo = Attributes::BatQuantity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13273,100 +2228,60 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalError::Id: { - using TypeInfo = Attributes::OperationalError::TypeInfo; + case Attributes::BatChargeState::Id: { + using TypeInfo = Attributes::BatChargeState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTRRVCOperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; - if (cppValue.errorStateLabel.HasValue()) { - value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); - if (value.errorStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.errorStateLabel = nil; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::BatTimeToFullCharge::Id: { + using TypeInfo = Attributes::BatTimeToFullCharge::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } - if (cppValue.errorStateDetails.HasValue()) { - value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); - if (value.errorStateDetails == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { - value.errorStateDetails = nil; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::BatFunctionalWhileCharging::Id: { + using TypeInfo = Attributes::BatFunctionalWhileCharging::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::BatChargingCurrent::Id: { + using TypeInfo = Attributes::BatChargingCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ActiveBatChargeFaults::Id: { + using TypeInfo = Attributes::ActiveBatChargeFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13379,7 +2294,7 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13391,10 +2306,9 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::EndpointList::Id: { + using TypeInfo = Attributes::EndpointList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13407,7 +2321,7 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13419,32 +2333,6 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } #endif // MTR_ENABLE_PROVISIONAL default: { break; @@ -13454,27 +2342,37 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( +static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::HepaFilterMonitoring; + using namespace Clusters::GeneralCommissioning; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Condition::Id: { - using TypeInfo = Attributes::Condition::TypeInfo; + case Attributes::Breadcrumb::Id: { + using TypeInfo = Attributes::Breadcrumb::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DegradationDirection::Id: { - using TypeInfo = Attributes::DegradationDirection::TypeInfo; + case Attributes::BasicCommissioningInfo::Id: { + using TypeInfo = Attributes::BasicCommissioningInfo::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull value; + value = [MTRGeneralCommissioningClusterBasicCommissioningInfo new]; + value.failSafeExpiryLengthSeconds = [NSNumber numberWithUnsignedShort:cppValue.failSafeExpiryLengthSeconds]; + value.maxCumulativeFailsafeSeconds = [NSNumber numberWithUnsignedShort:cppValue.maxCumulativeFailsafeSeconds]; + return value; + } + case Attributes::RegulatoryConfig::Id: { + using TypeInfo = Attributes::RegulatoryConfig::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13484,10 +2382,8 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ChangeIndication::Id: { - using TypeInfo = Attributes::ChangeIndication::TypeInfo; + case Attributes::LocationCapability::Id: { + using TypeInfo = Attributes::LocationCapability::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13497,10 +2393,8 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InPlaceIndicator::Id: { - using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; + case Attributes::SupportsConcurrentConnection::Id: { + using TypeInfo = Attributes::SupportsConcurrentConnection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13510,27 +2404,32 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LastChangedTime::Id: { - using TypeInfo = Attributes::LastChangedTime::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::NetworkCommissioning; + switch (aAttributeId) { + case Attributes::MaxNetworks::Id: { + using TypeInfo = Attributes::MaxNetworks::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ReplacementProductList::Id: { - using TypeInfo = Attributes::ReplacementProductList::TypeInfo; + case Attributes::Networks::Id: { + using TypeInfo = Attributes::Networks::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13542,16 +2441,10 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRHEPAFilterMonitoringClusterReplacementProductStruct * newElement_0; - newElement_0 = [MTRHEPAFilterMonitoringClusterReplacementProductStruct new]; - newElement_0.productIdentifierType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; - newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); - if (newElement_0.productIdentifierValue == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + MTRNetworkCommissioningClusterNetworkInfoStruct * newElement_0; + newElement_0 = [MTRNetworkCommissioningClusterNetworkInfoStruct new]; + newElement_0.networkID = AsData(entry_0.networkID); + newElement_0.connected = [NSNumber numberWithBool:entry_0.connected]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13563,145 +2456,84 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ScanMaxTimeSeconds::Id: { + using TypeInfo = Attributes::ScanMaxTimeSeconds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ConnectMaxTimeSeconds::Id: { + using TypeInfo = Attributes::ConnectMaxTimeSeconds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::InterfaceEnabled::Id: { + using TypeInfo = Attributes::InterfaceEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LastNetworkingStatus::Id: { + using TypeInfo = Attributes::LastNetworkingStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LastNetworkID::Id: { + using TypeInfo = Attributes::LastNetworkID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LastConnectErrorValue::Id: { + using TypeInfo = Attributes::LastConnectErrorValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -13710,83 +2542,149 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluster( +static id _Nullable DecodeAttributeValueForDiagnosticLogsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DiagnosticLogs; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGeneralDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ActivatedCarbonFilterMonitoring; + using namespace Clusters::GeneralDiagnostics; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Condition::Id: { - using TypeInfo = Attributes::Condition::TypeInfo; + case Attributes::NetworkInterfaces::Id: { + using TypeInfo = Attributes::NetworkInterfaces::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGeneralDiagnosticsClusterNetworkInterface * newElement_0; + newElement_0 = [MTRGeneralDiagnosticsClusterNetworkInterface new]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.isOperational = [NSNumber numberWithBool:entry_0.isOperational]; + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { + newElement_0.offPremiseServicesReachableIPv4 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv4 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; + } + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { + newElement_0.offPremiseServicesReachableIPv6 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv6 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; + } + newElement_0.hardwareAddress = AsData(entry_0.hardwareAddress); + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.IPv4Addresses.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = AsData(entry_2); + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.iPv4Addresses = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.IPv6Addresses.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = AsData(entry_2); + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.iPv6Addresses = array_2; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DegradationDirection::Id: { - using TypeInfo = Attributes::DegradationDirection::TypeInfo; + case Attributes::RebootCount::Id: { + using TypeInfo = Attributes::RebootCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ChangeIndication::Id: { - using TypeInfo = Attributes::ChangeIndication::TypeInfo; + case Attributes::UpTime::Id: { + using TypeInfo = Attributes::UpTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InPlaceIndicator::Id: { - using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; + case Attributes::TotalOperationalHours::Id: { + using TypeInfo = Attributes::TotalOperationalHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LastChangedTime::Id: { - using TypeInfo = Attributes::LastChangedTime::TypeInfo; + case Attributes::BootReason::Id: { + using TypeInfo = Attributes::BootReason::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ReplacementProductList::Id: { - using TypeInfo = Attributes::ReplacementProductList::TypeInfo; + case Attributes::ActiveHardwareFaults::Id: { + using TypeInfo = Attributes::ActiveHardwareFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13798,16 +2696,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct * newElement_0; - newElement_0 = [MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct new]; - newElement_0.productIdentifierType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; - newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); - if (newElement_0.productIdentifierValue == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13819,10 +2709,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ActiveRadioFaults::Id: { + using TypeInfo = Attributes::ActiveRadioFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13835,7 +2723,7 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13847,10 +2735,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ActiveNetworkFaults::Id: { + using TypeInfo = Attributes::ActiveNetworkFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13863,7 +2749,7 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13875,38 +2761,32 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::TestEventTriggersEnabled::Id: { + using TypeInfo = Attributes::TestEventTriggersEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSoftwareDiagnosticsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SoftwareDiagnostics; + switch (aAttributeId) { + case Attributes::ThreadMetrics::Id: { + using TypeInfo = Attributes::ThreadMetrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13918,8 +2798,34 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRSoftwareDiagnosticsClusterThreadMetricsStruct * newElement_0; + newElement_0 = [MTRSoftwareDiagnosticsClusterThreadMetricsStruct new]; + newElement_0.id = [NSNumber numberWithUnsignedLongLong:entry_0.id]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + if (entry_0.stackFreeCurrent.HasValue()) { + newElement_0.stackFreeCurrent = [NSNumber numberWithUnsignedInt:entry_0.stackFreeCurrent.Value()]; + } else { + newElement_0.stackFreeCurrent = nil; + } + if (entry_0.stackFreeMinimum.HasValue()) { + newElement_0.stackFreeMinimum = [NSNumber numberWithUnsignedInt:entry_0.stackFreeMinimum.Value()]; + } else { + newElement_0.stackFreeMinimum = nil; + } + if (entry_0.stackSize.HasValue()) { + newElement_0.stackSize = [NSNumber numberWithUnsignedInt:entry_0.stackSize.Value()]; + } else { + newElement_0.stackSize = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13931,33 +2837,39 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::CurrentHeapFree::Id: { + using TypeInfo = Attributes::CurrentHeapFree::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::CurrentHeapUsed::Id: { + using TypeInfo = Attributes::CurrentHeapUsed::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CurrentHeapHighWatermark::Id: { + using TypeInfo = Attributes::CurrentHeapHighWatermark::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -13966,12 +2878,13 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForThreadNetworkDiagnosticsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DoorLock; + using namespace Clusters::ThreadNetworkDiagnostics; switch (aAttributeId) { - case Attributes::LockState::Id: { - using TypeInfo = Attributes::LockState::TypeInfo; + case Attributes::Channel::Id: { + using TypeInfo = Attributes::Channel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13981,34 +2894,47 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::LockType::Id: { - using TypeInfo = Attributes::LockType::TypeInfo; + case Attributes::RoutingRole::Id: { + using TypeInfo = Attributes::RoutingRole::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } return value; } - case Attributes::ActuatorEnabled::Id: { - using TypeInfo = Attributes::ActuatorEnabled::TypeInfo; + case Attributes::NetworkName::Id: { + using TypeInfo = Attributes::NetworkName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } return value; } - case Attributes::DoorState::Id: { - using TypeInfo = Attributes::DoorState::TypeInfo; + case Attributes::PanId::Id: { + using TypeInfo = Attributes::PanId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14018,475 +2944,443 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::DoorOpenEvents::Id: { - using TypeInfo = Attributes::DoorOpenEvents::TypeInfo; + case Attributes::ExtendedPanId::Id: { + using TypeInfo = Attributes::ExtendedPanId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::DoorClosedEvents::Id: { - using TypeInfo = Attributes::DoorClosedEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::OpenPeriod::Id: { - using TypeInfo = Attributes::OpenPeriod::TypeInfo; + case Attributes::MeshLocalPrefix::Id: { + using TypeInfo = Attributes::MeshLocalPrefix::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NumberOfTotalUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfTotalUsersSupported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::NumberOfPINUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfPINUsersSupported::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::NumberOfRFIDUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfRFIDUsersSupported::TypeInfo; + case Attributes::NeighborTable::Id: { + using TypeInfo = Attributes::NeighborTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThreadNetworkDiagnosticsClusterNeighborTableStruct * newElement_0; + newElement_0 = [MTRThreadNetworkDiagnosticsClusterNeighborTableStruct new]; + newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; + newElement_0.age = [NSNumber numberWithUnsignedInt:entry_0.age]; + newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; + newElement_0.linkFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.linkFrameCounter]; + newElement_0.mleFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.mleFrameCounter]; + newElement_0.lqi = [NSNumber numberWithUnsignedChar:entry_0.lqi]; + if (entry_0.averageRssi.IsNull()) { + newElement_0.averageRssi = nil; + } else { + newElement_0.averageRssi = [NSNumber numberWithChar:entry_0.averageRssi.Value()]; + } + if (entry_0.lastRssi.IsNull()) { + newElement_0.lastRssi = nil; + } else { + newElement_0.lastRssi = [NSNumber numberWithChar:entry_0.lastRssi.Value()]; + } + newElement_0.frameErrorRate = [NSNumber numberWithUnsignedChar:entry_0.frameErrorRate]; + newElement_0.messageErrorRate = [NSNumber numberWithUnsignedChar:entry_0.messageErrorRate]; + newElement_0.rxOnWhenIdle = [NSNumber numberWithBool:entry_0.rxOnWhenIdle]; + newElement_0.fullThreadDevice = [NSNumber numberWithBool:entry_0.fullThreadDevice]; + newElement_0.fullNetworkData = [NSNumber numberWithBool:entry_0.fullNetworkData]; + newElement_0.isChild = [NSNumber numberWithBool:entry_0.isChild]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; + case Attributes::RouteTable::Id: { + using TypeInfo = Attributes::RouteTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::NumberOfHolidaySchedulesSupported::Id: { - using TypeInfo = Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThreadNetworkDiagnosticsClusterRouteTableStruct * newElement_0; + newElement_0 = [MTRThreadNetworkDiagnosticsClusterRouteTableStruct new]; + newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; + newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; + newElement_0.routerId = [NSNumber numberWithUnsignedChar:entry_0.routerId]; + newElement_0.nextHop = [NSNumber numberWithUnsignedChar:entry_0.nextHop]; + newElement_0.pathCost = [NSNumber numberWithUnsignedChar:entry_0.pathCost]; + newElement_0.lqiIn = [NSNumber numberWithUnsignedChar:entry_0.LQIIn]; + newElement_0.lqiOut = [NSNumber numberWithUnsignedChar:entry_0.LQIOut]; + newElement_0.age = [NSNumber numberWithUnsignedChar:entry_0.age]; + newElement_0.allocated = [NSNumber numberWithBool:entry_0.allocated]; + newElement_0.linkEstablished = [NSNumber numberWithBool:entry_0.linkEstablished]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxPINCodeLength::Id: { - using TypeInfo = Attributes::MaxPINCodeLength::TypeInfo; + case Attributes::PartitionId::Id: { + using TypeInfo = Attributes::PartitionId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MinPINCodeLength::Id: { - using TypeInfo = Attributes::MinPINCodeLength::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxRFIDCodeLength::Id: { - using TypeInfo = Attributes::MaxRFIDCodeLength::TypeInfo; + case Attributes::Weighting::Id: { + using TypeInfo = Attributes::Weighting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::MinRFIDCodeLength::Id: { - using TypeInfo = Attributes::MinRFIDCodeLength::TypeInfo; + case Attributes::DataVersion::Id: { + using TypeInfo = Attributes::DataVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::CredentialRulesSupport::Id: { - using TypeInfo = Attributes::CredentialRulesSupport::TypeInfo; + case Attributes::StableDataVersion::Id: { + using TypeInfo = Attributes::StableDataVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::NumberOfCredentialsSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; + case Attributes::LeaderRouterId::Id: { + using TypeInfo = Attributes::LeaderRouterId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::Language::Id: { - using TypeInfo = Attributes::Language::TypeInfo; + case Attributes::DetachedRoleCount::Id: { + using TypeInfo = Attributes::DetachedRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::LEDSettings::Id: { - using TypeInfo = Attributes::LEDSettings::TypeInfo; + case Attributes::ChildRoleCount::Id: { + using TypeInfo = Attributes::ChildRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AutoRelockTime::Id: { - using TypeInfo = Attributes::AutoRelockTime::TypeInfo; + case Attributes::RouterRoleCount::Id: { + using TypeInfo = Attributes::RouterRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SoundVolume::Id: { - using TypeInfo = Attributes::SoundVolume::TypeInfo; + case Attributes::LeaderRoleCount::Id: { + using TypeInfo = Attributes::LeaderRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::OperatingMode::Id: { - using TypeInfo = Attributes::OperatingMode::TypeInfo; + case Attributes::AttachAttemptCount::Id: { + using TypeInfo = Attributes::AttachAttemptCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SupportedOperatingModes::Id: { - using TypeInfo = Attributes::SupportedOperatingModes::TypeInfo; + case Attributes::PartitionIdChangeCount::Id: { + using TypeInfo = Attributes::PartitionIdChangeCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::DefaultConfigurationRegister::Id: { - using TypeInfo = Attributes::DefaultConfigurationRegister::TypeInfo; + case Attributes::BetterPartitionAttachAttemptCount::Id: { + using TypeInfo = Attributes::BetterPartitionAttachAttemptCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::EnableLocalProgramming::Id: { - using TypeInfo = Attributes::EnableLocalProgramming::TypeInfo; + case Attributes::ParentChangeCount::Id: { + using TypeInfo = Attributes::ParentChangeCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::EnableOneTouchLocking::Id: { - using TypeInfo = Attributes::EnableOneTouchLocking::TypeInfo; + case Attributes::TxTotalCount::Id: { + using TypeInfo = Attributes::TxTotalCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EnableInsideStatusLED::Id: { - using TypeInfo = Attributes::EnableInsideStatusLED::TypeInfo; + case Attributes::TxUnicastCount::Id: { + using TypeInfo = Attributes::TxUnicastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EnablePrivacyModeButton::Id: { - using TypeInfo = Attributes::EnablePrivacyModeButton::TypeInfo; + case Attributes::TxBroadcastCount::Id: { + using TypeInfo = Attributes::TxBroadcastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::LocalProgrammingFeatures::Id: { - using TypeInfo = Attributes::LocalProgrammingFeatures::TypeInfo; + case Attributes::TxAckRequestedCount::Id: { + using TypeInfo = Attributes::TxAckRequestedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::WrongCodeEntryLimit::Id: { - using TypeInfo = Attributes::WrongCodeEntryLimit::TypeInfo; + case Attributes::TxAckedCount::Id: { + using TypeInfo = Attributes::TxAckedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::UserCodeTemporaryDisableTime::Id: { - using TypeInfo = Attributes::UserCodeTemporaryDisableTime::TypeInfo; + case Attributes::TxNoAckRequestedCount::Id: { + using TypeInfo = Attributes::TxNoAckRequestedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::SendPINOverTheAir::Id: { - using TypeInfo = Attributes::SendPINOverTheAir::TypeInfo; + case Attributes::TxDataCount::Id: { + using TypeInfo = Attributes::TxDataCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::RequirePINforRemoteOperation::Id: { - using TypeInfo = Attributes::RequirePINforRemoteOperation::TypeInfo; + case Attributes::TxDataPollCount::Id: { + using TypeInfo = Attributes::TxDataPollCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ExpiringUserTimeout::Id: { - using TypeInfo = Attributes::ExpiringUserTimeout::TypeInfo; + case Attributes::TxBeaconCount::Id: { + using TypeInfo = Attributes::TxBeaconCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::TxBeaconRequestCount::Id: { + using TypeInfo = Attributes::TxBeaconRequestCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::TxOtherCount::Id: { + using TypeInfo = Attributes::TxOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::TxRetryCount::Id: { + using TypeInfo = Attributes::TxRetryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::TxDirectMaxRetryExpiryCount::Id: { + using TypeInfo = Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::TxIndirectMaxRetryExpiryCount::Id: { + using TypeInfo = Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14496,386 +3390,332 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::TxErrCcaCount::Id: { + using TypeInfo = Attributes::TxErrCcaCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForWindowCoveringCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::WindowCovering; - switch (aAttributeId) { - case Attributes::Type::Id: { - using TypeInfo = Attributes::Type::TypeInfo; + case Attributes::TxErrAbortCount::Id: { + using TypeInfo = Attributes::TxErrAbortCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::PhysicalClosedLimitLift::Id: { - using TypeInfo = Attributes::PhysicalClosedLimitLift::TypeInfo; + case Attributes::TxErrBusyChannelCount::Id: { + using TypeInfo = Attributes::TxErrBusyChannelCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::PhysicalClosedLimitTilt::Id: { - using TypeInfo = Attributes::PhysicalClosedLimitTilt::TypeInfo; + case Attributes::RxTotalCount::Id: { + using TypeInfo = Attributes::RxTotalCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLift::Id: { - using TypeInfo = Attributes::CurrentPositionLift::TypeInfo; + case Attributes::RxUnicastCount::Id: { + using TypeInfo = Attributes::RxUnicastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTilt::Id: { - using TypeInfo = Attributes::CurrentPositionTilt::TypeInfo; + case Attributes::RxBroadcastCount::Id: { + using TypeInfo = Attributes::RxBroadcastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfActuationsLift::Id: { - using TypeInfo = Attributes::NumberOfActuationsLift::TypeInfo; + case Attributes::RxDataCount::Id: { + using TypeInfo = Attributes::RxDataCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfActuationsTilt::Id: { - using TypeInfo = Attributes::NumberOfActuationsTilt::TypeInfo; + case Attributes::RxDataPollCount::Id: { + using TypeInfo = Attributes::RxDataPollCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ConfigStatus::Id: { - using TypeInfo = Attributes::ConfigStatus::TypeInfo; + case Attributes::RxBeaconCount::Id: { + using TypeInfo = Attributes::RxBeaconCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLiftPercentage::Id: { - using TypeInfo = Attributes::CurrentPositionLiftPercentage::TypeInfo; + case Attributes::RxBeaconRequestCount::Id: { + using TypeInfo = Attributes::RxBeaconRequestCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTiltPercentage::Id: { - using TypeInfo = Attributes::CurrentPositionTiltPercentage::TypeInfo; + case Attributes::RxOtherCount::Id: { + using TypeInfo = Attributes::RxOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::OperationalStatus::Id: { - using TypeInfo = Attributes::OperationalStatus::TypeInfo; + case Attributes::RxAddressFilteredCount::Id: { + using TypeInfo = Attributes::RxAddressFilteredCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TargetPositionLiftPercent100ths::Id: { - using TypeInfo = Attributes::TargetPositionLiftPercent100ths::TypeInfo; + case Attributes::RxDestAddrFilteredCount::Id: { + using TypeInfo = Attributes::RxDestAddrFilteredCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TargetPositionTiltPercent100ths::Id: { - using TypeInfo = Attributes::TargetPositionTiltPercent100ths::TypeInfo; + case Attributes::RxDuplicatedCount::Id: { + using TypeInfo = Attributes::RxDuplicatedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EndProductType::Id: { - using TypeInfo = Attributes::EndProductType::TypeInfo; + case Attributes::RxErrNoFrameCount::Id: { + using TypeInfo = Attributes::RxErrNoFrameCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLiftPercent100ths::Id: { - using TypeInfo = Attributes::CurrentPositionLiftPercent100ths::TypeInfo; + case Attributes::RxErrUnknownNeighborCount::Id: { + using TypeInfo = Attributes::RxErrUnknownNeighborCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTiltPercent100ths::Id: { - using TypeInfo = Attributes::CurrentPositionTiltPercent100ths::TypeInfo; + case Attributes::RxErrInvalidSrcAddrCount::Id: { + using TypeInfo = Attributes::RxErrInvalidSrcAddrCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledOpenLimitLift::Id: { - using TypeInfo = Attributes::InstalledOpenLimitLift::TypeInfo; + case Attributes::RxErrSecCount::Id: { + using TypeInfo = Attributes::RxErrSecCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledClosedLimitLift::Id: { - using TypeInfo = Attributes::InstalledClosedLimitLift::TypeInfo; + case Attributes::RxErrFcsCount::Id: { + using TypeInfo = Attributes::RxErrFcsCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledOpenLimitTilt::Id: { - using TypeInfo = Attributes::InstalledOpenLimitTilt::TypeInfo; + case Attributes::RxErrOtherCount::Id: { + using TypeInfo = Attributes::RxErrOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledClosedLimitTilt::Id: { - using TypeInfo = Attributes::InstalledClosedLimitTilt::TypeInfo; + case Attributes::ActiveTimestamp::Id: { + using TypeInfo = Attributes::ActiveTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::Mode::Id: { - using TypeInfo = Attributes::Mode::TypeInfo; + case Attributes::PendingTimestamp::Id: { + using TypeInfo = Attributes::PendingTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::SafetyStatus::Id: { - using TypeInfo = Attributes::SafetyStatus::TypeInfo; + case Attributes::Delay::Id: { + using TypeInfo = Attributes::Delay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::SecurityPolicy::Id: { + using TypeInfo = Attributes::SecurityPolicy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRThreadNetworkDiagnosticsClusterSecurityPolicy new]; + value.rotationTime = [NSNumber numberWithUnsignedShort:cppValue.Value().rotationTime]; + value.flags = [NSNumber numberWithUnsignedShort:cppValue.Value().flags]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ChannelPage0Mask::Id: { + using TypeInfo = Attributes::ChannelPage0Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OperationalDatasetComponents::Id: { + using TypeInfo = Attributes::OperationalDatasetComponents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents new]; + value.activeTimestampPresent = [NSNumber numberWithBool:cppValue.Value().activeTimestampPresent]; + value.pendingTimestampPresent = [NSNumber numberWithBool:cppValue.Value().pendingTimestampPresent]; + value.masterKeyPresent = [NSNumber numberWithBool:cppValue.Value().masterKeyPresent]; + value.networkNamePresent = [NSNumber numberWithBool:cppValue.Value().networkNamePresent]; + value.extendedPanIdPresent = [NSNumber numberWithBool:cppValue.Value().extendedPanIdPresent]; + value.meshLocalPrefixPresent = [NSNumber numberWithBool:cppValue.Value().meshLocalPrefixPresent]; + value.delayPresent = [NSNumber numberWithBool:cppValue.Value().delayPresent]; + value.panIdPresent = [NSNumber numberWithBool:cppValue.Value().panIdPresent]; + value.channelPresent = [NSNumber numberWithBool:cppValue.Value().channelPresent]; + value.pskcPresent = [NSNumber numberWithBool:cppValue.Value().pskcPresent]; + value.securityPolicyPresent = [NSNumber numberWithBool:cppValue.Value().securityPolicyPresent]; + value.channelMaskPresent = [NSNumber numberWithBool:cppValue.Value().channelMaskPresent]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ActiveNetworkFaultsList::Id: { + using TypeInfo = Attributes::ActiveNetworkFaultsList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14888,7 +3728,7 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -14900,28 +3740,6 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -14930,247 +3748,204 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForBarrierControlCluster( +static id _Nullable DecodeAttributeValueForWiFiNetworkDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::BarrierControl; + using namespace Clusters::WiFiNetworkDiagnostics; switch (aAttributeId) { - case Attributes::BarrierMovingState::Id: { - using TypeInfo = Attributes::BarrierMovingState::TypeInfo; + case Attributes::Bssid::Id: { + using TypeInfo = Attributes::Bssid::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BarrierSafetyStatus::Id: { - using TypeInfo = Attributes::BarrierSafetyStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCapabilities::Id: { - using TypeInfo = Attributes::BarrierCapabilities::TypeInfo; + case Attributes::SecurityType::Id: { + using TypeInfo = Attributes::SecurityType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BarrierOpenEvents::Id: { - using TypeInfo = Attributes::BarrierOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCloseEvents::TypeInfo; + case Attributes::WiFiVersion::Id: { + using TypeInfo = Attributes::WiFiVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::BarrierCommandOpenEvents::Id: { - using TypeInfo = Attributes::BarrierCommandOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCommandCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCommandCloseEvents::TypeInfo; + case Attributes::ChannelNumber::Id: { + using TypeInfo = Attributes::ChannelNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::BarrierOpenPeriod::Id: { - using TypeInfo = Attributes::BarrierOpenPeriod::TypeInfo; + case Attributes::Rssi::Id: { + using TypeInfo = Attributes::Rssi::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithChar:cppValue.Value()]; + } return value; } - case Attributes::BarrierClosePeriod::Id: { - using TypeInfo = Attributes::BarrierClosePeriod::TypeInfo; + case Attributes::BeaconLostCount::Id: { + using TypeInfo = Attributes::BeaconLostCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::BarrierPosition::Id: { - using TypeInfo = Attributes::BarrierPosition::TypeInfo; + case Attributes::BeaconRxCount::Id: { + using TypeInfo = Attributes::BeaconRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PacketMulticastRxCount::Id: { + using TypeInfo = Attributes::PacketMulticastRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::PacketMulticastTxCount::Id: { + using TypeInfo = Attributes::PacketMulticastTxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PacketUnicastRxCount::Id: { + using TypeInfo = Attributes::PacketUnicastRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PacketUnicastTxCount::Id: { + using TypeInfo = Attributes::PacketUnicastTxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::CurrentMaxRate::Id: { + using TypeInfo = Attributes::CurrentMaxRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } default: { @@ -15181,13 +3956,13 @@ static id _Nullable DecodeAttributeValueForBarrierControlCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( +static id _Nullable DecodeAttributeValueForEthernetNetworkDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::PumpConfigurationAndControl; + using namespace Clusters::EthernetNetworkDiagnostics; switch (aAttributeId) { - case Attributes::MaxPressure::Id: { - using TypeInfo = Attributes::MaxPressure::TypeInfo; + case Attributes::PHYRate::Id: { + using TypeInfo = Attributes::PHYRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15197,12 +3972,12 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::MaxSpeed::Id: { - using TypeInfo = Attributes::MaxSpeed::TypeInfo; + case Attributes::FullDuplex::Id: { + using TypeInfo = Attributes::FullDuplex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15212,42 +3987,67 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithBool:cppValue.Value()]; } return value; } - case Attributes::MaxFlow::Id: { - using TypeInfo = Attributes::MaxFlow::TypeInfo; + case Attributes::PacketRxCount::Id: { + using TypeInfo = Attributes::PacketRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::PacketTxCount::Id: { + using TypeInfo = Attributes::PacketTxCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::MinConstPressure::Id: { - using TypeInfo = Attributes::MinConstPressure::TypeInfo; + case Attributes::TxErrCount::Id: { + using TypeInfo = Attributes::TxErrCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CollisionCount::Id: { + using TypeInfo = Attributes::CollisionCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::MaxConstPressure::Id: { - using TypeInfo = Attributes::MaxConstPressure::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CarrierDetect::Id: { + using TypeInfo = Attributes::CarrierDetect::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15257,12 +4057,37 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithBool:cppValue.Value()]; } return value; } - case Attributes::MinCompPressure::Id: { - using TypeInfo = Attributes::MinCompPressure::TypeInfo; + case Attributes::TimeSinceReset::Id: { + using TypeInfo = Attributes::TimeSinceReset::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTimeSynchronizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TimeSynchronization; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::UTCTime::Id: { + using TypeInfo = Attributes::UTCTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15272,87 +4097,157 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::MaxCompPressure::Id: { - using TypeInfo = Attributes::MaxCompPressure::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Granularity::Id: { + using TypeInfo = Attributes::Granularity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeSource::Id: { + using TypeInfo = Attributes::TimeSource::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::MinConstSpeed::Id: { - using TypeInfo = Attributes::MinConstSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TrustedTimeSource::Id: { + using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [MTRTimeSynchronizationClusterTrustedTimeSourceStruct new]; + value.fabricIndex = [NSNumber numberWithUnsignedChar:cppValue.Value().fabricIndex]; + value.nodeID = [NSNumber numberWithUnsignedLongLong:cppValue.Value().nodeID]; + value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint]; } return value; } - case Attributes::MaxConstSpeed::Id: { - using TypeInfo = Attributes::MaxConstSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DefaultNTP::Id: { + using TypeInfo = Attributes::DefaultNTP::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + NSString * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } return value; } - case Attributes::MinConstFlow::Id: { - using TypeInfo = Attributes::MinConstFlow::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZone::Id: { + using TypeInfo = Attributes::TimeZone::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRTimeSynchronizationClusterTimeZoneStruct * newElement_0; + newElement_0 = [MTRTimeSynchronizationClusterTimeZoneStruct new]; + newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; + newElement_0.validAt = [NSNumber numberWithUnsignedLongLong:entry_0.validAt]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::MaxConstFlow::Id: { - using TypeInfo = Attributes::MaxConstFlow::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DSTOffset::Id: { + using TypeInfo = Attributes::DSTOffset::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRTimeSynchronizationClusterDSTOffsetStruct * newElement_0; + newElement_0 = [MTRTimeSynchronizationClusterDSTOffsetStruct new]; + newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; + newElement_0.validStarting = [NSNumber numberWithUnsignedLongLong:entry_0.validStarting]; + if (entry_0.validUntil.IsNull()) { + newElement_0.validUntil = nil; + } else { + newElement_0.validUntil = [NSNumber numberWithUnsignedLongLong:entry_0.validUntil.Value()]; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::MinConstTemp::Id: { - using TypeInfo = Attributes::MinConstTemp::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LocalTime::Id: { + using TypeInfo = Attributes::LocalTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15362,383 +4257,351 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::MaxConstTemp::Id: { - using TypeInfo = Attributes::MaxConstTemp::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZoneDatabase::Id: { + using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::PumpStatus::Id: { - using TypeInfo = Attributes::PumpStatus::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::NTPServerAvailable::Id: { + using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::EffectiveOperationMode::Id: { - using TypeInfo = Attributes::EffectiveOperationMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZoneListMaxSize::Id: { + using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::EffectiveControlMode::Id: { - using TypeInfo = Attributes::EffectiveControlMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DSTOffsetListMaxSize::Id: { + using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::Capacity::Id: { - using TypeInfo = Attributes::Capacity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportsDNSResolve::Id: { + using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::Speed::Id: { - using TypeInfo = Attributes::Speed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBridgedDeviceBasicInformationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BridgedDeviceBasicInformation; + switch (aAttributeId) { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::LifetimeRunningHours::Id: { - using TypeInfo = Attributes::LifetimeRunningHours::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } - case Attributes::Power::Id: { - using TypeInfo = Attributes::Power::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::LifetimeEnergyConsumed::Id: { - using TypeInfo = Attributes::LifetimeEnergyConsumed::TypeInfo; + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::OperationMode::Id: { - using TypeInfo = Attributes::OperationMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ControlMode::Id: { - using TypeInfo = Attributes::ControlMode::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForThermostatCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Thermostat; - switch (aAttributeId) { - case Attributes::LocalTemperature::Id: { - using TypeInfo = Attributes::LocalTemperature::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::OutdoorTemperature::Id: { - using TypeInfo = Attributes::OutdoorTemperature::TypeInfo; + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::Occupancy::Id: { - using TypeInfo = Attributes::Occupancy::TypeInfo; + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::AbsMinHeatSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMinHeatSetpointLimit::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AbsMaxHeatSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMaxHeatSetpointLimit::TypeInfo; + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::AbsMinCoolSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMinCoolSetpointLimit::TypeInfo; + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nonnull value; + value = [MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct new]; + value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; + if (cppValue.primaryColor.IsNull()) { + value.primaryColor = nil; + } else { + value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; + } return value; } - case Attributes::AbsMaxCoolSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSwitchCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Switch; + switch (aAttributeId) { + case Attributes::NumberOfPositions::Id: { + using TypeInfo = Attributes::NumberOfPositions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PICoolingDemand::Id: { - using TypeInfo = Attributes::PICoolingDemand::TypeInfo; + case Attributes::CurrentPosition::Id: { + using TypeInfo = Attributes::CurrentPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15748,8 +4611,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PIHeatingDemand::Id: { - using TypeInfo = Attributes::PIHeatingDemand::TypeInfo; + case Attributes::MultiPressMax::Id: { + using TypeInfo = Attributes::MultiPressMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15759,243 +4622,545 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::HVACSystemTypeConfiguration::Id: { - using TypeInfo = Attributes::HVACSystemTypeConfiguration::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAdministratorCommissioningCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AdministratorCommissioning; + switch (aAttributeId) { + case Attributes::WindowStatus::Id: { + using TypeInfo = Attributes::WindowStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::LocalTemperatureCalibration::Id: { - using TypeInfo = Attributes::LocalTemperatureCalibration::TypeInfo; + case Attributes::AdminFabricIndex::Id: { + using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::OccupiedCoolingSetpoint::Id: { - using TypeInfo = Attributes::OccupiedCoolingSetpoint::TypeInfo; + case Attributes::AdminVendorId::Id: { + using TypeInfo = Attributes::AdminVendorId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::OccupiedHeatingSetpoint::Id: { - using TypeInfo = Attributes::OccupiedHeatingSetpoint::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOperationalCredentialsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalCredentials; + switch (aAttributeId) { + case Attributes::NOCs::Id: { + using TypeInfo = Attributes::NOCs::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalCredentialsClusterNOCStruct * newElement_0; + newElement_0 = [MTROperationalCredentialsClusterNOCStruct new]; + newElement_0.noc = AsData(entry_0.noc); + if (entry_0.icac.IsNull()) { + newElement_0.icac = nil; + } else { + newElement_0.icac = AsData(entry_0.icac.Value()); + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::UnoccupiedCoolingSetpoint::Id: { - using TypeInfo = Attributes::UnoccupiedCoolingSetpoint::TypeInfo; + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalCredentialsClusterFabricDescriptorStruct * newElement_0; + newElement_0 = [MTROperationalCredentialsClusterFabricDescriptorStruct new]; + newElement_0.rootPublicKey = AsData(entry_0.rootPublicKey); + newElement_0.vendorID = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.vendorID)]; + newElement_0.fabricID = [NSNumber numberWithUnsignedLongLong:entry_0.fabricID]; + newElement_0.nodeID = [NSNumber numberWithUnsignedLongLong:entry_0.nodeID]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::UnoccupiedHeatingSetpoint::Id: { - using TypeInfo = Attributes::UnoccupiedHeatingSetpoint::TypeInfo; + case Attributes::SupportedFabrics::Id: { + using TypeInfo = Attributes::SupportedFabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinHeatSetpointLimit::Id: { - using TypeInfo = Attributes::MinHeatSetpointLimit::TypeInfo; + case Attributes::CommissionedFabrics::Id: { + using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxHeatSetpointLimit::Id: { - using TypeInfo = Attributes::MaxHeatSetpointLimit::TypeInfo; + case Attributes::TrustedRootCertificates::Id: { + using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSData * newElement_0; + newElement_0 = AsData(entry_0); + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::MinCoolSetpointLimit::Id: { - using TypeInfo = Attributes::MinCoolSetpointLimit::TypeInfo; + case Attributes::CurrentFabricIndex::Id: { + using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxCoolSetpointLimit::Id: { - using TypeInfo = Attributes::MaxCoolSetpointLimit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGroupKeyManagementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::GroupKeyManagement; + switch (aAttributeId) { + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; + newElement_0 = [MTRGroupKeyManagementClusterGroupKeyMapStruct new]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::MinSetpointDeadBand::Id: { - using TypeInfo = Attributes::MinSetpointDeadBand::TypeInfo; + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; + newElement_0 = [MTRGroupKeyManagementClusterGroupInfoMapStruct new]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.endpoints.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSNumber * newElement_2; + newElement_2 = [NSNumber numberWithUnsignedShort:entry_2]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.endpoints = array_2; + } + if (entry_0.groupName.HasValue()) { + newElement_0.groupName = AsString(entry_0.groupName.Value()); + if (newElement_0.groupName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.groupName = nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::RemoteSensing::Id: { - using TypeInfo = Attributes::RemoteSensing::TypeInfo; + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ControlSequenceOfOperation::Id: { - using TypeInfo = Attributes::ControlSequenceOfOperation::TypeInfo; + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SystemMode::Id: { - using TypeInfo = Attributes::SystemMode::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForFixedLabelCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::FixedLabel; + switch (aAttributeId) { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRFixedLabelClusterLabelStruct * newElement_0; + newElement_0 = [MTRFixedLabelClusterLabelStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.value = AsString(entry_0.value); + if (newElement_0.value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::ThermostatRunningMode::Id: { - using TypeInfo = Attributes::ThermostatRunningMode::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForUserLabelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::UserLabel; + switch (aAttributeId) { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUserLabelClusterLabelStruct * newElement_0; + newElement_0 = [MTRUserLabelClusterLabelStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.value = AsString(entry_0.value); + if (newElement_0.value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::StartOfWeek::Id: { - using TypeInfo = Attributes::StartOfWeek::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBooleanStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BooleanState; + switch (aAttributeId) { + case Attributes::StateValue::Id: { + using TypeInfo = Attributes::StateValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::NumberOfWeeklyTransitions::Id: { - using TypeInfo = Attributes::NumberOfWeeklyTransitions::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForICDManagementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::IcdManagement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::IdleModeInterval::Id: { + using TypeInfo = Attributes::IdleModeInterval::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfDailyTransitions::Id: { - using TypeInfo = Attributes::NumberOfDailyTransitions::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ActiveModeInterval::Id: { + using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TemperatureSetpointHold::Id: { - using TypeInfo = Attributes::TemperatureSetpointHold::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ActiveModeThreshold::Id: { + using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::TemperatureSetpointHoldDuration::Id: { - using TypeInfo = Attributes::TemperatureSetpointHoldDuration::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::RegisteredClients::Id: { + using TypeInfo = Attributes::RegisteredClients::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; + newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; + newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; + newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; + newElement_0.key = AsData(entry_0.key); + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::ThermostatProgrammingOperationMode::Id: { - using TypeInfo = Attributes::ThermostatProgrammingOperationMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ICDCounter::Id: { + using TypeInfo = Attributes::ICDCounter::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ThermostatRunningState::Id: { - using TypeInfo = Attributes::ThermostatRunningState::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ClientsSupportedPerFabric::Id: { + using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16005,19 +5170,38 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SetpointChangeSource::Id: { - using TypeInfo = Attributes::SetpointChangeSource::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForModeSelectCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ModeSelect; + switch (aAttributeId) { + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::SetpointChangeAmount::Id: { - using TypeInfo = Attributes::SetpointChangeAmount::TypeInfo; + case Attributes::StandardNamespace::Id: { + using TypeInfo = Attributes::StandardNamespace::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16027,38 +5211,74 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::SetpointChangeSourceTimestamp::Id: { - using TypeInfo = Attributes::SetpointChangeSourceTimestamp::TypeInfo; + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRModeSelectClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRModeSelectClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.semanticTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.semanticTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::OccupiedSetback::Id: { - using TypeInfo = Attributes::OccupiedSetback::TypeInfo; + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OccupiedSetbackMin::Id: { - using TypeInfo = Attributes::OccupiedSetbackMin::TypeInfo; + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16072,8 +5292,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::OccupiedSetbackMax::Id: { - using TypeInfo = Attributes::OccupiedSetbackMax::TypeInfo; + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16087,23 +5307,92 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::UnoccupiedSetback::Id: { - using TypeInfo = Attributes::UnoccupiedSetback::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLaundryWasherModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LaundryWasherMode; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRLaundryWasherModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRLaundryWasherModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRLaundryWasherModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRLaundryWasherModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::UnoccupiedSetbackMin::Id: { - using TypeInfo = Attributes::UnoccupiedSetbackMin::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16117,8 +5406,10 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::UnoccupiedSetbackMax::Id: { - using TypeInfo = Attributes::UnoccupiedSetbackMax::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16132,52 +5423,80 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::EmergencyHeatDelta::Id: { - using TypeInfo = Attributes::EmergencyHeatDelta::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::ACType::Id: { - using TypeInfo = Attributes::ACType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; } - case Attributes::ACCapacity::Id: { - using TypeInfo = Attributes::ACCapacity::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRefrigeratorAndTemperatureControlledCabinetModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAndTemperatureControlledCabinetMode; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ACRefrigerantType::Id: { - using TypeInfo = Attributes::ACRefrigerantType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACCompressorType::Id: { - using TypeInfo = Attributes::ACCompressorType::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16187,30 +5506,27 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACErrorCode::Id: { - using TypeInfo = Attributes::ACErrorCode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ACLouverPosition::Id: { - using TypeInfo = Attributes::ACLouverPosition::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACCoilTemperature::Id: { - using TypeInfo = Attributes::ACCoilTemperature::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16220,23 +5536,27 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLaundryWasherControlsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LaundryWasherControls; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SpinSpeeds::Id: { + using TypeInfo = Attributes::SpinSpeeds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16248,8 +5568,13 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16261,8 +5586,40 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SpinSpeedCurrent::Id: { + using TypeInfo = Attributes::SpinSpeedCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::NumberOfRinses::Id: { + using TypeInfo = Attributes::NumberOfRinses::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedRinses::Id: { + using TypeInfo = Attributes::SupportedRinses::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16275,7 +5632,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16287,9 +5644,23 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRVCRunModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcRunMode; + switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16301,8 +5672,37 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRRVCRunModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRVCRunModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRVCRunModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRVCRunModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16315,54 +5715,53 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -16371,35 +5770,84 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForFanControlCluster( +static id _Nullable DecodeAttributeValueForRVCCleanModeCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::FanControl; + using namespace Clusters::RvcCleanMode; switch (aAttributeId) { - case Attributes::FanMode::Id: { - using TypeInfo = Attributes::FanMode::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCCleanModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRVCCleanModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRVCCleanModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRVCCleanModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::FanModeSequence::Id: { - using TypeInfo = Attributes::FanModeSequence::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PercentSetting::Id: { - using TypeInfo = Attributes::PercentSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16413,30 +5861,10 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( } return value; } - case Attributes::PercentCurrent::Id: { - using TypeInfo = Attributes::PercentCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::SpeedMax::Id: { - using TypeInfo = Attributes::SpeedMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::SpeedSetting::Id: { - using TypeInfo = Attributes::SpeedSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16450,129 +5878,88 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( } return value; } - case Attributes::SpeedCurrent::Id: { - using TypeInfo = Attributes::SpeedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::RockSupport::Id: { - using TypeInfo = Attributes::RockSupport::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::RockSetting::Id: { - using TypeInfo = Attributes::RockSetting::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; } - case Attributes::WindSupport::Id: { - using TypeInfo = Attributes::WindSupport::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTemperatureControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TemperatureControl; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::TemperatureSetpoint::Id: { + using TypeInfo = Attributes::TemperatureSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::WindSetting::Id: { - using TypeInfo = Attributes::WindSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinTemperature::Id: { + using TypeInfo = Attributes::MinTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AirflowDirection::Id: { - using TypeInfo = Attributes::AirflowDirection::TypeInfo; + case Attributes::MaxTemperature::Id: { + using TypeInfo = Attributes::MaxTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithShort:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; +#if MTR_ENABLE_PROVISIONAL + case Attributes::Step::Id: { + using TypeInfo = Attributes::Step::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SelectedTemperatureLevel::Id: { + using TypeInfo = Attributes::SelectedTemperatureLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SupportedTemperatureLevels::Id: { + using TypeInfo = Attributes::SupportedTemperatureLevels::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16584,8 +5971,13 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16598,54 +5990,58 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Supported::Id: { + using TypeInfo = Attributes::Supported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -16654,24 +6050,71 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationCluster( +static id _Nullable DecodeAttributeValueForDishwasherModeCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ThermostatUserInterfaceConfiguration; + using namespace Clusters::DishwasherMode; switch (aAttributeId) { - case Attributes::TemperatureDisplayMode::Id: { - using TypeInfo = Attributes::TemperatureDisplayMode::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRDishwasherModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRDishwasherModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRDishwasherModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRDishwasherModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::KeypadLockout::Id: { - using TypeInfo = Attributes::KeypadLockout::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16681,312 +6124,367 @@ static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationC value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ScheduleProgrammingVisibility::Id: { - using TypeInfo = Attributes::ScheduleProgrammingVisibility::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAirQualityCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AirQuality; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::AirQuality::Id: { + using TypeInfo = Attributes::AirQuality::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SmokeCoAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::ExpressedState::Id: { + using TypeInfo = Attributes::ExpressedState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SmokeState::Id: { + using TypeInfo = Attributes::SmokeState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::COState::Id: { + using TypeInfo = Attributes::COState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::BatteryAlert::Id: { + using TypeInfo = Attributes::BatteryAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DeviceMuted::Id: { + using TypeInfo = Attributes::DeviceMuted::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForColorControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ColorControl; - switch (aAttributeId) { - case Attributes::CurrentHue::Id: { - using TypeInfo = Attributes::CurrentHue::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TestInProgress::Id: { + using TypeInfo = Attributes::TestInProgress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::CurrentSaturation::Id: { - using TypeInfo = Attributes::CurrentSaturation::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::HardwareFaultAlert::Id: { + using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::RemainingTime::Id: { - using TypeInfo = Attributes::RemainingTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::EndOfServiceAlert::Id: { + using TypeInfo = Attributes::EndOfServiceAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CurrentX::Id: { - using TypeInfo = Attributes::CurrentX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InterconnectSmokeAlarm::Id: { + using TypeInfo = Attributes::InterconnectSmokeAlarm::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CurrentY::Id: { - using TypeInfo = Attributes::CurrentY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InterconnectCOAlarm::Id: { + using TypeInfo = Attributes::InterconnectCOAlarm::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::DriftCompensation::Id: { - using TypeInfo = Attributes::DriftCompensation::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ContaminationState::Id: { + using TypeInfo = Attributes::ContaminationState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CompensationText::Id: { - using TypeInfo = Attributes::CompensationText::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SmokeSensitivityLevel::Id: { + using TypeInfo = Attributes::SmokeSensitivityLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorTemperatureMireds::Id: { - using TypeInfo = Attributes::ColorTemperatureMireds::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ExpiryDate::Id: { + using TypeInfo = Attributes::ExpiryDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ColorMode::Id: { - using TypeInfo = Attributes::ColorMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DishwasherAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Options::Id: { - using TypeInfo = Attributes::Options::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Latch::Id: { + using TypeInfo = Attributes::Latch::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::NumberOfPrimaries::Id: { - using TypeInfo = Attributes::NumberOfPrimaries::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Primary1X::Id: { - using TypeInfo = Attributes::Primary1X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Supported::Id: { + using TypeInfo = Attributes::Supported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Primary1Y::Id: { - using TypeInfo = Attributes::Primary1Y::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalState; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } return value; } - case Attributes::Primary1Intensity::Id: { - using TypeInfo = Attributes::Primary1Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17000,30 +6498,10 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( } return value; } - case Attributes::Primary2X::Id: { - using TypeInfo = Attributes::Primary2X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary2Y::Id: { - using TypeInfo = Attributes::Primary2Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary2Intensity::Id: { - using TypeInfo = Attributes::Primary2Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17033,108 +6511,150 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::Primary3X::Id: { - using TypeInfo = Attributes::Primary3X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::Primary3Y::Id: { - using TypeInfo = Attributes::Primary3Y::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Primary3Intensity::Id: { - using TypeInfo = Attributes::Primary3Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; + MTROperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTROperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value.errorStateLabel = nil; } - return value; - } - case Attributes::Primary4X::Id: { - using TypeInfo = Attributes::Primary4X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary4Y::Id: { - using TypeInfo = Attributes::Primary4Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::Primary4Intensity::Id: { - using TypeInfo = Attributes::Primary4Intensity::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcOperationalState; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + NSArray * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::Primary5X::Id: { - using TypeInfo = Attributes::Primary5X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary5Y::Id: { - using TypeInfo = Attributes::Primary5Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary5Intensity::Id: { - using TypeInfo = Attributes::Primary5Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17148,126 +6668,178 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( } return value; } - case Attributes::Primary6X::Id: { - using TypeInfo = Attributes::Primary6X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary6Y::Id: { - using TypeInfo = Attributes::Primary6Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary6Intensity::Id: { - using TypeInfo = Attributes::Primary6Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::WhitePointX::Id: { - using TypeInfo = Attributes::WhitePointX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::WhitePointY::Id: { - using TypeInfo = Attributes::WhitePointY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ColorPointRX::Id: { - using TypeInfo = Attributes::ColorPointRX::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateLabel = nil; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ColorPointRY::Id: { - using TypeInfo = Attributes::ColorPointRY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::HepaFilterMonitoring; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Condition::Id: { + using TypeInfo = Attributes::Condition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ColorPointRIntensity::Id: { - using TypeInfo = Attributes::ColorPointRIntensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DegradationDirection::Id: { + using TypeInfo = Attributes::DegradationDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorPointGX::Id: { - using TypeInfo = Attributes::ColorPointGX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ChangeIndication::Id: { + using TypeInfo = Attributes::ChangeIndication::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorPointGY::Id: { - using TypeInfo = Attributes::ColorPointGY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InPlaceIndicator::Id: { + using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::ColorPointGIntensity::Id: { - using TypeInfo = Attributes::ColorPointGIntensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LastChangedTime::Id: { + using TypeInfo = Attributes::LastChangedTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17277,170 +6849,216 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::ColorPointBX::Id: { - using TypeInfo = Attributes::ColorPointBX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ReplacementProductList::Id: { + using TypeInfo = Attributes::ReplacementProductList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ColorPointBY::Id: { - using TypeInfo = Attributes::ColorPointBY::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRHEPAFilterMonitoringClusterReplacementProductStruct * newElement_0; + newElement_0 = [MTRHEPAFilterMonitoringClusterReplacementProductStruct new]; + newElement_0.productIdentifierType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; + newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); + if (newElement_0.productIdentifierValue == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ColorPointBIntensity::Id: { - using TypeInfo = Attributes::ColorPointBIntensity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::EnhancedCurrentHue::Id: { - using TypeInfo = Attributes::EnhancedCurrentHue::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ActivatedCarbonFilterMonitoring; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Condition::Id: { + using TypeInfo = Attributes::Condition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::EnhancedColorMode::Id: { - using TypeInfo = Attributes::EnhancedColorMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DegradationDirection::Id: { + using TypeInfo = Attributes::DegradationDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorLoopActive::Id: { - using TypeInfo = Attributes::ColorLoopActive::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ChangeIndication::Id: { + using TypeInfo = Attributes::ChangeIndication::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorLoopDirection::Id: { - using TypeInfo = Attributes::ColorLoopDirection::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InPlaceIndicator::Id: { + using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::ColorLoopTime::Id: { - using TypeInfo = Attributes::ColorLoopTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LastChangedTime::Id: { + using TypeInfo = Attributes::LastChangedTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::ColorLoopStartEnhancedHue::Id: { - using TypeInfo = Attributes::ColorLoopStartEnhancedHue::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ReplacementProductList::Id: { + using TypeInfo = Attributes::ReplacementProductList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct * newElement_0; + newElement_0 = [MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct new]; + newElement_0.productIdentifierType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; + newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); + if (newElement_0.productIdentifierValue == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::ColorLoopStoredEnhancedHue::Id: { - using TypeInfo = Attributes::ColorLoopStoredEnhancedHue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::ColorCapabilities::Id: { - using TypeInfo = Attributes::ColorCapabilities::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; } - case Attributes::ColorTempPhysicalMinMireds::Id: { - using TypeInfo = Attributes::ColorTempPhysicalMinMireds::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DoorLock; + switch (aAttributeId) { + case Attributes::LockState::Id: { + using TypeInfo = Attributes::LockState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } return value; } - case Attributes::ColorTempPhysicalMaxMireds::Id: { - using TypeInfo = Attributes::ColorTempPhysicalMaxMireds::TypeInfo; + case Attributes::LockType::Id: { + using TypeInfo = Attributes::LockType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CoupleColorTempToLevelMinMireds::Id: { - using TypeInfo = Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; + case Attributes::ActuatorEnabled::Id: { + using TypeInfo = Attributes::ActuatorEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::StartUpColorTemperatureMireds::Id: { - using TypeInfo = Attributes::StartUpColorTemperatureMireds::TypeInfo; + case Attributes::DoorState::Id: { + using TypeInfo = Attributes::DoorState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17450,129 +7068,67 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::DoorOpenEvents::Id: { + using TypeInfo = Attributes::DoorOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::DoorClosedEvents::Id: { + using TypeInfo = Attributes::DoorClosedEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OpenPeriod::Id: { + using TypeInfo = Attributes::OpenPeriod::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::NumberOfTotalUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfTotalUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::NumberOfPINUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfPINUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::NumberOfRFIDUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfRFIDUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17582,21 +7138,8 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BallastConfiguration; - switch (aAttributeId) { - case Attributes::PhysicalMinLevel::Id: { - using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; + case Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17606,8 +7149,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalMaxLevel::Id: { - using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; + case Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17617,8 +7160,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::BallastStatus::Id: { - using TypeInfo = Attributes::BallastStatus::TypeInfo; + case Attributes::NumberOfHolidaySchedulesSupported::Id: { + using TypeInfo = Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17628,8 +7171,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinLevel::Id: { - using TypeInfo = Attributes::MinLevel::TypeInfo; + case Attributes::MaxPINCodeLength::Id: { + using TypeInfo = Attributes::MaxPINCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17639,8 +7182,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxLevel::Id: { - using TypeInfo = Attributes::MaxLevel::TypeInfo; + case Attributes::MinPINCodeLength::Id: { + using TypeInfo = Attributes::MinPINCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17650,38 +7193,41 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::IntrinsicBallastFactor::Id: { - using TypeInfo = Attributes::IntrinsicBallastFactor::TypeInfo; + case Attributes::MaxRFIDCodeLength::Id: { + using TypeInfo = Attributes::MaxRFIDCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::BallastFactorAdjustment::Id: { - using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; + case Attributes::MinRFIDCodeLength::Id: { + using TypeInfo = Attributes::MinRFIDCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::CredentialRulesSupport::Id: { + using TypeInfo = Attributes::CredentialRulesSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } - case Attributes::LampQuantity::Id: { - using TypeInfo = Attributes::LampQuantity::TypeInfo; + case Attributes::NumberOfCredentialsSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17691,8 +7237,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::LampType::Id: { - using TypeInfo = Attributes::LampType::TypeInfo; + case Attributes::Language::Id: { + using TypeInfo = Attributes::Language::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17707,266 +7253,173 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( } return value; } - case Attributes::LampManufacturer::Id: { - using TypeInfo = Attributes::LampManufacturer::TypeInfo; + case Attributes::LEDSettings::Id: { + using TypeInfo = Attributes::LEDSettings::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::AutoRelockTime::Id: { + using TypeInfo = Attributes::AutoRelockTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::LampRatedHours::Id: { - using TypeInfo = Attributes::LampRatedHours::TypeInfo; + case Attributes::SoundVolume::Id: { + using TypeInfo = Attributes::SoundVolume::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::LampBurnHours::Id: { - using TypeInfo = Attributes::LampBurnHours::TypeInfo; + case Attributes::OperatingMode::Id: { + using TypeInfo = Attributes::OperatingMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::LampAlarmMode::Id: { - using TypeInfo = Attributes::LampAlarmMode::TypeInfo; + case Attributes::SupportedOperatingModes::Id: { + using TypeInfo = Attributes::SupportedOperatingModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::LampBurnHoursTripPoint::Id: { - using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; + case Attributes::DefaultConfigurationRegister::Id: { + using TypeInfo = Attributes::DefaultConfigurationRegister::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::EnableLocalProgramming::Id: { + using TypeInfo = Attributes::EnableLocalProgramming::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::EnableOneTouchLocking::Id: { + using TypeInfo = Attributes::EnableOneTouchLocking::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::EnableInsideStatusLED::Id: { + using TypeInfo = Attributes::EnableInsideStatusLED::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::EnablePrivacyModeButton::Id: { + using TypeInfo = Attributes::EnablePrivacyModeButton::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LocalProgrammingFeatures::Id: { + using TypeInfo = Attributes::LocalProgrammingFeatures::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WrongCodeEntryLimit::Id: { + using TypeInfo = Attributes::WrongCodeEntryLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IlluminanceMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::UserCodeTemporaryDisableTime::Id: { + using TypeInfo = Attributes::UserCodeTemporaryDisableTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::SendPINOverTheAir::Id: { + using TypeInfo = Attributes::SendPINOverTheAir::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::RequirePINforRemoteOperation::Id: { + using TypeInfo = Attributes::RequirePINforRemoteOperation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::ExpiringUserTimeout::Id: { + using TypeInfo = Attributes::ExpiringUserTimeout::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17976,140 +7429,95 @@ static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::LightSensorType::Id: { - using TypeInfo = Attributes::LightSensorType::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForWindowCoveringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WindowCovering; + switch (aAttributeId) { + case Attributes::Type::Id: { + using TypeInfo = Attributes::Type::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PhysicalClosedLimitLift::Id: { + using TypeInfo = Attributes::PhysicalClosedLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::PhysicalClosedLimitTilt::Id: { + using TypeInfo = Attributes::PhysicalClosedLimitTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentPositionLift::Id: { + using TypeInfo = Attributes::CurrentPositionLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CurrentPositionTilt::Id: { + using TypeInfo = Attributes::CurrentPositionTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::NumberOfActuationsLift::Id: { + using TypeInfo = Attributes::NumberOfActuationsLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::NumberOfActuationsTilt::Id: { + using TypeInfo = Attributes::NumberOfActuationsTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18119,21 +7527,34 @@ static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; + case Attributes::ConfigStatus::Id: { + using TypeInfo = Attributes::ConfigStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; } + case Attributes::CurrentPositionLiftPercentage::Id: { + using TypeInfo = Attributes::CurrentPositionLiftPercentage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TemperatureMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::CurrentPositionTiltPercentage::Id: { + using TypeInfo = Attributes::CurrentPositionTiltPercentage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18143,12 +7564,23 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::OperationalStatus::Id: { + using TypeInfo = Attributes::OperationalStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::TargetPositionLiftPercent100ths::Id: { + using TypeInfo = Attributes::TargetPositionLiftPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18158,12 +7590,12 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::TargetPositionTiltPercent100ths::Id: { + using TypeInfo = Attributes::TargetPositionTiltPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18173,147 +7605,115 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::EndProductType::Id: { + using TypeInfo = Attributes::EndProductType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentPositionLiftPercent100ths::Id: { + using TypeInfo = Attributes::CurrentPositionLiftPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::CurrentPositionTiltPercent100ths::Id: { + using TypeInfo = Attributes::CurrentPositionTiltPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::InstalledOpenLimitLift::Id: { + using TypeInfo = Attributes::InstalledOpenLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::InstalledClosedLimitLift::Id: { + using TypeInfo = Attributes::InstalledClosedLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::InstalledOpenLimitTilt::Id: { + using TypeInfo = Attributes::InstalledOpenLimitTilt::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::InstalledClosedLimitTilt::Id: { + using TypeInfo = Attributes::InstalledClosedLimitTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::Mode::Id: { + using TypeInfo = Attributes::Mode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::SafetyStatus::Id: { + using TypeInfo = Attributes::SafetyStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } default: { @@ -18324,58 +7724,46 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( +static id _Nullable DecodeAttributeValueForBarrierControlCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::PressureMeasurement; + using namespace Clusters::BarrierControl; switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::BarrierMovingState::Id: { + using TypeInfo = Attributes::BarrierMovingState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::BarrierSafetyStatus::Id: { + using TypeInfo = Attributes::BarrierSafetyStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::BarrierCapabilities::Id: { + using TypeInfo = Attributes::BarrierCapabilities::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::BarrierOpenEvents::Id: { + using TypeInfo = Attributes::BarrierOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18385,53 +7773,52 @@ static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ScaledValue::Id: { - using TypeInfo = Attributes::ScaledValue::TypeInfo; + case Attributes::BarrierCloseEvents::Id: { + using TypeInfo = Attributes::BarrierCloseEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MinScaledValue::Id: { - using TypeInfo = Attributes::MinScaledValue::TypeInfo; + case Attributes::BarrierCommandOpenEvents::Id: { + using TypeInfo = Attributes::BarrierCommandOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MaxScaledValue::Id: { - using TypeInfo = Attributes::MaxScaledValue::TypeInfo; + case Attributes::BarrierCommandCloseEvents::Id: { + using TypeInfo = Attributes::BarrierCommandCloseEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::BarrierOpenPeriod::Id: { + using TypeInfo = Attributes::BarrierOpenPeriod::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ScaledTolerance::Id: { - using TypeInfo = Attributes::ScaledTolerance::TypeInfo; + case Attributes::BarrierClosePeriod::Id: { + using TypeInfo = Attributes::BarrierClosePeriod::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18441,160 +7828,122 @@ static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Scale::Id: { - using TypeInfo = Attributes::Scale::TypeInfo; + case Attributes::BarrierPosition::Id: { + using TypeInfo = Attributes::BarrierPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PumpConfigurationAndControl; + switch (aAttributeId) { + case Attributes::MaxPressure::Id: { + using TypeInfo = Attributes::MaxPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MaxSpeed::Id: { + using TypeInfo = Attributes::MaxSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxFlow::Id: { + using TypeInfo = Attributes::MaxFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MinConstPressure::Id: { + using TypeInfo = Attributes::MinConstPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MaxConstPressure::Id: { + using TypeInfo = Attributes::MaxConstPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::MinCompPressure::Id: { + using TypeInfo = Attributes::MinCompPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FlowMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::MaxCompPressure::Id: { + using TypeInfo = Attributes::MaxCompPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18604,12 +7953,12 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::MinConstSpeed::Id: { + using TypeInfo = Attributes::MinConstSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18623,8 +7972,8 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::MaxConstSpeed::Id: { + using TypeInfo = Attributes::MaxConstSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18638,160 +7987,101 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( } return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::MinConstFlow::Id: { + using TypeInfo = Attributes::MinConstFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::MaxConstFlow::Id: { + using TypeInfo = Attributes::MaxConstFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MinConstTemp::Id: { + using TypeInfo = Attributes::MinConstTemp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxConstTemp::Id: { + using TypeInfo = Attributes::MaxConstTemp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PumpStatus::Id: { + using TypeInfo = Attributes::PumpStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::EffectiveOperationMode::Id: { + using TypeInfo = Attributes::EffectiveOperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::EffectiveControlMode::Id: { + using TypeInfo = Attributes::EffectiveControlMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RelativeHumidityMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::Capacity::Id: { + using TypeInfo = Attributes::Capacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18801,12 +8091,12 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::Speed::Id: { + using TypeInfo = Attributes::Speed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18820,8 +8110,8 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::LifetimeRunningHours::Id: { + using TypeInfo = Attributes::LifetimeRunningHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18829,149 +8119,62 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( } NSNumber * _Nullable value; if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Power::Id: { + using TypeInfo = Attributes::Power::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LifetimeEnergyConsumed::Id: { + using TypeInfo = Attributes::LifetimeEnergyConsumed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::OperationMode::Id: { + using TypeInfo = Attributes::OperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ControlMode::Id: { + using TypeInfo = Attributes::ControlMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } default: { @@ -18982,101 +8185,109 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOccupancySensingCluster( +static id _Nullable DecodeAttributeValueForThermostatCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OccupancySensing; + using namespace Clusters::Thermostat; switch (aAttributeId) { - case Attributes::Occupancy::Id: { - using TypeInfo = Attributes::Occupancy::TypeInfo; + case Attributes::LocalTemperature::Id: { + using TypeInfo = Attributes::LocalTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::OccupancySensorType::Id: { - using TypeInfo = Attributes::OccupancySensorType::TypeInfo; + case Attributes::OutdoorTemperature::Id: { + using TypeInfo = Attributes::OutdoorTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::OccupancySensorTypeBitmap::Id: { - using TypeInfo = Attributes::OccupancySensorTypeBitmap::TypeInfo; + case Attributes::Occupancy::Id: { + using TypeInfo = Attributes::Occupancy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PIROccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::AbsMinHeatSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::PIRUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::AbsMaxHeatSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMaxHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::AbsMinCoolSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMinCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::AbsMaxCoolSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMaxCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::PICoolingDemand::Id: { + using TypeInfo = Attributes::PICoolingDemand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::PIHeatingDemand::Id: { + using TypeInfo = Attributes::PIHeatingDemand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19086,497 +8297,321 @@ static id _Nullable DecodeAttributeValueForOccupancySensingCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::HVACSystemTypeConfiguration::Id: { + using TypeInfo = Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::LocalTemperatureCalibration::Id: { + using TypeInfo = Attributes::LocalTemperatureCalibration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } - case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::OccupiedCoolingSetpoint::Id: { + using TypeInfo = Attributes::OccupiedCoolingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::OccupiedHeatingSetpoint::Id: { + using TypeInfo = Attributes::OccupiedHeatingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::UnoccupiedCoolingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedCoolingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::UnoccupiedHeatingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedHeatingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MinHeatSetpointLimit::Id: { + using TypeInfo = Attributes::MinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + return value; + } + case Attributes::MaxHeatSetpointLimit::Id: { + using TypeInfo = Attributes::MaxHeatSetpointLimit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MinCoolSetpointLimit::Id: { + using TypeInfo = Attributes::MinCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::MaxCoolSetpointLimit::Id: { + using TypeInfo = Attributes::MaxCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForCarbonMonoxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::CarbonMonoxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::MinSetpointDeadBand::Id: { + using TypeInfo = Attributes::MinSetpointDeadBand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::RemoteSensing::Id: { + using TypeInfo = Attributes::RemoteSensing::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::ControlSequenceOfOperation::Id: { + using TypeInfo = Attributes::ControlSequenceOfOperation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::SystemMode::Id: { + using TypeInfo = Attributes::SystemMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::ThermostatRunningMode::Id: { + using TypeInfo = Attributes::ThermostatRunningMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::StartOfWeek::Id: { + using TypeInfo = Attributes::StartOfWeek::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::NumberOfWeeklyTransitions::Id: { + using TypeInfo = Attributes::NumberOfWeeklyTransitions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::NumberOfDailyTransitions::Id: { + using TypeInfo = Attributes::NumberOfDailyTransitions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::TemperatureSetpointHold::Id: { + using TypeInfo = Attributes::TemperatureSetpointHold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::TemperatureSetpointHoldDuration::Id: { + using TypeInfo = Attributes::TemperatureSetpointHoldDuration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::ThermostatProgrammingOperationMode::Id: { + using TypeInfo = Attributes::ThermostatProgrammingOperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ThermostatRunningState::Id: { + using TypeInfo = Attributes::ThermostatRunningState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SetpointChangeSource::Id: { + using TypeInfo = Attributes::SetpointChangeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SetpointChangeAmount::Id: { + using TypeInfo = Attributes::SetpointChangeAmount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SetpointChangeSourceTimestamp::Id: { + using TypeInfo = Attributes::SetpointChangeSourceTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::OccupiedSetback::Id: { + using TypeInfo = Attributes::OccupiedSetback::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::OccupiedSetbackMin::Id: { + using TypeInfo = Attributes::OccupiedSetbackMin::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::CarbonDioxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::OccupiedSetbackMax::Id: { + using TypeInfo = Attributes::OccupiedSetbackMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19586,14 +8621,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetback::Id: { + using TypeInfo = Attributes::UnoccupiedSetback::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19603,14 +8636,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetbackMin::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMin::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19620,14 +8651,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetbackMax::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19637,260 +8666,187 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::EmergencyHeatDelta::Id: { + using TypeInfo = Attributes::EmergencyHeatDelta::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::ACType::Id: { + using TypeInfo = Attributes::ACType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::ACCapacity::Id: { + using TypeInfo = Attributes::ACCapacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::ACRefrigerantType::Id: { + using TypeInfo = Attributes::ACRefrigerantType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::ACCompressorType::Id: { + using TypeInfo = Attributes::ACCompressorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::ACErrorCode::Id: { + using TypeInfo = Attributes::ACErrorCode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::ACLouverPosition::Id: { + using TypeInfo = Attributes::ACLouverPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ACCoilTemperature::Id: { + using TypeInfo = Attributes::ACCoilTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ACCapacityformat::Id: { + using TypeInfo = Attributes::ACCapacityformat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForFanControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::FanControl; + switch (aAttributeId) { + case Attributes::FanMode::Id: { + using TypeInfo = Attributes::FanMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::FanModeSequence::Id: { + using TypeInfo = Attributes::FanModeSequence::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PercentSetting::Id: { + using TypeInfo = Attributes::PercentSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::PercentCurrent::Id: { + using TypeInfo = Attributes::PercentCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::SpeedMax::Id: { + using TypeInfo = Attributes::SpeedMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::NitrogenDioxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::SpeedSetting::Id: { + using TypeInfo = Attributes::SpeedSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19900,311 +8856,254 @@ static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasureme if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::SpeedCurrent::Id: { + using TypeInfo = Attributes::SpeedCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::RockSupport::Id: { + using TypeInfo = Attributes::RockSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::RockSetting::Id: { + using TypeInfo = Attributes::RockSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::WindSupport::Id: { + using TypeInfo = Attributes::WindSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::WindSetting::Id: { + using TypeInfo = Attributes::WindSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::AirflowDirection::Id: { + using TypeInfo = Attributes::AirflowDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ThermostatUserInterfaceConfiguration; + switch (aAttributeId) { + case Attributes::TemperatureDisplayMode::Id: { + using TypeInfo = Attributes::TemperatureDisplayMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::KeypadLockout::Id: { + using TypeInfo = Attributes::KeypadLockout::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::ScheduleProgrammingVisibility::Id: { + using TypeInfo = Attributes::ScheduleProgrammingVisibility::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForColorControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ColorControl; + switch (aAttributeId) { + case Attributes::CurrentHue::Id: { + using TypeInfo = Attributes::CurrentHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentSaturation::Id: { + using TypeInfo = Attributes::CurrentSaturation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::RemainingTime::Id: { + using TypeInfo = Attributes::RemainingTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::CurrentX::Id: { + using TypeInfo = Attributes::CurrentX::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentY::Id: { + using TypeInfo = Attributes::CurrentY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::DriftCompensation::Id: { + using TypeInfo = Attributes::DriftCompensation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CompensationText::Id: { + using TypeInfo = Attributes::CompensationText::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ColorTemperatureMireds::Id: { + using TypeInfo = Attributes::ColorTemperatureMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ColorMode::Id: { + using TypeInfo = Attributes::ColorMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } + case Attributes::Options::Id: { + using TypeInfo = Attributes::Options::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OzoneConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::NumberOfPrimaries::Id: { + using TypeInfo = Attributes::NumberOfPrimaries::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20214,31 +9113,34 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::Primary1X::Id: { + using TypeInfo = Attributes::Primary1X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary1Y::Id: { + using TypeInfo = Attributes::Primary1Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::Primary1Intensity::Id: { + using TypeInfo = Attributes::Primary1Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20248,44 +9150,34 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Primary2X::Id: { + using TypeInfo = Attributes::Primary2X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::Primary2Y::Id: { + using TypeInfo = Attributes::Primary2Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::Primary2Intensity::Id: { + using TypeInfo = Attributes::Primary2Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20295,204 +9187,171 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::Primary3X::Id: { + using TypeInfo = Attributes::Primary3X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::Primary3Y::Id: { + using TypeInfo = Attributes::Primary3Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::Primary3Intensity::Id: { + using TypeInfo = Attributes::Primary3Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::Primary4X::Id: { + using TypeInfo = Attributes::Primary4X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::Primary4Y::Id: { + using TypeInfo = Attributes::Primary4Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Primary4Intensity::Id: { + using TypeInfo = Attributes::Primary4Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Primary5X::Id: { + using TypeInfo = Attributes::Primary5X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary5Y::Id: { + using TypeInfo = Attributes::Primary5Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary5Intensity::Id: { + using TypeInfo = Attributes::Primary5Intensity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Primary6X::Id: { + using TypeInfo = Attributes::Primary6X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary6Y::Id: { + using TypeInfo = Attributes::Primary6Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Primary6Intensity::Id: { + using TypeInfo = Attributes::Primary6Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::WhitePointX::Id: { + using TypeInfo = Attributes::WhitePointX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WhitePointY::Id: { + using TypeInfo = Attributes::WhitePointY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20502,57 +9361,30 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Pm25ConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::ColorPointRX::Id: { + using TypeInfo = Attributes::ColorPointRX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::ColorPointRY::Id: { + using TypeInfo = Attributes::ColorPointRY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::ColorPointRIntensity::Id: { + using TypeInfo = Attributes::ColorPointRIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20562,44 +9394,34 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::ColorPointGX::Id: { + using TypeInfo = Attributes::ColorPointGX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::ColorPointGY::Id: { + using TypeInfo = Attributes::ColorPointGY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::ColorPointGIntensity::Id: { + using TypeInfo = Attributes::ColorPointGIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20609,204 +9431,126 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::ColorPointBX::Id: { + using TypeInfo = Attributes::ColorPointBX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::ColorPointBY::Id: { + using TypeInfo = Attributes::ColorPointBY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::ColorPointBIntensity::Id: { + using TypeInfo = Attributes::ColorPointBIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::EnhancedCurrentHue::Id: { + using TypeInfo = Attributes::EnhancedCurrentHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::EnhancedColorMode::Id: { + using TypeInfo = Attributes::EnhancedColorMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ColorLoopActive::Id: { + using TypeInfo = Attributes::ColorLoopActive::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ColorLoopDirection::Id: { + using TypeInfo = Attributes::ColorLoopDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ColorLoopTime::Id: { + using TypeInfo = Attributes::ColorLoopTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ColorLoopStartEnhancedHue::Id: { + using TypeInfo = Attributes::ColorLoopStartEnhancedHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ColorLoopStoredEnhancedHue::Id: { + using TypeInfo = Attributes::ColorLoopStoredEnhancedHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ColorCapabilities::Id: { + using TypeInfo = Attributes::ColorCapabilities::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20816,74 +9560,41 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FormaldehydeConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::ColorTempPhysicalMinMireds::Id: { + using TypeInfo = Attributes::ColorTempPhysicalMinMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::ColorTempPhysicalMaxMireds::Id: { + using TypeInfo = Attributes::ColorTempPhysicalMaxMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::CoupleColorTempToLevelMinMireds::Id: { + using TypeInfo = Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::StartUpColorTemperatureMireds::Id: { + using TypeInfo = Attributes::StartUpColorTemperatureMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20893,244 +9604,207 @@ static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementC if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BallastConfiguration; + switch (aAttributeId) { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::IntrinsicBallastFactor::Id: { + using TypeInfo = Attributes::IntrinsicBallastFactor::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21139,12 +9813,11 @@ static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementC *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Pm1ConcentrationMeasurement; + using namespace Clusters::IlluminanceMeasurement; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21156,12 +9829,10 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MinMeasuredValue::Id: { using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21173,12 +9844,10 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MaxMeasuredValue::Id: { using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21190,14 +9859,23 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::LightSensorType::Id: { + using TypeInfo = Attributes::LightSensorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21207,27 +9885,40 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TemperatureMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21237,214 +9928,172 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PressureMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } + return value; + } + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ScaledValue::Id: { + using TypeInfo = Attributes::ScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MinScaledValue::Id: { + using TypeInfo = Attributes::MinScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MaxScaledValue::Id: { + using TypeInfo = Attributes::MaxScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ScaledTolerance::Id: { + using TypeInfo = Attributes::ScaledTolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::Scale::Id: { + using TypeInfo = Attributes::Scale::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21453,12 +10102,11 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Pm10ConcentrationMeasurement; + using namespace Clusters::FlowMeasurement; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21470,12 +10118,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MinMeasuredValue::Id: { using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21487,12 +10133,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MaxMeasuredValue::Id: { using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21504,14 +10148,36 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RelativeHumidityMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21521,27 +10187,27 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21551,40 +10217,47 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOccupancySensingCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OccupancySensing; + switch (aAttributeId) { + case Attributes::Occupancy::Id: { + using TypeInfo = Attributes::Occupancy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::OccupancySensorType::Id: { + using TypeInfo = Attributes::OccupancySensorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21594,171 +10267,116 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::OccupancySensorTypeBitmap::Id: { + using TypeInfo = Attributes::OccupancySensorTypeBitmap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::PIROccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::PIRUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21767,10 +10385,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForCarbonMonoxideConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement; + using namespace Clusters::CarbonMonoxideConcentrationMeasurement; switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { @@ -21859,217 +10477,79 @@ static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentr TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL @@ -22081,10 +10561,10 @@ static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentr *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RadonConcentrationMeasurement; + using namespace Clusters::CarbonDioxideConcentrationMeasurement; switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { @@ -22249,141 +10729,179 @@ static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::NitrogenDioxideConcentrationMeasurement; + switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL @@ -22395,134 +10913,112 @@ static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::WakeOnLan; + using namespace Clusters::OzoneConcentrationMeasurement; switch (aAttributeId) { - case Attributes::MACAddress::Id: { - using TypeInfo = Attributes::MACAddress::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -22532,284 +11028,173 @@ static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttribu value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; return value; } - default: { - break; - } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Channel; - switch (aAttributeId) { - case Attributes::ChannelList::Id: { - using TypeInfo = Attributes::ChannelList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRChannelClusterChannelInfoStruct * newElement_0; - newElement_0 = [MTRChannelClusterChannelInfoStruct new]; - newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; - newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - if (entry_0.callSign.HasValue()) { - newElement_0.callSign = AsString(entry_0.callSign.Value()); - if (newElement_0.callSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.callSign = nil; - } - if (entry_0.affiliateCallSign.HasValue()) { - newElement_0.affiliateCallSign = AsString(entry_0.affiliateCallSign.Value()); - if (newElement_0.affiliateCallSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.affiliateCallSign = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Lineup::Id: { - using TypeInfo = Attributes::Lineup::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Pm25ConcentrationMeasurement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRChannelClusterLineupInfoStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRChannelClusterLineupInfoStruct new]; - value.operatorName = AsString(cppValue.Value().operatorName); - if (value.operatorName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (cppValue.Value().lineupName.HasValue()) { - value.lineupName = AsString(cppValue.Value().lineupName.Value()); - if (value.lineupName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.lineupName = nil; - } - if (cppValue.Value().postalCode.HasValue()) { - value.postalCode = AsString(cppValue.Value().postalCode.Value()); - if (value.postalCode == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.postalCode = nil; - } - value.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().lineupInfoType)]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentChannel::Id: { - using TypeInfo = Attributes::CurrentChannel::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRChannelClusterChannelInfoStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRChannelClusterChannelInfoStruct new]; - value.majorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().majorNumber]; - value.minorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().minorNumber]; - if (cppValue.Value().name.HasValue()) { - value.name = AsString(cppValue.Value().name.Value()); - if (value.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.name = nil; - } - if (cppValue.Value().callSign.HasValue()) { - value.callSign = AsString(cppValue.Value().callSign.Value()); - if (value.callSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.callSign = nil; - } - if (cppValue.Value().affiliateCallSign.HasValue()) { - value.affiliateCallSign = AsString(cppValue.Value().affiliateCallSign.Value()); - if (value.affiliateCallSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.affiliateCallSign = nil; - } + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -22819,17 +11204,59 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -22838,163 +11265,112 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( +static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::TargetNavigator; + using namespace Clusters::FormaldehydeConcentrationMeasurement; switch (aAttributeId) { - case Attributes::TargetList::Id: { - using TypeInfo = Attributes::TargetList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTargetNavigatorClusterTargetInfoStruct * newElement_0; - newElement_0 = [MTRTargetNavigatorClusterTargetInfoStruct new]; - newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentTarget::Id: { - using TypeInfo = Attributes::CurrentTarget::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23004,32 +11380,23 @@ static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::MediaPlayback; - switch (aAttributeId) { - case Attributes::CurrentState::Id: { - using TypeInfo = Attributes::CurrentState::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23039,70 +11406,83 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::StartTime::Id: { - using TypeInfo = Attributes::StartTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Duration::Id: { - using TypeInfo = Attributes::Duration::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::SampledPosition::Id: { - using TypeInfo = Attributes::SampledPosition::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Pm1ConcentrationMeasurement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; - value.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.Value().updatedAt]; - if (cppValue.Value().position.IsNull()) { - value.position = nil; - } else { - value.position = [NSNumber numberWithUnsignedLongLong:cppValue.Value().position.Value()]; - } + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::PlaybackSpeed::Id: { - using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } return value; } - case Attributes::SeekRangeEnd::Id: { - using TypeInfo = Attributes::SeekRangeEnd::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23112,12 +11492,14 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::SeekRangeStart::Id: { - using TypeInfo = Attributes::SeekRangeStart::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23127,138 +11509,106 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23267,190 +11617,174 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForMediaInputCluster( +static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::MediaInput; + using namespace Clusters::Pm10ConcentrationMeasurement; switch (aAttributeId) { - case Attributes::InputList::Id: { - using TypeInfo = Attributes::InputList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRMediaInputClusterInputInfoStruct * newElement_0; - newElement_0 = [MTRMediaInputClusterInputInfoStruct new]; - newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; - newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.descriptionString = AsString(entry_0.description); - if (newElement_0.descriptionString == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentInput::Id: { - using TypeInfo = Attributes::CurrentInput::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23459,118 +11793,82 @@ static id _Nullable DecodeAttributeValueForMediaInputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::LowPower; + using namespace Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement; switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23580,158 +11878,89 @@ static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttribut value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForKeypadInputCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::KeypadInput; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23740,44 +11969,82 @@ static id _Nullable DecodeAttributeValueForKeypadInputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForContentLauncherCluster( +static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ContentLauncher; + using namespace Clusters::RadonConcentrationMeasurement; switch (aAttributeId) { - case Attributes::AcceptHeader::Id: { - using TypeInfo = Attributes::AcceptHeader::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::SupportedStreamingProtocols::Id: { - using TypeInfo = Attributes::SupportedStreamingProtocols::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23787,134 +12054,89 @@ static id _Nullable DecodeAttributeValueForContentLauncherCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23923,58 +12145,40 @@ static id _Nullable DecodeAttributeValueForContentLauncherCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForAudioOutputCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::AudioOutput; + using namespace Clusters::WakeOnLan; switch (aAttributeId) { - case Attributes::OutputList::Id: { - using TypeInfo = Attributes::OutputList::TypeInfo; + case Attributes::MACAddress::Id: { + using TypeInfo = Attributes::MACAddress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAudioOutputClusterOutputInfoStruct * newElement_0; - newElement_0 = [MTRAudioOutputClusterOutputInfoStruct new]; - newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; - newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentOutput::Id: { - using TypeInfo = Attributes::CurrentOutput::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Channel; + switch (aAttributeId) { + case Attributes::ChannelList::Id: { + using TypeInfo = Attributes::ChannelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23986,8 +12190,40 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRChannelClusterChannelInfoStruct * newElement_0; + newElement_0 = [MTRChannelClusterChannelInfoStruct new]; + newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; + newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + if (entry_0.callSign.HasValue()) { + newElement_0.callSign = AsString(entry_0.callSign.Value()); + if (newElement_0.callSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.callSign = nil; + } + if (entry_0.affiliateCallSign.HasValue()) { + newElement_0.affiliateCallSign = AsString(entry_0.affiliateCallSign.Value()); + if (newElement_0.affiliateCallSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.affiliateCallSign = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -23999,62 +12235,110 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Lineup::Id: { + using TypeInfo = Attributes::Lineup::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { + MTRChannelClusterLineupInfoStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRChannelClusterLineupInfoStruct new]; + value.operatorName = AsString(cppValue.Value().operatorName); + if (value.operatorName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } - value = array_0; + if (cppValue.Value().lineupName.HasValue()) { + value.lineupName = AsString(cppValue.Value().lineupName.Value()); + if (value.lineupName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.lineupName = nil; + } + if (cppValue.Value().postalCode.HasValue()) { + value.postalCode = AsString(cppValue.Value().postalCode.Value()); + if (value.postalCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.postalCode = nil; + } + value.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().lineupInfoType)]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentChannel::Id: { + using TypeInfo = Attributes::CurrentChannel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; + MTRChannelClusterChannelInfoStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRChannelClusterChannelInfoStruct new]; + value.majorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().majorNumber]; + value.minorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().minorNumber]; + if (cppValue.Value().name.HasValue()) { + value.name = AsString(cppValue.Value().name.Value()); + if (value.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.name = nil; } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; + if (cppValue.Value().callSign.HasValue()) { + value.callSign = AsString(cppValue.Value().callSign.Value()); + if (value.callSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.callSign = nil; + } + if (cppValue.Value().affiliateCallSign.HasValue()) { + value.affiliateCallSign = AsString(cppValue.Value().affiliateCallSign.Value()); + if (value.affiliateCallSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.affiliateCallSign = nil; } - value = array_0; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TargetNavigator; + switch (aAttributeId) { + case Attributes::TargetList::Id: { + using TypeInfo = Attributes::TargetList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24066,8 +12350,15 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRTargetNavigatorClusterTargetInfoStruct * newElement_0; + newElement_0 = [MTRTargetNavigatorClusterTargetInfoStruct new]; + newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24079,26 +12370,15 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::CurrentTarget::Id: { + using TypeInfo = Attributes::CurrentTarget::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -24109,120 +12389,129 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( +static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ApplicationLauncher; + using namespace Clusters::MediaPlayback; switch (aAttributeId) { - case Attributes::CatalogList::Id: { - using TypeInfo = Attributes::CatalogList::TypeInfo; + case Attributes::CurrentState::Id: { + using TypeInfo = Attributes::CurrentState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::StartTime::Id: { + using TypeInfo = Attributes::StartTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::CurrentApp::Id: { - using TypeInfo = Attributes::CurrentApp::TypeInfo; + case Attributes::Duration::Id: { + using TypeInfo = Attributes::Duration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRApplicationLauncherClusterApplicationEPStruct new]; - value.application = [MTRApplicationLauncherClusterApplicationStruct new]; - value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorID]; - value.application.applicationID = AsString(cppValue.Value().application.applicationID); - if (value.application.applicationID == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (cppValue.Value().endpoint.HasValue()) { - value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::SampledPosition::Id: { + using TypeInfo = Attributes::SampledPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; + value.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.Value().updatedAt]; + if (cppValue.Value().position.IsNull()) { + value.position = nil; } else { - value.endpoint = nil; + value.position = [NSNumber numberWithUnsignedLongLong:cppValue.Value().position.Value()]; } } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PlaybackSpeed::Id: { + using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } + case Attributes::SeekRangeEnd::Id: { + using TypeInfo = Attributes::SeekRangeEnd::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SeekRangeStart::Id: { + using TypeInfo = Attributes::SeekRangeStart::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForMediaInputCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MediaInput; + switch (aAttributeId) { + case Attributes::InputList::Id: { + using TypeInfo = Attributes::InputList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24234,8 +12523,22 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRMediaInputClusterInputInfoStruct * newElement_0; + newElement_0 = [MTRMediaInputClusterInputInfoStruct new]; + newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; + newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.descriptionString = AsString(entry_0.description); + if (newElement_0.descriptionString == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24247,9 +12550,57 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CurrentInput::Id: { + using TypeInfo = Attributes::CurrentInput::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LowPower; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForKeypadInputCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::KeypadInput; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForContentLauncherCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentLauncher; + switch (aAttributeId) { + case Attributes::AcceptHeader::Id: { + using TypeInfo = Attributes::AcceptHeader::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24261,8 +12612,13 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24274,8 +12630,8 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::SupportedStreamingProtocols::Id: { + using TypeInfo = Attributes::SupportedStreamingProtocols::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24285,17 +12641,6 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -24304,112 +12649,13 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForApplicationBasicCluster( +static id _Nullable DecodeAttributeValueForAudioOutputCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ApplicationBasic; + using namespace Clusters::AudioOutput; switch (aAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ApplicationName::Id: { - using TypeInfo = Attributes::ApplicationName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Application::Id: { - using TypeInfo = Attributes::Application::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRApplicationBasicClusterApplicationStruct * _Nonnull value; - value = [MTRApplicationBasicClusterApplicationStruct new]; - value.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorID]; - value.applicationID = AsString(cppValue.applicationID); - if (value.applicationID == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ApplicationVersion::Id: { - using TypeInfo = Attributes::ApplicationVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::AllowedVendorList::Id: { - using TypeInfo = Attributes::AllowedVendorList::TypeInfo; + case Attributes::OutputList::Id: { + using TypeInfo = Attributes::OutputList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24421,8 +12667,16 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; + MTRAudioOutputClusterOutputInfoStruct * newElement_0; + newElement_0 = [MTRAudioOutputClusterOutputInfoStruct new]; + newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; + newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24434,8 +12688,32 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentOutput::Id: { + using TypeInfo = Attributes::CurrentOutput::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ApplicationLauncher; + switch (aAttributeId) { + case Attributes::CatalogList::Id: { + using TypeInfo = Attributes::CatalogList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24448,7 +12726,7 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24460,99 +12738,92 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::CurrentApp::Id: { + using TypeInfo = Attributes::CurrentApp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRApplicationLauncherClusterApplicationEPStruct new]; + value.application = [MTRApplicationLauncherClusterApplicationStruct new]; + value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorID]; + value.application.applicationID = AsString(cppValue.Value().application.applicationID); + if (value.application.applicationID == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } - value = array_0; + if (cppValue.Value().endpoint.HasValue()) { + value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint.Value()]; + } else { + value.endpoint = nil; + } } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForApplicationBasicCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ApplicationBasic; + switch (aAttributeId) { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ApplicationName::Id: { + using TypeInfo = Attributes::ApplicationName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24562,101 +12833,53 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAccountLoginCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AccountLogin; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Application::Id: { + using TypeInfo = Attributes::Application::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRApplicationBasicClusterApplicationStruct * _Nonnull value; + value = [MTRApplicationBasicClusterApplicationStruct new]; + value.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorID]; + value.applicationID = AsString(cppValue.applicationID); + if (value.applicationID == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ApplicationVersion::Id: { + using TypeInfo = Attributes::ApplicationVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::AllowedVendorList::Id: { + using TypeInfo = Attributes::AllowedVendorList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24669,7 +12892,7 @@ static id _Nullable DecodeAttributeValueForAccountLoginCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24681,28 +12904,19 @@ static id _Nullable DecodeAttributeValueForAccountLoginCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; + default: { + break; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAccountLoginCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AccountLogin; + switch (aAttributeId) { default: { break; } @@ -26011,88 +14225,22 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } - case Attributes::ReactivePowerPhaseC::Id: { - using TypeInfo = Attributes::ReactivePowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } - case Attributes::ApparentPowerPhaseC::Id: { - using TypeInfo = Attributes::ApparentPowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::PowerFactorPhaseC::Id: { - using TypeInfo = Attributes::PowerFactorPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; - return value; - } - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; + case Attributes::ReactivePowerPhaseC::Id: { + using TypeInfo = Attributes::ReactivePowerPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; + case Attributes::ApparentPowerPhaseC::Id: { + using TypeInfo = Attributes::ApparentPowerPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -26102,19 +14250,19 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::RmsVoltageSagPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; + case Attributes::PowerFactorPhaseC::Id: { + using TypeInfo = Attributes::PowerFactorPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } - case Attributes::RmsVoltageSwellPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; + case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -26124,125 +14272,63 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::RmsVoltageSagPeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::RmsVoltageSwellPeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -27677,134 +15763,6 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -27816,6 +15774,10 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster( id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { + if (IsGlobalAttribute(aPath.mAttributeId)) { + return DecodeGlobalAttributeValue(aPath.mAttributeId, aReader, aError); + } + switch (aPath.mClusterId) { case Clusters::Identify::Id: { return DecodeAttributeValueForIdentifyCluster(aPath.mAttributeId, aReader, aError); diff --git a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m index 53c4e47b498804..799974fb7c04f7 100644 --- a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m @@ -1111,4 +1111,59 @@ - (void)test036_CommandResponseWrongData XCTAssertEqual(error.code, MTRErrorCodeSchemaMismatch); } +- (void)globalListAttributeHelper:(NSNumber *)clusterID +{ + // clusterID, AcceptedCommandList + NSDictionary * input = @{ + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:clusterID attributeID:@(0xFFF9)], + MTRDataKey : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + }, + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(8), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * report = [[MTRAttributeReport alloc] initWithResponseValue:input error:&error]; + XCTAssertNotNil(report); + XCTAssertNil(error); + + XCTAssertEqualObjects(input[MTRAttributePathKey], report.path); + XCTAssertNotNil(report.value); + XCTAssertTrue([report.value isKindOfClass:[NSArray class]]); + + NSArray * array = report.value; + XCTAssertTrue([array[0] isKindOfClass:[NSNumber class]]); + XCTAssertEqualObjects(array[0], @(5)); + + XCTAssertTrue([array[1] isKindOfClass:[NSNumber class]]); + XCTAssertEqualObjects(array[1], @(8)); + + XCTAssertNil(report.error); +} + +- (void)test037_GlobalListAttributeStandardCluster +{ + // OnOff cluster. + [self globalListAttributeHelper:@(0x0006)]; +} + +- (void)test037_GlobalListAttributeManufacturerSpecific +{ + // Manufacturer specific cluster IDs start at 0xFC00. + [self globalListAttributeHelper:@(0xFFF4FD01)]; +} + @end From 40f8d796838881277aa1e642e50c7836b10502e4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 21:49:02 -0400 Subject: [PATCH 59/96] Allow creating Darwin controllers via alloc/initWithParameters. (#29025) * Allow creating Darwin controllers via alloc/initWithParameters. * Address review comment. --- .../Framework/CHIP/MTRDeviceController.h | 22 ++- .../Framework/CHIP/MTRDeviceController.mm | 20 +++ .../CHIP/MTRDeviceControllerFactory.h | 31 +--- .../CHIP/MTRDeviceControllerFactory.mm | 160 ++++++++---------- .../MTRDeviceControllerFactory_Internal.h | 24 +++ ...ters.h => MTRDeviceControllerParameters.h} | 4 +- ...> MTRDeviceControllerParameters_Wrapper.h} | 4 +- .../CHIP/MTRDeviceControllerStartupParams.mm | 12 +- ...TRDeviceControllerStartupParams_Internal.h | 10 +- src/darwin/Framework/CHIP/Matter.h | 2 +- .../CHIPTests/MTRControllerAdvertisingTests.m | 42 ++--- .../CHIPTests/MTRPerControllerStorageTests.m | 41 ++--- .../Matter.xcodeproj/project.pbxproj | 8 +- 13 files changed, 183 insertions(+), 197 deletions(-) rename src/darwin/Framework/CHIP/{MTRDeviceControllerStartupParameters.h => MTRDeviceControllerParameters.h} (96%) rename src/darwin/Framework/CHIP/{MTRDeviceControllerStartupParameters_Wrapper.h => MTRDeviceControllerParameters_Wrapper.h} (86%) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index d8636796707946..3831a4979475e6 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -23,6 +23,10 @@ @class MTRBaseDevice; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +@class MTRDeviceControllerParameters; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + NS_ASSUME_NONNULL_BEGIN MTR_DEPRECATED("Please use MTRBaseDevice deviceWithNodeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -37,11 +41,27 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS @interface MTRDeviceController : NSObject /** - * Controllers are created via the MTRDeviceControllerFactory object. + * Controllers are created via the MTRDeviceControllerFactory object or + * initialized via initWithParameters:error:. */ - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +/** + * Initialize a device controller with the provided parameters. This will: + * + * 1) Auto-start the MTRDeviceControllerFactory in storage-per-controller mode + * if it has not already been started. + * 2) Return nil or a running controller. + * + * Once this returns non-nil, it's the caller's resposibility to call shutdown + * on the controller to avoid leaking it. + */ +- (nullable instancetype)initWithParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + /** * If true, the controller has not been shut down yet. */ diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 98d757d6d291e7..ee0f845597aef8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -16,6 +16,12 @@ */ #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #import "MTRDeviceController_Internal.h" #import "MTRAttestationTrustStoreBridge.h" @@ -119,6 +125,20 @@ @interface MTRDeviceController () { @implementation MTRDeviceController +- (nullable instancetype)initWithParameters:(MTRDeviceControllerParameters *)parameters error:(NSError * __autoreleasing *)error +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + if (!factory.isRunning) { + auto * params = [[MTRDeviceControllerFactoryParams alloc] initWithoutStorage]; + + if (![factory startControllerFactory:params error:error]) { + return nil; + } + } + + return [factory initializeController:self withParameters:parameters error:error]; +} + - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory queue:(dispatch_queue_t)queue storageDelegate:(id _Nullable)storageDelegate diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h index 5cb4b7c7fd188f..3dfb3eaa9478bd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h @@ -23,11 +23,6 @@ #import #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import -#else -@class MTRDeviceControllerStartupParameters; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED NS_ASSUME_NONNULL_BEGIN @@ -42,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDeviceControllerFactoryParams : NSObject + +- (instancetype)init NS_UNAVAILABLE; + /* * Storage used to store persistent information for the fabrics the * controllers ends up interacting with. This is only used if "initWithStorage" @@ -98,15 +96,6 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (instancetype)initWithStorage:(id)storage; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -/* - * Initialize the device controller factory without storage. In this mode, - * device controllers will need to have per-controller storage provided to allow - * storing controller-specific information. - */ -- (instancetype)init MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - @end API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @@ -188,20 +177,6 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -/** - * Create an MTRDeviceController. Returns nil on failure. - * - * This method will fail if there is already a controller running for the given - * node identity. - * - * This method will fail if the controller factory was not initialized in - * storage-per-controller mode. - */ -- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters - error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - @end MTR_DEPRECATED( diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 31b261ad74b79a..21660828e25847 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -17,6 +17,14 @@ #import "MTRDeviceControllerFactory.h" #import "MTRDeviceControllerFactory_Internal.h" +#import + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #import "MTRCertificates.h" #import "MTRControllerAccessControl.h" #import "MTRDemuxingStorage.h" @@ -34,9 +42,6 @@ #import "MTRPersistentStorageDelegateBridge.h" #import "MTRSessionResumptionStorageBridge.h" #import "NSDataSpanConversion.h" -#if !MTR_PER_CONTROLLER_STORAGE_ENABLED -#import "MTRDeviceControllerStartupParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import @@ -547,8 +552,12 @@ - (void)stopControllerFactory * The fabricChecker block will run on the Matter queue, and is expected to * return nil if pre-startup fabric table checks fail, and set fabricError to * the right error value in that situation. + * + * The provided controller is expected to have just been allocated and to not be + * initialized yet. */ -- (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams +- (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController *)controller + startupParams:(id)startupParams fabricChecker:(MTRDeviceControllerStartupParamsInternal * (^)(FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError))fabricChecker @@ -566,8 +575,8 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams NSUUID * uniqueIdentifier; id _Nullable otaProviderDelegate; dispatch_queue_t _Nullable otaProviderDelegateQueue; - if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParameters class]]) { - MTRDeviceControllerStartupParameters * params = startupParams; + if ([startupParams isKindOfClass:[MTRDeviceControllerParameters class]]) { + MTRDeviceControllerParameters * params = startupParams; storageDelegate = params.storageDelegate; storageDelegateQueue = params.storageDelegateQueue; uniqueIdentifier = params.uniqueIdentifier; @@ -608,20 +617,35 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams otaProviderDelegateQueue = self.otaProviderDelegateQueue; } - // Create the controller, so we start the event loop, since we plan to do - // our fabric table operations there. - auto * controller = [self _createController:storageDelegate - storageDelegateQueue:storageDelegateQueue - otaProviderDelegate:otaProviderDelegate - otaProviderDelegateQueue:otaProviderDelegateQueue - uniqueIdentifier:uniqueIdentifier]; + controller = [controller initWithFactory:self + queue:_chipWorkQueue + storageDelegate:storageDelegate + storageDelegateQueue:storageDelegateQueue + otaProviderDelegate:otaProviderDelegate + otaProviderDelegateQueue:otaProviderDelegateQueue + uniqueIdentifier:uniqueIdentifier]; if (controller == nil) { if (error != nil) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]; + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; } return nil; } + if ([_controllers count] == 0) { + // Bringing up the first controller. Start the event loop now. If we + // fail to bring it up, its cleanup will stop the event loop again. + chip::DeviceLayer::PlatformMgrImpl().StartEventLoopTask(); + dispatch_sync(_chipWorkQueue, ^{ + self->_operationalBrowser = new MTROperationalBrowser(self, self->_chipWorkQueue); + }); + } + + // Add the controller to _controllers now, so if we fail partway through its + // startup we will still do the right cleanups. + os_unfair_lock_lock(&_controllersLock); + [_controllers addObject:controller]; + os_unfair_lock_unlock(&_controllersLock); + __block MTRDeviceControllerStartupParamsInternal * params = nil; __block CHIP_ERROR fabricError = CHIP_NO_ERROR; @@ -716,7 +740,8 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo return nil; } - return [self _startDeviceController:startupParams + return [self _startDeviceController:[MTRDeviceController alloc] + startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { const FabricInfo * fabric = nullptr; @@ -792,7 +817,8 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl return nil; } - return [self _startDeviceController:startupParams + return [self _startDeviceController:[MTRDeviceController alloc] + startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { const FabricInfo * fabric = nullptr; @@ -825,73 +851,6 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl error:error]; } -- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters - error:(NSError * __autoreleasing *)error -{ - [self _assertCurrentQueueIsNotMatterQueue]; - - return [self _startDeviceController:startupParameters - fabricChecker:^MTRDeviceControllerStartupParamsInternal *( - FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { - auto advertiseOperational = self.advertiseOperational && startupParameters.shouldAdvertiseOperational; - auto * params = - [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller - fabricTable:fabricTable - keystore:self->_keystore - advertiseOperational:advertiseOperational - params:startupParameters - error:fabricError]; - if (params != nil) { - if (params.productAttestationAuthorityCertificates == nil) { - params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; - } - if (params.certificationDeclarationCertificates == nil) { - params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; - } - } - return params; - } - error:error]; -} - -- (MTRDeviceController * _Nullable)_createController:(id _Nullable)storageDelegate - storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue - otaProviderDelegate:(id _Nullable)otaProviderDelegate - otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue - uniqueIdentifier:(NSUUID *)uniqueIdentifier -{ - [self _assertCurrentQueueIsNotMatterQueue]; - - MTRDeviceController * controller = [[MTRDeviceController alloc] initWithFactory:self - queue:_chipWorkQueue - storageDelegate:storageDelegate - storageDelegateQueue:storageDelegateQueue - otaProviderDelegate:otaProviderDelegate - otaProviderDelegateQueue:otaProviderDelegateQueue - uniqueIdentifier:uniqueIdentifier]; - if (controller == nil) { - MTR_LOG_ERROR("Failed to init controller"); - return nil; - } - - if ([_controllers count] == 0) { - // Bringing up the first controller. Start the event loop now. If we - // fail to bring it up, its cleanup will stop the event loop again. - chip::DeviceLayer::PlatformMgrImpl().StartEventLoopTask(); - dispatch_sync(_chipWorkQueue, ^{ - self->_operationalBrowser = new MTROperationalBrowser(self, self->_chipWorkQueue); - }); - } - - // Add the controller to _controllers now, so if we fail partway through its - // startup we will still do the right cleanups. - os_unfair_lock_lock(&_controllersLock); - [_controllers addObject:controller]; - os_unfair_lock_unlock(&_controllersLock); - - return controller; -} - // Finds a fabric that matches the given params, if one exists. // // Returns NO on failure, YES on success. If YES is returned, the @@ -1126,6 +1085,37 @@ - (void)operationalInstanceAdded:(chip::PeerId &)operationalID } } +- (MTRDeviceController * _Nullable)initializeController:(MTRDeviceController *)controller + withParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error +{ + [self _assertCurrentQueueIsNotMatterQueue]; + + return [self _startDeviceController:controller + startupParams:parameters + fabricChecker:^MTRDeviceControllerStartupParamsInternal *( + FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { + auto advertiseOperational = self.advertiseOperational && parameters.shouldAdvertiseOperational; + auto * params = + [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller + fabricTable:fabricTable + keystore:self->_keystore + advertiseOperational:advertiseOperational + params:parameters + error:fabricError]; + if (params != nil) { + if (params.productAttestationAuthorityCertificates == nil) { + params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; + } + if (params.certificationDeclarationCertificates == nil) { + params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; + } + } + return params; + } + error:error]; +} + - (PersistentStorageDelegate *)storageDelegate { return _persistentStorageDelegate; @@ -1176,7 +1166,7 @@ - (instancetype)initWithStorage:(id)storage return self; } -- (instancetype)init +- (instancetype)initWithoutStorage { if (!(self = [super init])) { return nil; @@ -1191,7 +1181,7 @@ - (instancetype)init _productAttestationAuthorityCertificates = nil; _certificationDeclarationCertificates = nil; _port = nil; - _shouldStartServer = NO; + _shouldStartServer = YES; return self; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 9717f5062c93f5..72827d10131d89 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -20,6 +20,14 @@ */ #import +#import +#import + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import "MTRDeviceControllerFactory.h" @@ -67,9 +75,25 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)operationalInstanceAdded:(chip::PeerId &)operationalID; +/** + * Initialize an MTRDeviceController with the given parameters. + */ +- (nullable MTRDeviceController *)initializeController:(MTRDeviceController *)controller + withParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error; + @property (readonly) chip::PersistentStorageDelegate * storageDelegate; @property (readonly) chip::Credentials::GroupDataProvider * groupData; @end +@interface MTRDeviceControllerFactoryParams () +/* + * Initialize the device controller factory without storage. In this mode, + * device controllers will need to have per-controller storage provided to allow + * storing controller-specific information. + */ +- (instancetype)initWithoutStorage; +@end + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h similarity index 96% rename from src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h rename to src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index 7b69f0f3d96531..bcbea7902b6083 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN MTR_HIDDEN #endif MTR_NEWLY_AVAILABLE -@interface MTRDeviceControllerStartupParameters : NSObject +@interface MTRDeviceControllerParameters : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -81,7 +81,7 @@ MTR_NEWLY_AVAILABLE MTR_HIDDEN #endif MTR_NEWLY_AVAILABLE -@interface MTRDeviceControllerExternalCertificateStartupParameters : MTRDeviceControllerStartupParameters +@interface MTRDeviceControllerExternalCertificateParameters : MTRDeviceControllerParameters - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h similarity index 86% rename from src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h rename to src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h index 537958dabf37fb..4f26e1a49c9d18 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h @@ -17,9 +17,9 @@ #include #if MTR_PER_CONTROLLER_STORAGE_ENABLED -#error Should be including Matter/MTRDeviceControllerStartupParameters.h +#error Should be including Matter/MTRDeviceControllerParameters.h #endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #define MTR_INTERNAL_INCLUDE -#import +#import #undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 3da8a906c0886d..0c14065199e507 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -144,15 +144,15 @@ - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params return self; } -- (instancetype)initWithParameters:(MTRDeviceControllerStartupParameters *)params error:(CHIP_ERROR &)error +- (instancetype)initWithParameters:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error { if (!(self = [super init])) { error = CHIP_ERROR_INCORRECT_STATE; return nil; } - if (![params isKindOfClass:[MTRDeviceControllerExternalCertificateStartupParameters class]]) { - MTR_LOG_ERROR("Unexpected subclass of MTRDeviceControllerStartupParameters"); + if (![params isKindOfClass:[MTRDeviceControllerExternalCertificateParameters class]]) { + MTR_LOG_ERROR("Unexpected subclass of MTRDeviceControllerParameters"); error = CHIP_ERROR_INVALID_ARGUMENT; return nil; } @@ -251,7 +251,7 @@ - (instancetype)initWithOperationalKeypair:(id)operationalKeypair @end -@implementation MTRDeviceControllerStartupParameters +@implementation MTRDeviceControllerParameters - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier @@ -301,7 +301,7 @@ - (void)setOTAProviderDelegate:(id)otaProviderDelegate q @end -@implementation MTRDeviceControllerExternalCertificateStartupParameters +@implementation MTRDeviceControllerExternalCertificateParameters - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier @@ -542,7 +542,7 @@ - (instancetype)initForNewController:(MTRDeviceController *)controller fabricTable:(chip::FabricTable *)fabricTable keystore:(chip::Crypto::OperationalKeystore *)keystore advertiseOperational:(BOOL)advertiseOperational - params:(MTRDeviceControllerStartupParameters *)params + params:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error { if (!(self = [super initWithParameters:params error:error])) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 9d52067d510982..2850fc78258486 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -21,9 +21,9 @@ #import #import #if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import +#import #else -#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#import "MTRDeviceControllerParameters_Wrapper.h" #endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params; @end -@interface MTRDeviceControllerStartupParameters () +@interface MTRDeviceControllerParameters () - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate rootCertificate:(MTRCertificateDERBytes)rootCertificate; -// When we have other subclasses of MTRDeviceControllerStartupParameters, we may +// When we have other subclasses of MTRDeviceControllerParameters, we may // need to make more things nullable here and/or add more fields. But for now // we know exactly what information we have. @property (nonatomic, copy, readonly) NSData * ipk; @@ -157,7 +157,7 @@ MTR_HIDDEN fabricTable:(chip::FabricTable *)fabricTable keystore:(chip::Crypto::OperationalKeystore *)keystore advertiseOperational:(BOOL)advertiseOperational - params:(MTRDeviceControllerStartupParameters *)params + params:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error; /** diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 63c067f48d084d..2cf62428bbfc2c 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -42,7 +42,7 @@ #import #import #import -#import +#import #import #import #import diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m index 549d66ec3826a5..b7fa9a1cfa574f 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -133,8 +133,6 @@ - (void)setUp [self setContinueAfterFailure:NO]; _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - - [self startFactory]; } - (void)tearDown @@ -145,22 +143,6 @@ - (void)tearDown [super tearDown]; } -- (void)startFactory -{ - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - - __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; - factoryParams.shouldStartServer = YES; - - NSError * error; - BOOL ok = [factory startControllerFactory:factoryParams error:&error]; - XCTAssertNil(error); - XCTAssertTrue(ok); - - XCTAssertTrue(factory.isRunning); -} - - (void)stopFactory { __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; @@ -180,9 +162,6 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo { XCTAssertTrue(error != NULL); - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - // Specify a fixed issuerID, so we get the same cert if we use the same keys. __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; XCTAssertNil(*error); @@ -198,21 +177,20 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo XCTAssertNil(*error); XCTAssertNotNil(operational); - __auto_type * params = - [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage - storageDelegateQueue:_storageQueue - uniqueIdentifier:storage.controllerID - ipk:rootKeys.ipk - vendorID:@(kTestVendorId) - operationalKeypair:operationalKeys - operationalCertificate:operational - intermediateCertificate:nil - rootCertificate:root]; + __auto_type * params = [[MTRDeviceControllerExternalCertificateParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; XCTAssertNotNil(params); params.shouldAdvertiseOperational = advertiseOperational; - return [factory createController:params error:error]; + return [[MTRDeviceController alloc] initWithParameters:params error:error]; } - (void)test001_CheckAdvertisingAsExpected diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index f81cc23af4e44e..8bbb529236671e 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -30,7 +30,6 @@ static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; -static const uint16_t kLocalPort = 5541; static const uint16_t kTestVendorId = 0xFFF1u; @interface MTRPerControllerStorageTestsControllerDelegate : NSObject @@ -194,8 +193,6 @@ - (void)setUp [self setContinueAfterFailure:NO]; _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - - [self startFactory]; } - (void)tearDown @@ -206,20 +203,6 @@ - (void)tearDown [super tearDown]; } -- (void)startFactory -{ - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - - __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; - factoryParams.port = @(kLocalPort); - - NSError * error; - BOOL ok = [factory startControllerFactory:factoryParams error:&error]; - XCTAssertNil(error); - XCTAssertTrue(ok); -} - - (void)stopFactory { __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; @@ -262,9 +245,6 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo { XCTAssertTrue(error != NULL); - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - // Specify a fixed issuerID, so we get the same cert if we use the same keys. __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; XCTAssertNil(*error); @@ -280,16 +260,15 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo XCTAssertNil(*error); XCTAssertNotNil(operational); - __auto_type * params = - [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage - storageDelegateQueue:_storageQueue - uniqueIdentifier:storage.controllerID - ipk:rootKeys.ipk - vendorID:@(kTestVendorId) - operationalKeypair:operationalKeys - operationalCertificate:operational - intermediateCertificate:nil - rootCertificate:root]; + __auto_type * params = [[MTRDeviceControllerExternalCertificateParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; XCTAssertNotNil(params); __auto_type * ourCertificateIssuer = [[MTRPerControllerStorageTestsCertificateIssuer alloc] initWithRootCertificate:root @@ -304,7 +283,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo [params setOperationalCertificateIssuer:ourCertificateIssuer queue:dispatch_get_main_queue()]; - return [factory createController:params error:error]; + return [[MTRDeviceController alloc] initWithParameters:params error:error]; } - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index a95c790993dfd5..fc6fcc5c7f2c13 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -159,7 +159,7 @@ 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */; }; 51565CB22A7AD77600469F18 /* MTRDeviceControllerDataStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */; }; 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; 515C1C6F284F9FFB00A48F0C /* MTRFramework.mm in Sources */ = {isa = PBXBuildFile; fileRef = 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */; }; 515C1C70284F9FFB00A48F0C /* MTRFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */; }; 51669AF02913204400F4AA36 /* MTRBackwardsCompatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */; }; @@ -474,7 +474,7 @@ 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerDataStore.h; sourceTree = ""; }; 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceControllerDataStore.mm; sourceTree = ""; }; 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStorageDelegate.h; sourceTree = ""; }; - 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParameters.h; sourceTree = ""; }; + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerParameters.h; sourceTree = ""; }; 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRFramework.mm; sourceTree = ""; }; 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFramework.h; sourceTree = ""; }; 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRBackwardsCompatTests.m; sourceTree = ""; }; @@ -1083,7 +1083,7 @@ 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */, 51E51FBD282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h */, 51E51FBE282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm */, - 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */, + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */, 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */, 5A6FEC9427B5976200F25F42 /* MTRDeviceControllerXPCConnection.h */, 5A6FEC9527B5983000F25F42 /* MTRDeviceControllerXPCConnection.mm */, @@ -1233,7 +1233,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */, + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerParameters.h in Headers */, 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */, 510A07492A685D3900A9241C /* Matter.apinotes in Headers */, 51EF279F2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h in Headers */, From 6b708ab29de982d9fa0363d6ce8a2b9a9840b31a Mon Sep 17 00:00:00 2001 From: Cliff Chung <116232729+cliffamzn@users.noreply.github.com> Date: Tue, 5 Sep 2023 19:23:12 -0700 Subject: [PATCH 60/96] Fixing feature map for resource monitoring cluster (#29074) * Fixing feature map for resource monitoring cluster The replacement product list feature bitmask was set to 0x3 when it should have been set to 0x4. Fixing it here. Verified by looking reading the feature map in the all clusters app and the resource monitoring app: ``` > hepafiltermonitoring read feature-map 1 1 ... [1693934613437] [9078:18462448] [DMG] AttributeReportIBs = [1693934613437] [9078:18462448] [DMG] [ [1693934613437] [9078:18462448] [DMG] AttributeReportIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] AttributeDataIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] DataVersion = 0x443616af, [1693934613437] [9078:18462448] [DMG] AttributePathIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] Endpoint = 0x1, [1693934613437] [9078:18462448] [DMG] Cluster = 0x72, [1693934613437] [9078:18462448] [DMG] Attribute = 0x0000_FFFC, [1693934613437] [9078:18462448] [DMG] } [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] Data = 7, [1693934613437] [9078:18462448] [DMG] }, [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] }, [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] ], ``` This fixes #28197 and #28198 * Updating and adding feature flag tests --- .../all-clusters-app.matter | 8 +-- .../all-clusters-common/all-clusters-app.zap | 7 +- ...umiditysensor_thermostat_56de3d5f45.matter | 4 +- .../resource-monitoring-app.matter | 8 +-- .../resource-monitoring-app.zap | 19 ++--- .../resource-monitoring-cluster-objects.h | 2 +- .../TestActivatedCarbonFilterMonitoring.yaml | 8 +++ .../suites/TestHepaFilterMonitoring.yaml | 8 +++ .../certification/Test_TC_ACFREMON_1_1.yaml | 2 +- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 2 +- .../chip/resource-monitoring-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 4 +- .../python/chip/clusters/Objects.py | 4 +- .../CHIP/zap-generated/MTRBaseClusters.h | 4 +- .../app-common/zap-generated/cluster-enums.h | 4 +- .../zap-generated/test/Commands.h | 72 ++++++++++++++++--- 16 files changed, 116 insertions(+), 42 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 f4b5dfbb3e58c0..58f744659d5801 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 @@ -3162,7 +3162,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -3210,7 +3210,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -6914,7 +6914,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } @@ -6928,7 +6928,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } 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 570a4984aa0c45..bcd0bb239ab26d 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 @@ -18456,7 +18456,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -18710,7 +18710,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -35392,5 +35392,6 @@ "endpointId": 65534, "networkId": 0 } - ] + ], + "log": [] } diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 411c2ab7329d17..d047d19cf62177 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -967,7 +967,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -1011,7 +1011,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index 85a69adcb65dea..60ebc011244e03 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -1538,7 +1538,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -1586,7 +1586,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -2010,7 +2010,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } @@ -2024,7 +2024,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 012f9b9557d681..60857f16ab28e3 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -6373,7 +6373,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6627,7 +6627,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6993,5 +6993,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h index 61d90da007df0a..03598ceb7eafc5 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h @@ -62,7 +62,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 }; // Enum for ProductIdentifierTypeEnum diff --git a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml index c47e01fc473bf4..c1a1a9561353fc 100644 --- a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml +++ b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml @@ -28,6 +28,14 @@ tests: - name: "nodeId" value: nodeId + - label: "Validate the feature map" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x7] + - label: "Read Replacement Product List" command: "readAttribute" attribute: "ReplacementProductList" diff --git a/src/app/tests/suites/TestHepaFilterMonitoring.yaml b/src/app/tests/suites/TestHepaFilterMonitoring.yaml index 44b79eec8afc5c..9492ef1840d283 100644 --- a/src/app/tests/suites/TestHepaFilterMonitoring.yaml +++ b/src/app/tests/suites/TestHepaFilterMonitoring.yaml @@ -28,6 +28,14 @@ tests: - name: "nodeId" value: nodeId + - label: "Validate the feature map" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x7] + - label: "Read Replacement Product List" command: "readAttribute" attribute: "ReplacementProductList" diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index 2d5b61e4e3c3cd..a96963ee818858 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -79,7 +79,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x3] + hasMasksSet: [0x4] - label: "Step 4a: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 7814f985956b25..acc422bd8fc313 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -79,7 +79,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x3] + hasMasksSet: [0x4] - label: "Step 4: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED diff --git a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml index a6be42b1a32e60..efce0eab24d55f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml @@ -68,7 +68,7 @@ limitations under the License. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index ebd2a1cf32c196..8a623075a5ef86 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3497,7 +3497,7 @@ client cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -3546,7 +3546,7 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 96662454953e0e..a3a72f4f87fee1 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -19176,7 +19176,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 class Structs: @dataclass @@ -19471,7 +19471,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 class Structs: @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 64750300422587..8385b0ac441938 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -26673,7 +26673,7 @@ typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringProductIdentifierType) { typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeature) { MTRHEPAFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRHEPAFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringChangeIndication) { @@ -26698,7 +26698,7 @@ typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringProductIdentifierType typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeature) { MTRActivatedCarbonFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRActivatedCarbonFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 40cef5085e5861..c5badb6f9d7091 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1934,7 +1934,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3, + kReplacementProductList = 0x4, }; } // namespace HepaFilterMonitoring @@ -1985,7 +1985,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3, + kReplacementProductList = 0x4, }; } // namespace ActivatedCarbonFilterMonitoring diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 35a6c29cc80972..c3b182ff614a02 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -177436,8 +177436,12 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n"); - err = TestReadReplacementProductList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n"); + err = TestValidateTheFeatureMap_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n"); + err = TestReadReplacementProductList_2(); break; } @@ -177456,6 +177460,9 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -177469,7 +177476,7 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -177484,7 +177491,28 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadReplacementProductList_1() + CHIP_ERROR TestValidateTheFeatureMap_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate the feature map Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadReplacementProductList_2() { MTRBaseDevice * device = GetDevice("alpha"); @@ -177583,8 +177611,12 @@ class TestHepaFilterMonitoring : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n"); - err = TestReadReplacementProductList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n"); + err = TestValidateTheFeatureMap_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n"); + err = TestReadReplacementProductList_2(); break; } @@ -177603,6 +177635,9 @@ class TestHepaFilterMonitoring : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -177616,7 +177651,7 @@ class TestHepaFilterMonitoring : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -177631,7 +177666,28 @@ class TestHepaFilterMonitoring : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadReplacementProductList_1() + CHIP_ERROR TestValidateTheFeatureMap_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate the feature map Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadReplacementProductList_2() { MTRBaseDevice * device = GetDevice("alpha"); From ba45f9ca99c826c1e35cc2a410bc39374ac3b69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Ba=C5=82ys?= Date: Wed, 6 Sep 2023 13:37:06 +0200 Subject: [PATCH 61/96] [nrfconnect][ota] Change image checking condition for OTA. (#28983) If we want to confirm the new firmware update in the AppTask Init method we cannot rely on the imageProcessor. Instead, for the nRF53 target we should check if the image has been confirmed already, and if not, confirm it, for targets other than nRF53 we should use the mcuboot_swap_type function to verify whether the swapping type is equal to REVERT before verifying the image. --- .../nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../lighting-app/nrfconnect/main/AppTask.cpp | 14 +++++-------- examples/lock-app/nrfconnect/main/AppTask.cpp | 6 +----- examples/platform/nrfconnect/util/OTAUtil.cpp | 20 ++++++++++++++----- .../nrfconnect/util/include/OTAUtil.h | 2 +- examples/pump-app/nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../window-app/nrfconnect/main/AppTask.cpp | 6 +----- 10 files changed, 28 insertions(+), 50 deletions(-) diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 7f9b4f87b74eea..217748c218519f 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -180,11 +180,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp index 783096c52d32b5..6ec81dfd5c363b 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp @@ -139,11 +139,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index 6bc4138a9d635a..b64f70472558c4 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -181,11 +181,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize Timers diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index a2ad1d6e5996e5..8bbddd6b47774f 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -203,6 +203,11 @@ CHIP_ERROR AppTask::Init() GetDFUOverSMP().ConfirmNewImage(); #endif +#ifdef CONFIG_CHIP_OTA_REQUESTOR + /* OTA image confirmation must be done before the factory data init. */ + OtaConfirmNewImage(); +#endif + // Initialize lighting device (PWM) uint8_t minLightLevel = kDefaultMinLevel; Clusters::LevelControl::Attributes::MinLevel::Get(kLightEndpointId, &minLightLevel); @@ -217,15 +222,6 @@ CHIP_ERROR AppTask::Init() } mPWMDevice.SetCallbacks(ActionInitiated, ActionCompleted); -#ifdef CONFIG_CHIP_OTA_REQUESTOR - /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } -#endif - // Initialize CHIP server #if CONFIG_CHIP_FACTORY_DATA ReturnErrorOnFailure(mFactoryDataProvider.Init()); diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index ab5df56d36d9d4..17fa9e31412123 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -189,11 +189,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/platform/nrfconnect/util/OTAUtil.cpp b/examples/platform/nrfconnect/util/OTAUtil.cpp index f1c1c916aa0aa7..c642a9001f56ef 100644 --- a/examples/platform/nrfconnect/util/OTAUtil.cpp +++ b/examples/platform/nrfconnect/util/OTAUtil.cpp @@ -66,20 +66,30 @@ void InitBasicOTARequestor() imageProcessor.TriggerFlashAction(ExternalFlashManager::Action::SLEEP); } -CHIP_ERROR OtaConfirmNewImage() +void OtaConfirmNewImage() { - CHIP_ERROR err = CHIP_NO_ERROR; +#ifndef CONFIG_SOC_SERIES_NRF53X + /* Check if the image is run in the REVERT mode and eventually + confirm it to prevent reverting on the next boot. + On nRF53 target there is not way to verify current swap type + because we use permanent swap so we can skip it. */ + VerifyOrReturn(mcuboot_swap_type() == BOOT_SWAP_TYPE_REVERT); +#endif + OTAImageProcessorImpl & imageProcessor = GetOTAImageProcessor(); - if (imageProcessor.IsFirstImageRun()) + if (!boot_is_img_confirmed()) { CHIP_ERROR err = System::MapErrorZephyr(boot_write_img_confirmed()); if (CHIP_NO_ERROR == err) { imageProcessor.SetImageConfirmed(); + ChipLogProgress(SoftwareUpdate, "New firmware image confirmed"); + } + else + { + ChipLogError(SoftwareUpdate, "Failed to confirm firmware image, it will be reverted on the next boot"); } } - ChipLogError(SoftwareUpdate, "Failed to confirm firmware image, it will be reverted on the next boot"); - return err; } #endif diff --git a/examples/platform/nrfconnect/util/include/OTAUtil.h b/examples/platform/nrfconnect/util/include/OTAUtil.h index 2e120f6b7db096..9c4c6d8d410bc5 100644 --- a/examples/platform/nrfconnect/util/include/OTAUtil.h +++ b/examples/platform/nrfconnect/util/include/OTAUtil.h @@ -54,7 +54,7 @@ void InitBasicOTARequestor(); * boot after the OTA update. * Other CHIP_ERROR codes if the image could not be confirmed. */ -CHIP_ERROR OtaConfirmNewImage(); +void OtaConfirmNewImage(); #endif // CONFIG_CHIP_OTA_REQUESTOR diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index d21908bfa165b4..b2406ed56cf29d 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -162,11 +162,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index f1b0fb19a3a19b..9b00a541cada3b 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -160,11 +160,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 5b80507a375c71..ed16dc1311dff8 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -167,11 +167,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server From cd41f0b89867f06d642c5621a7c37cb5235d854c Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:17:41 -0700 Subject: [PATCH 62/96] iOS tv-casting-app: refactored Initialization (#29002) --- .../project.pbxproj | 58 +++++ .../MatterTvCastingBridge/MTRCastingApp.h | 53 +++++ .../MatterTvCastingBridge/MTRCastingApp.mm | 115 +++++++++ .../MTRCommissionableData.h | 43 ++++ .../MTRCommissionableData.mm | 39 +++ .../MTRCommissionableDataProvider.h | 71 ++++++ .../MTRCommissionableDataProvider.mm | 225 ++++++++++++++++++ ...CommonCaseDeviceServerInitParamsProvider.h | 42 ++++ .../MatterTvCastingBridge/MTRDataSource.h | 36 +++ .../MTRDeviceAttestationCredentials.h | 42 ++++ .../MTRDeviceAttestationCredentials.mm | 37 +++ .../MTRDeviceAttestationCredentialsProvider.h | 55 +++++ ...MTRDeviceAttestationCredentialsProvider.mm | 132 ++++++++++ .../MTRRotatingDeviceIdUniqueIdProvider.h | 46 ++++ .../MTRRotatingDeviceIdUniqueIdProvider.mm | 54 +++++ .../MatterTvCastingBridge/MatterError.h | 4 + .../MatterTvCastingBridge/MatterError.mm | 43 ++++ .../MatterTvCastingBridge.h | 6 + .../TvCasting.xcodeproj/project.pbxproj | 6 +- .../xcschemes/TvCasting Release.xcscheme | 7 + .../xcshareddata/xcschemes/TvCasting.xcscheme | 7 + .../TvCasting/TvCasting/ContentView.swift | 5 +- .../TvCasting/MTRInitializationExample.swift | 92 +++++++ .../TvCasting/TvCasting/TvCastingApp.swift | 92 +++++-- examples/tv-casting-app/darwin/args.gni | 6 +- .../tv-casting-app/tv-casting-common/BUILD.gn | 6 +- .../tv-casting-common/core/CastingApp.cpp | 12 +- 27 files changed, 1300 insertions(+), 34 deletions(-) create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm create mode 100644 examples/tv-casting-app/darwin/TvCasting/TvCasting/MTRInitializationExample.swift diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj index cbc52e427053d4..75b1e3a695f520 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj @@ -15,6 +15,9 @@ 3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */; }; 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */; }; 3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */; }; + 3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */; }; + 3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */; }; + 3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */; }; 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74B28F7A777001CB9D1 /* ContentApp.mm */; }; 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */; }; 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -27,9 +30,20 @@ 3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873D286A593700771BAD /* CastingServerBridge.mm */; }; 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873E286A593700771BAD /* ConversionUtils.mm */; }; 3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */; }; + 3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */; }; + 3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */; }; + 3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */; }; + 3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */; }; + 3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */; }; + 3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */; }; 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */; }; 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */; }; 3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */; }; + 3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */; }; + 3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */; }; + 3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */; }; + 3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */; }; + 3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */; }; 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF8532628E37F1000F07B9F /* MatterError.mm */; }; /* End PBXBuildFile section */ @@ -48,6 +62,9 @@ 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentLauncherTypes.mm; sourceTree = ""; }; 3C66FBFA2903279A00B63FE7 /* AppParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppParameters.h; sourceTree = ""; }; 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppParameters.mm; sourceTree = ""; }; + 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentialsProvider.h; sourceTree = ""; }; + 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentialsProvider.mm; sourceTree = ""; }; + 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommonCaseDeviceServerInitParamsProvider.h; sourceTree = ""; }; 3C81C74B28F7A777001CB9D1 /* ContentApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentApp.mm; sourceTree = ""; }; 3C81C74E28F7A7AE001CB9D1 /* ContentApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentApp.h; sourceTree = ""; }; 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoPlayer.m; sourceTree = ""; }; @@ -64,9 +81,20 @@ 3CCB873D286A593700771BAD /* CastingServerBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CastingServerBridge.mm; sourceTree = ""; }; 3CCB873E286A593700771BAD /* ConversionUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConversionUtils.mm; sourceTree = ""; }; 3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissionerDiscoveryDelegateImpl.h; sourceTree = ""; }; + 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRRotatingDeviceIdUniqueIdProvider.h; sourceTree = ""; }; + 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRRotatingDeviceIdUniqueIdProvider.mm; sourceTree = ""; }; + 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableDataProvider.h; sourceTree = ""; }; + 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableDataProvider.mm; sourceTree = ""; }; + 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentials.h; sourceTree = ""; }; + 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentials.mm; sourceTree = ""; }; 3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissioningCallbackHandlers.h; sourceTree = ""; }; 3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommissioningCallbackHandlers.m; sourceTree = ""; }; 3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CommissionableDataProviderImpl.mm; sourceTree = ""; }; + 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCastingApp.h; sourceTree = ""; }; + 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCastingApp.mm; sourceTree = ""; }; + 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDataSource.h; sourceTree = ""; }; + 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableData.h; sourceTree = ""; }; + 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableData.mm; sourceTree = ""; }; 3CF8532528E37ED800F07B9F /* MatterError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterError.h; sourceTree = ""; }; 3CF8532628E37F1000F07B9F /* MatterError.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MatterError.mm; sourceTree = ""; }; /* End PBXFileReference section */ @@ -106,6 +134,20 @@ isa = PBXGroup; children = ( 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */, + 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */, + 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */, + 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */, + 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */, + 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */, + 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */, + 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */, + 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */, + 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */, + 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */, + 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */, + 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */, + 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */, + 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */, 3CCB873A286A593700771BAD /* CastingServerBridge.h */, 3CCB873D286A593700771BAD /* CastingServerBridge.mm */, 3C66FBFA2903279A00B63FE7 /* AppParameters.h */, @@ -148,13 +190,21 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */, 3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */, + 3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */, 3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */, + 3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */, + 3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */, + 3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */, + 3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */, + 3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */, 3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */, 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */, 3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */, 3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */, 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */, + 3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -256,18 +306,24 @@ files = ( 3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */, 3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */, + 3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */, 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */, + 3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */, 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */, 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */, 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */, 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */, + 3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */, 3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */, + 3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */, + 3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */, 3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */, 3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */, 3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */, 3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */, 3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */, 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */, + 3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */, 3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -418,6 +474,7 @@ GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include", + "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common", "$(CHIP_ROOT)/src", "$(CHIP_ROOT)/src/include", "$(CHIP_ROOT)/src/lib", @@ -498,6 +555,7 @@ GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include", + "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common", "$(CHIP_ROOT)/src", "$(CHIP_ROOT)/src/include", "$(CHIP_ROOT)/src/lib", diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h new file mode 100644 index 00000000000000..37a07e36452767 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h @@ -0,0 +1,53 @@ +/** + * + * Copyright (c) 2023 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 "MTRDataSource.h" +#import "MatterError.h" + +#ifndef MTRCastingApp_h +#define MTRCastingApp_h + +/** + * @brief MTRCastingApp represents an app that can cast content to a Casting Player. + */ +@interface MTRCastingApp : NSObject + +/** + * Returns a shared instance of the MTRCastingApp + */ ++ (MTRCastingApp * _Nullable)getSharedInstance; + +/** + * @brief Initializes the MTRCastingApp with appParameters + * + * @param dataSource provides all the parameters required to initialize the MTRCastingApp + */ +- (MatterError * _Nonnull)initializeWithDataSource:(id _Nonnull)dataSource; + +/** + * @brief Starts the Matter server that the MTRCastingApp runs on and registers all the necessary delegates + */ +- (MatterError * _Nonnull)start; + +/** + * @brief Stops the Matter server that the MTRCastingApp runs on + */ +- (MatterError * _Nonnull)stop; + +@end + +#endif /* MTRCastingApp_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm new file mode 100644 index 00000000000000..1ee0bc98bb2805 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm @@ -0,0 +1,115 @@ +/** + * + * Copyright (c) 2023 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 "MTRCastingApp.h" + +#import "MTRCommissionableDataProvider.h" +#import "MTRCommonCaseDeviceServerInitParamsProvider.h" +#import "MTRDeviceAttestationCredentialsProvider.h" +#import "MTRRotatingDeviceIdUniqueIdProvider.h" + +#import "core/Types.h" +#include +#include + +#import + +@interface MTRCastingApp () + +@property matter::casting::support::AppParameters appParameters; +@property matter::casting::support::MTRRotatingDeviceIdUniqueIdProvider uniqueIdProvider; +@property matter::casting::support::MTRCommissionableDataProvider * commissionableDataProvider; +@property matter::casting::support::MTRDeviceAttestationCredentialsProvider * dacProvider; +@property MTRCommonCaseDeviceServerInitParamsProvider * serverInitParamsProvider; + +// queue used to serialize all work performed by the CastingServerBridge +@property (atomic) dispatch_queue_t chipWorkQueue; + +@end + +@implementation MTRCastingApp + ++ (MTRCastingApp * _Nullable)getSharedInstance +{ + static MTRCastingApp * instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = [[self alloc] init]; + }); + return instance; +} + +- (MatterError * _Nonnull)initializeWithDataSource:(id _Nonnull)dataSource +{ + ChipLogProgress(AppServer, "MTRCastingApp.initializeWithDataSource called"); + + // Initialize cpp Providers + VerifyOrReturnValue(_uniqueIdProvider.Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _commissionableDataProvider = new matter::casting::support::MTRCommissionableDataProvider(); + VerifyOrReturnValue(_commissionableDataProvider->Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _dacProvider = new matter::casting::support::MTRDeviceAttestationCredentialsProvider(); + VerifyOrReturnValue(_dacProvider->Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _serverInitParamsProvider = new MTRCommonCaseDeviceServerInitParamsProvider(); + + // Create cpp AppParameters + VerifyOrReturnValue(_appParameters.Create(&_uniqueIdProvider, _commissionableDataProvider, _dacProvider, + GetDefaultDACVerifier(chip::Credentials::GetTestAttestationTrustStore()), _serverInitParamsProvider) + == CHIP_NO_ERROR, + MATTER_ERROR_INVALID_ARGUMENT); + + // Initialize cpp CastingApp + VerifyOrReturnValue(matter::casting::core::CastingApp::GetInstance()->Initialize(_appParameters) == CHIP_NO_ERROR, + MATTER_ERROR_INCORRECT_STATE); + + // Get and store the CHIP Work queue + _chipWorkQueue = chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(); + + return MATTER_NO_ERROR; +} + +- (MatterError * _Nonnull)start +{ + ChipLogProgress(AppServer, "MTRCastingApp.start called"); + VerifyOrReturnValue(_chipWorkQueue != nil, MATTER_ERROR_INCORRECT_STATE); + + __block CHIP_ERROR err = CHIP_NO_ERROR; + + dispatch_sync(_chipWorkQueue, ^{ + err = matter::casting::core::CastingApp::GetInstance()->Start(); + }); + + return err == CHIP_NO_ERROR ? MATTER_NO_ERROR : MATTER_ERROR_INCORRECT_STATE; +} + +- (MatterError * _Nonnull)stop +{ + ChipLogProgress(AppServer, "MTRCastingApp.stop called"); + VerifyOrReturnValue(_chipWorkQueue != nil, MATTER_ERROR_INCORRECT_STATE); + + __block CHIP_ERROR err = CHIP_NO_ERROR; + + dispatch_sync(_chipWorkQueue, ^{ + err = matter::casting::core::CastingApp::GetInstance()->Stop(); + }); + + return err == CHIP_NO_ERROR ? MATTER_NO_ERROR : MATTER_ERROR_INCORRECT_STATE; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h new file mode 100644 index 00000000000000..59eb8acdb9eb53 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h @@ -0,0 +1,43 @@ +/** + * + * Copyright (c) 2023 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 + +#ifndef MTRCommissionableData_h +#define MTRCommissionableData_h + +@interface MTRCommissionableData : NSObject + +@property (nonatomic, readonly) uint32_t passcode; + +@property (nonatomic, readonly) uint16_t discriminator; + +@property (nonatomic, readonly) uint32_t spake2pIterationCount; + +@property (nonatomic, strong, readonly) NSData * _Nullable spake2pVerifier; + +@property (nonatomic, strong, readonly) NSData * _Nullable spake2pSalt; + +- (instancetype _Nonnull)initWithPasscode:(uint32_t)passcode + discriminator:(uint16_t)discriminator + spake2pIterationCount:(uint32_t)spake2pIterationCount + spake2pVerifier:(NSData * _Nullable)spake2pVerifier + spake2pSalt:(NSData * _Nullable)spake2pSalt; + +@end + +#endif /* MTRCommissionableData_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm new file mode 100644 index 00000000000000..85858b36dffbd1 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2023 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 "MTRCommissionableData.h" +#import + +@implementation MTRCommissionableData + +- (instancetype)initWithPasscode:(uint32_t)passcode + discriminator:(uint16_t)discriminator + spake2pIterationCount:(uint32_t)spake2pIterationCount + spake2pVerifier:(NSData * _Nullable)spake2pVerifier + spake2pSalt:(NSData * _Nullable)spake2pSalt +{ + if (self = [super init]) { + _passcode = passcode; + _discriminator = discriminator; + _spake2pIterationCount = spake2pIterationCount; + _spake2pVerifier = spake2pVerifier; + _spake2pVerifier = spake2pVerifier; + } + return self; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h new file mode 100644 index 00000000000000..8112207a003028 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2023 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 + +#import "MTRDataSource.h" + +#include +#include +#include +#include +#include + +#ifndef MTRCommissionableDataProvider_h +#define MTRCommissionableDataProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRCommissionableDataProvider : public chip::DeviceLayer::CommissionableDataProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) override; + CHIP_ERROR SetSetupDiscriminator(uint16_t setupDiscriminator) override + { + // We don't support overriding the discriminator post-init (it is deprecated!) + return CHIP_ERROR_NOT_IMPLEMENTED; + } + CHIP_ERROR GetSpake2pIterationCount(uint32_t & iterationCount) override; + CHIP_ERROR GetSpake2pSalt(chip::MutableByteSpan & saltBuf) override; + CHIP_ERROR GetSpake2pVerifier(chip::MutableByteSpan & verifierBuf, size_t & outVerifierLen) override; + CHIP_ERROR GetSetupPasscode(uint32_t & setupPasscode) override; + CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override + { + // We don't support overriding the passcode post-init (it is deprecated!) + return CHIP_ERROR_NOT_IMPLEMENTED; + } + +private: + id mDataSource = nullptr; + + bool mFirstUpdated = false; + std::vector mSerializedPaseVerifier; + std::vector mPaseSalt; + uint32_t mPaseIterationCount = 0; + chip::Optional mSetupPasscode; + uint16_t mDiscriminator = 0; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRCommissionableDataProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm new file mode 100644 index 00000000000000..6a6047984c1a8a --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm @@ -0,0 +1,225 @@ +/* + * + * Copyright (c) 2023 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. + */ + +#import "MTRCommissionableDataProvider.h" + +#import "MTRCommissionableData.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::Crypto; + +namespace matter { +namespace casting { + namespace support { + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT +#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT 1000 +#endif + + CHIP_ERROR GeneratePaseSalt(std::vector & spake2pSaltVector) + { + constexpr size_t kSaltLen = kSpake2p_Max_PBKDF_Salt_Length; + spake2pSaltVector.resize(kSaltLen); + return DRBG_get_bytes(spake2pSaltVector.data(), spake2pSaltVector.size()); + } + + CHIP_ERROR MTRCommissionableDataProvider::Initialize(id dataSource) + { + VerifyOrReturnLogError(dataSource != nil, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnLogError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + + mDataSource = dataSource; + MTRCommissionableData * commissionableData = + [mDataSource castingAppDidReceiveRequestForCommissionableData:@"MTRCommissionableDataProvider.Initialize()"]; + + VerifyOrReturnLogError(commissionableData.discriminator <= chip::kMaxDiscriminatorValue, CHIP_ERROR_INVALID_ARGUMENT); + + uint32_t spake2pIterationCount = commissionableData.spake2pIterationCount; + if (spake2pIterationCount == 0) { + spake2pIterationCount = CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT; + } + VerifyOrReturnLogError( + static_cast(spake2pIterationCount) >= kSpake2p_Min_PBKDF_Iterations, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnLogError( + static_cast(spake2pIterationCount) <= kSpake2p_Max_PBKDF_Iterations, CHIP_ERROR_INVALID_ARGUMENT); + + const bool havePaseVerifier = (commissionableData.spake2pVerifier != nullptr); + const bool havePaseSalt = (commissionableData.spake2pSalt != nullptr); + VerifyOrReturnLogError(!havePaseVerifier || (havePaseVerifier && havePaseSalt), CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR err; + // read verifier from paramter if provided + Spake2pVerifier providedVerifier; + std::vector serializedSpake2pVerifier(kSpake2p_VerifierSerialized_Length); + if (havePaseVerifier) { + size_t maxBase64Size = BASE64_ENCODED_LEN(chip::Crypto::kSpake2p_VerifierSerialized_Length); + VerifyOrReturnLogError( + static_cast(commissionableData.spake2pVerifier.length) <= maxBase64Size, CHIP_ERROR_INVALID_ARGUMENT); + + size_t decodedLen = chip::Base64Decode32(reinterpret_cast(commissionableData.spake2pVerifier.bytes), + static_cast(commissionableData.spake2pVerifier.length), + reinterpret_cast(serializedSpake2pVerifier.data())); + VerifyOrReturnLogError(decodedLen == chip::Crypto::kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INVALID_ARGUMENT); + + chip::MutableByteSpan verifierSpan { serializedSpake2pVerifier.data(), decodedLen }; + err = providedVerifier.Deserialize(verifierSpan); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + + ChipLogProgress(Support, "Got externally provided verifier, using it."); + } + + // read salt from paramter if provided or generate one + std::vector spake2pSalt(chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length); + if (!havePaseSalt) { + ChipLogProgress(Support, "MTRCommissionableDataProvider didn't get a PASE salt, generating one."); + err = GeneratePaseSalt(spake2pSalt); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + } else { + size_t maxBase64Size = BASE64_ENCODED_LEN(chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length); + VerifyOrReturnLogError( + static_cast(commissionableData.spake2pSalt.length) <= maxBase64Size, CHIP_ERROR_INVALID_ARGUMENT); + + size_t decodedLen = chip::Base64Decode32(reinterpret_cast(commissionableData.spake2pSalt.bytes), + static_cast(commissionableData.spake2pSalt.length), reinterpret_cast(spake2pSalt.data())); + VerifyOrReturnLogError(decodedLen >= chip::Crypto::kSpake2p_Min_PBKDF_Salt_Length + && decodedLen <= chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length, + CHIP_ERROR_INVALID_ARGUMENT); + spake2pSalt.resize(decodedLen); + } + + // generate verifier from passcode if provided + const bool havePasscode + = (commissionableData.passcode > kMinSetupPasscode && commissionableData.passcode < kMaxSetupPasscode); + Spake2pVerifier passcodeVerifier; + std::vector serializedPasscodeVerifier(kSpake2p_VerifierSerialized_Length); + chip::MutableByteSpan saltSpan { spake2pSalt.data(), spake2pSalt.size() }; + if (havePasscode) { + uint32_t u32SetupPasscode = static_cast(commissionableData.passcode); + err = passcodeVerifier.Generate(spake2pIterationCount, saltSpan, u32SetupPasscode); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + + chip::MutableByteSpan verifierSpan { serializedPasscodeVerifier.data(), serializedPasscodeVerifier.size() }; + err = passcodeVerifier.Serialize(verifierSpan); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + } + + // Make sure we actually have a verifier + VerifyOrReturnLogError(havePasscode || havePaseVerifier, CHIP_ERROR_INVALID_ARGUMENT); + + // If both passcode and external verifier were provided, validate they match, otherwise + // it's ambiguous. + if (havePasscode && havePaseVerifier) { + VerifyOrReturnLogError(serializedPasscodeVerifier == serializedSpake2pVerifier, CHIP_ERROR_INVALID_ARGUMENT); + ChipLogProgress( + Support, "Validated externally provided passcode matches the one generated from provided passcode."); + } + + // External PASE verifier takes precedence when present (even though it is identical to passcode-based + // one when the latter is present). + if (havePaseVerifier) { + mSerializedPaseVerifier = std::move(serializedSpake2pVerifier); + } else { + mSerializedPaseVerifier = std::move(serializedPasscodeVerifier); + } + mDiscriminator = commissionableData.discriminator; + mPaseSalt = std::move(spake2pSalt); + mPaseIterationCount = spake2pIterationCount; + if (havePasscode) { + mSetupPasscode.SetValue(commissionableData.passcode); + } + + // Set to global CommissionableDataProvider once success first time + if (!mFirstUpdated) { + DeviceLayer::SetCommissionableDataProvider(this); + } + mFirstUpdated = true; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSetupDiscriminator(uint16_t & setupDiscriminator) + { + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + setupDiscriminator = mDiscriminator; + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pIterationCount(uint32_t & iterationCount) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pIterationCount called"); + VerifyOrReturnLogError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + iterationCount = mPaseIterationCount; + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pSalt(chip::MutableByteSpan & saltBuf) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pSalt called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + VerifyOrReturnError(saltBuf.size() >= kSpake2p_Max_PBKDF_Salt_Length, CHIP_ERROR_BUFFER_TOO_SMALL); + memcpy(saltBuf.data(), mPaseSalt.data(), mPaseSalt.size()); + saltBuf.reduce_size(mPaseSalt.size()); + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pVerifier(chip::MutableByteSpan & verifierBuf, size_t & outVerifierLen) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pVerifier called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + // By now, serialized verifier from Init should be correct size + VerifyOrReturnError(mSerializedPaseVerifier.size() == kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INTERNAL); + + outVerifierLen = mSerializedPaseVerifier.size(); + VerifyOrReturnError(verifierBuf.size() >= outVerifierLen, CHIP_ERROR_BUFFER_TOO_SMALL); + memcpy(verifierBuf.data(), mSerializedPaseVerifier.data(), mSerializedPaseVerifier.size()); + verifierBuf.reduce_size(mSerializedPaseVerifier.size()); + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSetupPasscode(uint32_t & setupPasscode) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSetupPasscode called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + // Pretend not implemented if we don't have a passcode value externally set + if (!mSetupPasscode.HasValue()) { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + + setupPasscode = mSetupPasscode.Value(); + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSetupPasscode returning value %d", setupPasscode); + return CHIP_NO_ERROR; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h new file mode 100644 index 00000000000000..a22113074e31f1 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h @@ -0,0 +1,42 @@ +/** + * + * Copyright (c) 2023 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 "core/Types.h" + +#ifndef MTRCommonCaseDeviceServerInitParamsProvider_h +#define MTRCommonCaseDeviceServerInitParamsProvider_h + +/** + * @brief Provides the ServerInitParams required to start the CastingApp, which in turn starts the Matter server + */ +class MTRCommonCaseDeviceServerInitParamsProvider : public matter::casting::support::ServerInitParamsProvider +{ +private: + // For this example, we'll use CommonCaseDeviceServerInitParams + chip::CommonCaseDeviceServerInitParams serverInitParams; + +public: + chip::ServerInitParams * Get() + { + CHIP_ERROR err = serverInitParams.InitializeStaticResourcesBeforeServerInit(); + VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr, + ChipLogError(AppServer, "Initialization of ServerInitParams failed %" CHIP_ERROR_FORMAT, err.Format())); + return &serverInitParams; + } +}; + +#endif /* MTRCommonCaseDeviceServerInitParamsProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h new file mode 100644 index 00000000000000..a350673b70f6c4 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2023 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 "MTRCommissionableData.h" +#import "MTRDeviceAttestationCredentials.h" + +#ifndef MTRDataSource_h +#define MTRDataSource_h + +@protocol MTRDataSource + +- (dispatch_queue_t _Nonnull)clientQueue; + +- (NSData * _Nonnull)castingAppDidReceiveRequestForRotatingDeviceIdUniqueId:(id _Nonnull)sender; +- (MTRCommissionableData * _Nonnull)castingAppDidReceiveRequestForCommissionableData:(id _Nonnull)sender; +- (MTRDeviceAttestationCredentials * _Nonnull)castingAppDidReceiveRequestForDeviceAttestationCredentials:(id _Nonnull)sender; + +- (NSData * _Nonnull)castingApp:(id _Nonnull)sender didReceiveRequestToSignCertificateRequest:(NSData * _Nonnull)csrData; + +@end + +#endif /* MTRDataSource_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h new file mode 100644 index 00000000000000..aed7eceedbacdd --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h @@ -0,0 +1,42 @@ +/** + * + * Copyright (c) 2023 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 +#import + +#ifndef MTRDeviceAttestationCredentials_h +#define MTRDeviceAttestationCredentials_h + +@interface MTRDeviceAttestationCredentials : NSObject + +@property (nonatomic, strong, readonly) NSData * _Nonnull certificationDeclaration; + +@property (nonatomic, strong, readonly) NSData * _Nonnull firmwareInformation; + +@property (nonatomic, strong, readonly) NSData * _Nonnull deviceAttestationCert; + +@property (nonatomic, strong, readonly) NSData * _Nonnull productAttestationIntermediateCert; + +- (MTRDeviceAttestationCredentials * _Nonnull)initWithCertificationDeclaration:(NSData * _Nonnull)certificationDeclaration + firmwareInformation:(NSData * _Nonnull)firmwareInformation + deviceAttestationCert:(NSData * _Nonnull)deviceAttestationCert + productAttestationIntermediateCert: + (NSData * _Nonnull)productAttestationIntermediateCert; + +@end + +#endif /* MTRDeviceAttestationCredentials_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm new file mode 100644 index 00000000000000..1daa18a681c93c --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm @@ -0,0 +1,37 @@ +/** + * + * Copyright (c) 2023 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 "MTRDeviceAttestationCredentials.h" +#import + +@implementation MTRDeviceAttestationCredentials + +- (instancetype)initWithCertificationDeclaration:(NSData * _Nonnull)certificationDeclaration + firmwareInformation:(NSData * _Nonnull)firmwareInformation + deviceAttestationCert:(NSData * _Nonnull)deviceAttestationCert + productAttestationIntermediateCert:(NSData * _Nonnull)productAttestationIntermediateCert; +{ + if (self = [super init]) { + _certificationDeclaration = certificationDeclaration; + _firmwareInformation = firmwareInformation; + _deviceAttestationCert = deviceAttestationCert; + _productAttestationIntermediateCert = productAttestationIntermediateCert; + } + return self; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h new file mode 100644 index 00000000000000..e955ac9ee7eb33 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h @@ -0,0 +1,55 @@ +/** + * + * Copyright (c) 2023 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 "MTRDataSource.h" + +#include +#include +#include + +#import +#include + +#ifndef MTRDeviceAttestationCredentialsProvider_h +#define MTRDeviceAttestationCredentialsProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRDeviceAttestationCredentialsProvider : public chip::Credentials::DeviceAttestationCredentialsProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + + CHIP_ERROR GetCertificationDeclaration(chip::MutableByteSpan & outCertificationDeclaration) override; + CHIP_ERROR GetFirmwareInformation(chip::MutableByteSpan & outFirmwareInformation) override; + CHIP_ERROR GetDeviceAttestationCert(chip::MutableByteSpan & outDeviceAttestationCert) override; + CHIP_ERROR GetProductAttestationIntermediateCert(chip::MutableByteSpan & outProductAttestationIntermediateCert) override; + CHIP_ERROR SignWithDeviceAttestationKey(const chip::ByteSpan & messageToSign, + chip::MutableByteSpan & outSignatureBuffer) override; + +private: + id mDataSource = nullptr; + MTRDeviceAttestationCredentials * mDac = nullptr; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRDeviceAttestationCredentialsProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm new file mode 100644 index 00000000000000..8a2bcb0439c217 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm @@ -0,0 +1,132 @@ +/* + * + * Copyright (c) 2023 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 "MTRDeviceAttestationCredentialsProvider.h" + +#import "MTRDeviceAttestationCredentials.h" + +#include "lib/support/logging/CHIPLogging.h" +#include +#include + +#import + +namespace matter { +namespace casting { + namespace support { + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::Initialize(id dataSource) + { + VerifyOrReturnError(dataSource != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + + mDac = [mDataSource + castingAppDidReceiveRequestForDeviceAttestationCredentials:@"MTRDeviceAttestationCredentialsProvider.Initialize()"]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetCertificationDeclaration( + chip::MutableByteSpan & outCertificationDeclaration) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.certificationDeclaration != nullptr && mDac.certificationDeclaration.length > 0) { + if (outCertificationDeclaration.size() >= mDac.certificationDeclaration.length) { + memcpy(outCertificationDeclaration.data(), mDac.certificationDeclaration.bytes, + mDac.certificationDeclaration.length); + outCertificationDeclaration.reduce_size(mDac.certificationDeclaration.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetFirmwareInformation(chip::MutableByteSpan & outFirmwareInformation) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.firmwareInformation != nullptr && mDac.firmwareInformation.length > 0) { + if (outFirmwareInformation.size() >= mDac.firmwareInformation.length) { + memcpy(outFirmwareInformation.data(), mDac.firmwareInformation.bytes, mDac.firmwareInformation.length); + outFirmwareInformation.reduce_size(mDac.firmwareInformation.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetDeviceAttestationCert( + chip::MutableByteSpan & outDeviceAttestationCert) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.deviceAttestationCert != nullptr && mDac.deviceAttestationCert.length > 0) { + if (outDeviceAttestationCert.size() >= mDac.deviceAttestationCert.length) { + memcpy(outDeviceAttestationCert.data(), mDac.deviceAttestationCert.bytes, mDac.deviceAttestationCert.length); + outDeviceAttestationCert.reduce_size(mDac.deviceAttestationCert.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetProductAttestationIntermediateCert( + chip::MutableByteSpan & outProductAttestationIntermediateCert) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.productAttestationIntermediateCert != nullptr && mDac.productAttestationIntermediateCert.length > 0) { + if (outProductAttestationIntermediateCert.size() >= mDac.productAttestationIntermediateCert.length) { + memcpy(outProductAttestationIntermediateCert.data(), mDac.productAttestationIntermediateCert.bytes, + mDac.productAttestationIntermediateCert.length); + outProductAttestationIntermediateCert.reduce_size(mDac.productAttestationIntermediateCert.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::SignWithDeviceAttestationKey( + const chip::ByteSpan & messageToSign, chip::MutableByteSpan & outSignatureBuffer) + { + VerifyOrReturnError(mDataSource != nullptr, CHIP_ERROR_INCORRECT_STATE); + + __block NSData * signedData = nil; + NSData * csrData = [NSData dataWithBytes:messageToSign.data() length:messageToSign.size()]; + dispatch_sync(mDataSource.clientQueue, ^{ + signedData = [mDataSource castingApp:@"MTRDeviceAttestationCredentialsProvider.SignWithDeviceAttestationKey()" + didReceiveRequestToSignCertificateRequest:csrData]; + }); + + if (signedData != nil && outSignatureBuffer.size() >= signedData.length) { + memcpy(outSignatureBuffer.data(), signedData.bytes, signedData.length); + outSignatureBuffer.reduce_size(signedData.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + return CHIP_NO_ERROR; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h new file mode 100644 index 00000000000000..5f0b32a21b58e2 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2023 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 "MTRDataSource.h" + +#include "core/Types.h" + +#ifndef MTRRotatingDeviceIdUniqueIdProvider_h +#define MTRRotatingDeviceIdUniqueIdProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRRotatingDeviceIdUniqueIdProvider : public matter::casting::support::MutableByteSpanDataProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + chip::MutableByteSpan * Get(); + +private: + id mDataSource = nullptr; + + chip::MutableByteSpan mRotatingDeviceIdUniqueIdSpan; + uint8_t mRotatingDeviceIdUniqueId[chip::DeviceLayer::ConfigurationManager::kRotatingDeviceIDUniqueIDLength]; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRRotatingDeviceIdUniqueIdProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm new file mode 100644 index 00000000000000..7db4ce55c91e7b --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2023 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 "MTRRotatingDeviceIdUniqueIdProvider.h" + +#include "lib/support/logging/CHIPLogging.h" +#include +#include + +#import + +namespace matter { +namespace casting { + namespace support { + + CHIP_ERROR MTRRotatingDeviceIdUniqueIdProvider::Initialize(id dataSource) + { + VerifyOrReturnError(dataSource != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + mDataSource = dataSource; + return CHIP_NO_ERROR; + } + + chip::MutableByteSpan * MTRRotatingDeviceIdUniqueIdProvider::Get() + { + ChipLogProgress(AppServer, "MTRRotatingDeviceIdUniqueIdProvider.Get() called"); + VerifyOrReturnValue(mDataSource != nil, nullptr, ChipLogError(AppServer, "mDataSource found nil!")); + + NSData * uniqueIdData = + [mDataSource castingAppDidReceiveRequestForRotatingDeviceIdUniqueId:@"MTRRotatingDeviceIdUniqueIdProvider.Get()"]; + if (uniqueIdData != nil) { + mRotatingDeviceIdUniqueIdSpan = chip::MutableByteSpan( + const_cast(reinterpret_cast(uniqueIdData.bytes)), uniqueIdData.length); + } + return &mRotatingDeviceIdUniqueIdSpan; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h index ec018725294162..95aa22ebdd3577 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h @@ -26,6 +26,10 @@ @property NSString * _Nullable message; +extern MatterError * _Nonnull MATTER_NO_ERROR; +extern MatterError * _Nonnull MATTER_ERROR_INCORRECT_STATE; +extern MatterError * _Nonnull MATTER_ERROR_INVALID_ARGUMENT; + - (MatterError * _Nonnull)initWithCode:(uint32_t)code message:(NSString * _Nullable)message; @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm index ce700e5a80338a..cbee1a455a51ca 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm @@ -19,8 +19,19 @@ #import "MatterError.h" +#include + @implementation MatterError +MatterError * MATTER_NO_ERROR = [[MatterError alloc] initWithCode:0 message:nil]; + +MatterError * MATTER_ERROR_INCORRECT_STATE = + [[MatterError alloc] initWithCode:CHIP_ERROR_INCORRECT_STATE.AsInteger() + message:[NSString stringWithUTF8String:CHIP_ERROR_INCORRECT_STATE.AsString()]]; +MatterError * MATTER_ERROR_INVALID_ARGUMENT = + [[MatterError alloc] initWithCode:CHIP_ERROR_INVALID_ARGUMENT.AsInteger() + message:[NSString stringWithUTF8String:CHIP_ERROR_INVALID_ARGUMENT.AsString()]]; + - (MatterError *)initWithCode:(uint32_t)code message:(NSString * _Nullable)message { self = [super init]; @@ -36,4 +47,36 @@ - (NSString *)description return [NSString stringWithFormat:@"MatterError: code=%d message=%@", _code, _message]; } +- (BOOL)isEqualToMatterError:(MatterError *)other +{ + return self.code == other.code; +} + +- (BOOL)isEqual:(id)other +{ + if (other == nil) { + return NO; + } + + if (self == other) { + return YES; + } + + if (![other isKindOfClass:[MatterError class]]) { + return NO; + } + + return [self isEqualToMatterError:(MatterError *) other]; +} + +- (NSUInteger)hash +{ + const NSUInteger prime = 31; + NSUInteger result = 1; + + result = prime * result + self.code; + + return result; +} + @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h index 709740914e9ca8..9d12b964ce1c97 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h @@ -24,3 +24,9 @@ FOUNDATION_EXPORT double MatterTvCastingBridgeVersionNumber; FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "CastingServerBridge.h" + +// Add simplified casting API headers here +#import "MTRCastingApp.h" +#import "MTRCommissionableData.h" +#import "MTRDataSource.h" +#import "MTRDeviceAttestationCredentials.h" diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj index 68c5808353ab5a..567a0e205d1fc6 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 3C69204A2AA1368F00D0F613 /* MTRInitializationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */; }; 3C81C75328F8C79E001CB9D1 /* StartFromCacheView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75228F8C79E001CB9D1 /* StartFromCacheView.swift */; }; 3C81C75528F8C7B6001CB9D1 /* StartFromCacheViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75428F8C7B6001CB9D1 /* StartFromCacheViewModel.swift */; }; 3C81C75728F8E418001CB9D1 /* ConnectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75628F8E418001CB9D1 /* ConnectionView.swift */; }; @@ -46,6 +47,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MTRInitializationExample.swift; sourceTree = ""; }; 3C75075E284C1DF800D7DB3A /* TvCasting.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TvCasting.entitlements; sourceTree = ""; }; 3C7507AC285299DF00D7DB3A /* CommissionerDiscoveryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommissionerDiscoveryView.swift; sourceTree = ""; }; 3C7507AE28529A5F00D7DB3A /* CommissioningView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommissioningView.swift; sourceTree = ""; }; @@ -115,9 +117,10 @@ children = ( 3CC0E8FD2841DD3500EC6A18 /* Assets.xcassets */, 3C75075E284C1DF800D7DB3A /* TvCasting.entitlements */, + 3CC0E8F92841DD3400EC6A18 /* TvCastingApp.swift */, + 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */, EAF14298296D561900E17793 /* CertTestView.swift */, EAF1429A296D57DF00E17793 /* CertTestViewModel.swift */, - 3CC0E8F92841DD3400EC6A18 /* TvCastingApp.swift */, 3CC0E8FB2841DD3400EC6A18 /* ContentView.swift */, 3C81C75228F8C79E001CB9D1 /* StartFromCacheView.swift */, 3C81C75428F8C7B6001CB9D1 /* StartFromCacheViewModel.swift */, @@ -236,6 +239,7 @@ 3C81C75928F8E42D001CB9D1 /* ConnectionViewModel.swift in Sources */, 3CA1CA7A28E281080023ED44 /* ClusterSelectorView.swift in Sources */, EAF14299296D561900E17793 /* CertTestView.swift in Sources */, + 3C69204A2AA1368F00D0F613 /* MTRInitializationExample.swift in Sources */, 3CCB8747286A5D0F00771BAD /* CommissioningView.swift in Sources */, 3CCB8748286A5D0F00771BAD /* CommissioningViewModel.swift in Sources */, 3CAC955B29BA948700BEA5C3 /* ExampleDAC.swift in Sources */, diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme index bb32b8f700eee3..05333fbe6fe932 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme @@ -50,6 +50,13 @@ ReferencedContainer = "container:TvCasting.xcodeproj"> + + + + + + + + DispatchQueue { + return DispatchQueue.main; + } + + func castingAppDidReceiveRequestForRotatingDeviceIdUniqueId(_ sender: Any) -> Data { + // dummy value, with at least 16 bytes (ConfigurationManager::kMinRotatingDeviceIDUniqueIDLength), for demonstration only + return "0123456789ABCDEF".data(using: .utf8)! + } + + func castingAppDidReceiveRequestForCommissionableData(_ sender: Any) -> MTRCommissionableData { + // dummy values for demonstration only + return MTRCommissionableData( + passcode: 20202021, + discriminator: 3874, + spake2pIterationCount: 1000, + spake2pVerifier: nil, + spake2pSalt: nil) + } + + // dummy DAC values for demonstration only + let kDevelopmentDAC_Cert_FFF1_8001: Data = Data(base64Encoded: "MIIB5zCCAY6gAwIBAgIIac3xDenlTtEwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwIBcNMjIwMjA1MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMMHE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMDExFDASBgorBgEEAYKifAIBDARGRkYxMRQwEgYKKwYBBAGConwCAgwEODAwMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoKjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSI3eezADgpMs/3NMBGJIEPRBaKbzAfBgNVHSMEGDAWgBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiABJ6J7S0RhDuL83E0reIVWNmC8D3bxchntagjfsrPBzQIga1ngr0Xz6yqFuRnTVzFSjGAoxBUjlUXhCOTlTnCXE1M=")!; + + let kDevelopmentDAC_PrivateKey_FFF1_8001: Data = Data(base64Encoded: "qrYAroroqrfXNifCF7fCBHCcppRq9fL3UwgzpStE+/8=")!; + + let kDevelopmentDAC_PublicKey_FFF1_8001: Data = Data(base64Encoded: "BEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoI=")!; + + let KPAI_FFF1_8000_Cert_Array: Data = Data(base64Encoded: "MIIByzCCAXGgAwIBAgIIVq2CIq2UW2QwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjAyMDUwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmpMVwhc+DIyHbQPM/JRIUmR/f+xeUIL0BZko7KiUxZQVEwmsYx5MsDOSr2hLC6+35ls7gWLC9Sv5MbjneqqCo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUY1QOR/ZLHDjROISkYtFsGV2P+zwwHwYDVR0jBBgwFoAUav0idx9RH+y/FkGXZxDc3DGhcX4wCgYIKoZIzj0EAwIDSAAwRQIhALLvJ/Sa6bUPuR7qyUxNC9u415KcbLiPrOUpNo0SBUwMAiBlXckrhr2QmIKmxiF3uCXX0F7b58Ivn+pxIg5+pwP4kQ==")!; + + let kCertificationDeclaration: Data = Data(base64Encoded: "MIICGQYJKoZIhvcNAQcCoIICCjCCAgYCAQMxDTALBglghkgBZQMEAgEwggFxBgkqhkiG9w0BBwGgggFiBIIBXhUkAAElAfH/NgIFAIAFAYAFAoAFA4AFBIAFBYAFBoAFB4AFCIAFCYAFCoAFC4AFDIAFDYAFDoAFD4AFEIAFEYAFEoAFE4AFFIAFFYAFFoAFF4AFGIAFGYAFGoAFG4AFHIAFHYAFHoAFH4AFIIAFIYAFIoAFI4AFJIAFJYAFJoAFJ4AFKIAFKYAFKoAFK4AFLIAFLYAFLoAFL4AFMIAFMYAFMoAFM4AFNIAFNYAFNoAFN4AFOIAFOYAFOoAFO4AFPIAFPYAFPoAFP4AFQIAFQYAFQoAFQ4AFRIAFRYAFRoAFR4AFSIAFSYAFSoAFS4AFTIAFTYAFToAFT4AFUIAFUYAFUoAFU4AFVIAFVYAFVoAFV4AFWIAFWYAFWoAFW4AFXIAFXYAFXoAFX4AFYIAFYYAFYoAFY4AYJAMWLAQTWklHMjAxNDJaQjMzMDAwMy0yNCQFACQGACUHlCYkCAAYMX0wewIBA4AUYvqCM1ms+qmWPhz6FArd9QTzcWAwCwYJYIZIAWUDBAIBMAoGCCqGSM49BAMCBEcwRQIgJOXR9Hp9ew0gaibvaZt8l1e3LUaQid4xkuZ4x0Xn9gwCIQD4qi+nEfy3m5fjl87aZnuuRk4r0//fw8zteqjKX0wafA==")!; + func castingAppDidReceiveRequestForDeviceAttestationCredentials(_ sender: Any) -> MTRDeviceAttestationCredentials { + return MTRDeviceAttestationCredentials( + certificationDeclaration: kCertificationDeclaration, + firmwareInformation: Data(), + deviceAttestationCert: kDevelopmentDAC_Cert_FFF1_8001, + productAttestationIntermediateCert: KPAI_FFF1_8000_Cert_Array) + } + + func castingApp(_ sender: Any, didReceiveRequestToSignCertificateRequest csrData: Data) -> Data { + var privateKey = Data() + privateKey.append(kDevelopmentDAC_PublicKey_FFF1_8001); + privateKey.append(kDevelopmentDAC_PrivateKey_FFF1_8001); + + let privateKeyRef: SecKey = SecKeyCreateWithData(privateKey as NSData, + [ + kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeyClass: kSecAttrKeyClassPrivate, + kSecAttrKeySizeInBits: 256 + ] as NSDictionary, nil)! + + let _:Unmanaged = Unmanaged.passRetained(privateKeyRef); + + return Data() // TODO: use SecKey above to sign csrData and return resulting value + } +} + +class MTRInitializationExample { + let Log = Logger(subsystem: "com.matter.casting", + category: "MTRInitializationExample") + + func initialize() -> MatterError { + if let castingApp = MTRCastingApp.getSharedInstance() + { + return castingApp.initialize(with: MTRAppParametersDataSource()) + } + else + { + return MATTER_ERROR_INCORRECT_STATE + } + } +} diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift index f0d67cacee9cd5..2616ec0714f537 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift @@ -29,50 +29,90 @@ struct TvCastingApp: App { WindowGroup { ContentView() .onAppear(perform: { - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" { - let appParameters: AppParameters = AppParameters() + self.Log.info("CHIP_CASTING_SIMPLIFIED = 1") - var rotatingDeviceIdUniqueId: [UInt8] = [UInt8](repeating: 0, count: 16 ) - for i in (0...15) + let err: MatterError = MTRInitializationExample().initialize() + if !MATTER_NO_ERROR.isEqual(err) { - rotatingDeviceIdUniqueId[i] = UInt8.random(in: 0..<255) + self.Log.error("CastingApp initialization failed \(err)") + } + } + else + { + self.Log.info("CHIP_CASTING_SIMPLIFIED = 0") + + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + let appParameters: AppParameters = AppParameters() + + var rotatingDeviceIdUniqueId: [UInt8] = [UInt8](repeating: 0, count: 16 ) + for i in (0...15) + { + rotatingDeviceIdUniqueId[i] = UInt8.random(in: 0..<255) + } + appParameters.rotatingDeviceIdUniqueId = Data(rotatingDeviceIdUniqueId) + + let onboardingParameters: OnboardingPayload = OnboardingPayload() + onboardingParameters.setupPasscode = 20202021 + onboardingParameters.setupDiscriminator = 3840 + + appParameters.onboardingPayload = onboardingParameters + + let err = castingServerBridge.initializeApp(appParameters, clientQueue: DispatchQueue.main, initAppStatusHandler: { (result: Bool) -> () in + self.Log.info("initializeApp result \(result)") + }) + self.Log.info("initializeApp return value \(err)") } - appParameters.rotatingDeviceIdUniqueId = Data(rotatingDeviceIdUniqueId) - - let onboardingParameters: OnboardingPayload = OnboardingPayload() - onboardingParameters.setupPasscode = 20202021 - onboardingParameters.setupDiscriminator = 3840 - - appParameters.onboardingPayload = onboardingParameters - - let err = castingServerBridge.initializeApp(appParameters, clientQueue: DispatchQueue.main, initAppStatusHandler: { (result: Bool) -> () in - self.Log.info("initializeApp result \(result)") - }) - self.Log.info("initializeApp return value \(err)") } }) .onReceive(NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.willResignActiveNotification") - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" + { + if let castingApp = MTRCastingApp.getSharedInstance() + { + let err: MatterError = castingApp.stop() + if !MATTER_NO_ERROR.isEqual(err) + { + self.Log.error("CastingApp stop failed \(err)") + } + } + } + else if let castingServerBridge = CastingServerBridge.getSharedInstance() { castingServerBridge.stopMatterServer() } } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.didBecomeActiveNotification") - if(!firstAppActivation) + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" { - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if let castingApp = MTRCastingApp.getSharedInstance() { - castingServerBridge.startMatterServer(DispatchQueue.main, startMatterServerCompletionCallback: { (error: MatterError) -> () in - DispatchQueue.main.async { - self.Log.info("TvCastingApp.startMatterServerCompletionCallback called with \(error)") - } - }) + let err: MatterError = castingApp.start() + if !MATTER_NO_ERROR.isEqual(err) + { + self.Log.error("CastingApp start failed \(err)") + } + } + } + else + { + if(!firstAppActivation) + { + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + castingServerBridge.startMatterServer(DispatchQueue.main, startMatterServerCompletionCallback: { (error: MatterError) -> () in + DispatchQueue.main.async { + self.Log.info("TvCastingApp.startMatterServerCompletionCallback called with \(error)") + } + }) + } } + firstAppActivation = false } - firstAppActivation = false } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.didEnterBackgroundNotification") diff --git a/examples/tv-casting-app/darwin/args.gni b/examples/tv-casting-app/darwin/args.gni index 6a8033ab8ac9d0..1158e98e5f2d99 100644 --- a/examples/tv-casting-app/darwin/args.gni +++ b/examples/tv-casting-app/darwin/args.gni @@ -20,8 +20,10 @@ chip_device_project_config_include = "" chip_project_config_include = "" chip_system_project_config_include = "" -chip_project_config_include_dirs += - [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] +chip_project_config_include_dirs += [ + "${chip_root}/examples/tv-casting-app/tv-casting-common/include", + "${chip_root}/examples/tv-casting-app/tv-casting-common", +] chip_project_config_include_dirs += [ "${chip_root}/config/ios" ] chip_build_libshell = true diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 8292d8366b06da..115a0b7e4bbfb0 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -111,8 +111,10 @@ chip_data_model("tv-casting-common") { public_configs = [ ":config" ] - include_dirs = - [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] + include_dirs = [ + "${chip_root}/examples/tv-casting-app/tv-casting-common/include", + "${chip_root}/examples/tv-casting-app/tv-casting-common", + ] is_server = true } diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp index 3dd42d91d293bb..f8d66b03e0ac0c 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp @@ -60,9 +60,17 @@ CHIP_ERROR CastingApp::Initialize(const AppParameters & appParameters) #if CHIP_ENABLE_ROTATING_DEVICE_ID MutableByteSpanDataProvider * uniqueIdProvider = appParameters.GetRotatingDeviceIdUniqueIdProvider(); - if (uniqueIdProvider != nullptr && uniqueIdProvider->Get() != nullptr) + if (uniqueIdProvider != nullptr) { - ReturnErrorOnFailure(chip::DeviceLayer::ConfigurationMgr().SetRotatingDeviceIdUniqueId(*uniqueIdProvider->Get())); + chip::MutableByteSpan * uniqueId = uniqueIdProvider->Get(); + if (uniqueId != nullptr) + { + ReturnErrorOnFailure(chip::DeviceLayer::ConfigurationMgr().SetRotatingDeviceIdUniqueId(*uniqueId)); + } + else + { + return CHIP_ERROR_INVALID_ARGUMENT; + } } #endif // CHIP_ENABLE_ROTATING_DEVICE_ID From 741210db0a8cda73ae46aa0ad1f94723d64ca9fc Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 6 Sep 2023 12:44:36 -0400 Subject: [PATCH 63/96] Stop using dispatch_get_current_queue. (#29075) This function is deprecated. --- src/platform/Darwin/PlatformManagerImpl.cpp | 16 +++++++++++++++- src/platform/Darwin/PlatformManagerImpl.h | 12 +----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index bf2dde3d4fe360..69a95c44673b05 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -163,9 +163,23 @@ bool PlatformManagerImpl::_IsChipStackLockedByCurrentThread() const }; #endif +static int sPlatformManagerKey; // We use pointer to this as key. + +dispatch_queue_t PlatformManagerImpl::GetWorkQueue() +{ + if (mWorkQueue == nullptr) + { + mWorkQueue = dispatch_queue_create(CHIP_CONTROLLER_QUEUE, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + dispatch_suspend(mWorkQueue); + dispatch_queue_set_specific(mWorkQueue, &sPlatformManagerKey, this, nullptr); + mIsWorkQueueSuspended = true; + } + return mWorkQueue; +} + bool PlatformManagerImpl::IsWorkQueueCurrentQueue() const { - return dispatch_get_current_queue() == mWorkQueue; + return dispatch_get_specific(&sPlatformManagerKey) == this; } CHIP_ERROR PlatformManagerImpl::StartBleScan(BleScannerDelegate * delegate) diff --git a/src/platform/Darwin/PlatformManagerImpl.h b/src/platform/Darwin/PlatformManagerImpl.h index 79da67a4991d2f..2dfa9104e0dab3 100644 --- a/src/platform/Darwin/PlatformManagerImpl.h +++ b/src/platform/Darwin/PlatformManagerImpl.h @@ -45,17 +45,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener public: // ===== Platform-specific members that may be accessed directly by the application. - dispatch_queue_t GetWorkQueue() - { - if (mWorkQueue == nullptr) - { - mWorkQueue = dispatch_queue_create(CHIP_CONTROLLER_QUEUE, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - dispatch_suspend(mWorkQueue); - mIsWorkQueueSuspended = true; - } - return mWorkQueue; - } - + dispatch_queue_t GetWorkQueue(); bool IsWorkQueueCurrentQueue() const; CHIP_ERROR StartBleScan(BleScannerDelegate * delegate = nullptr); From 26ae6484415d18d205c4f16ba42e3d43c0a959c4 Mon Sep 17 00:00:00 2001 From: sharad-patil24 <100128124+sharad-patil24@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:10:27 +0530 Subject: [PATCH 64/96] LWIP number of pools and pool size reduced for rs9116 (#29005) --- src/lwip/silabs/lwipopts-rs911x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lwip/silabs/lwipopts-rs911x.h b/src/lwip/silabs/lwipopts-rs911x.h index c4a7addb27f0fe..72dcd190896c39 100644 --- a/src/lwip/silabs/lwipopts-rs911x.h +++ b/src/lwip/silabs/lwipopts-rs911x.h @@ -81,7 +81,7 @@ #define LWIP_RAW 1 #define MEMP_NUM_RAW_PCB (4) -#define MEMP_NUM_UDP_PCB (7) +#define MEMP_NUM_UDP_PCB (6) #define LWIP_HAVE_LOOPIF (0) @@ -129,7 +129,7 @@ #define MEMP_SEPARATE_POOLS (1) #define LWIP_PBUF_FROM_CUSTOM_POOLS (0) #define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (32) +#define PBUF_POOL_SIZE (16) #define PBUF_POOL_BUFSIZE (1280) // IPv6 path MTU #define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) #define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) From 0be1ae75eb3e76519cefdc611534b8c9b8243d99 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 6 Sep 2023 14:32:00 -0400 Subject: [PATCH 65/96] Fix slow test skipping in CI. (#29097) CI does "--exclude-tags SLOW", but it was not specifying any "--include-tags", so the harness overwrote the "--exclude-tags" value and we were in fact running the slow tests when we did not want to be. --- scripts/tests/run_test_suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index dc126b4e471314..643f13ce4d92af 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -169,7 +169,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, # If just defaults specified, do not run manual and in development # Specific target basically includes everything - if 'all' in target and not include_tags: + if 'all' in target and not include_tags and not exclude_tags: exclude_tags = { TestTag.MANUAL, TestTag.IN_DEVELOPMENT, From b673df57950f3ed13911c041e927086bf235dc59 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:39:47 -0400 Subject: [PATCH 66/96] Fix ICD Manager Init (#29088) --- src/app/server/Server.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index f7d8d24ab36d2f..81ac0b15a755ba 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -252,14 +252,15 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) } #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT + // This initializes clusters, so should come after lower level initialization. + InitDataModelHandler(); + +// ICD Init needs to be after data model init #if CHIP_CONFIG_ENABLE_ICD_SERVER mICDManager.Init(mDeviceStorage, &GetFabricTable(), mReportScheduler); mICDEventManager.Init(&mICDManager); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER - // This initializes clusters, so should come after lower level initialization. - InitDataModelHandler(); - #if defined(CHIP_APP_USE_ECHO) err = InitEchoHandler(&mExchangeMgr); SuccessOrExit(err); From b94eb85ffcee1e6f493d95a02b0d2ee8334fb573 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:54:19 +0000 Subject: [PATCH 67/96] Bump third_party/nanopb/repo from `d9ecc77` to `9c11463` (#29048) Bumps [third_party/nanopb/repo](https://github.com/nanopb/nanopb) from `d9ecc77` to `9c11463`. - [Commits](https://github.com/nanopb/nanopb/compare/d9ecc77395f09cd8cafd8b63cb82a27e6b02c04a...9c11463770beab0c6f244999e66676f9bca866fd) --- updated-dependencies: - dependency-name: third_party/nanopb/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/nanopb/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/nanopb/repo b/third_party/nanopb/repo index d9ecc77395f09c..9c11463770beab 160000 --- a/third_party/nanopb/repo +++ b/third_party/nanopb/repo @@ -1 +1 @@ -Subproject commit d9ecc77395f09cd8cafd8b63cb82a27e6b02c04a +Subproject commit 9c11463770beab0c6f244999e66676f9bca866fd From 0b9dfec117994815c56fe673c48be9352656dcb2 Mon Sep 17 00:00:00 2001 From: yzamstm <126248789+STYoannZamaron@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:05:35 +0200 Subject: [PATCH 68/96] [ST] Adding STM32 platform and lighting app example with STM32WB5MM-DK board (#28889) * add stm32cubewb submodule * move submodule stm32cubewb to tag v1.17.0 * fix align in gitmodules * add st in third_party * add builds and scripts to compile stm32 examples * add stm32 platform in matter source files and modifi gn files to use st as a third party * add stm32 lighting app example using stm32wb5mm-dk board * put chip_detail_logging to false to optimize the size of the flash * add support for st CI * typo fixs for ci * add st getting started readme * remove duplicate license * minor fixs in readme and stm32 getting started and add st getting started to the guides/readme * typo fix * mispells fix * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * Restyled by isort * Revert "Restyled by clang-format" This reverts commit 90c6d8f1f86763a3c8b254cc3c2532ee660489c7. * move otp to example and fix misspell and remove case sensitive in wordlist * remove unused defines and change return message for unused fonctions * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky * Restyled by whitespace * convert windows to linux file * convert windows to linux files * Restyled by whitespace * Restyled by clang-format * add missing include * removed unused arguments * update shutdown to call the upper class --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/.wordlist.txt | 4 + .github/workflows/examples-stm32.yaml | 71 ++ .gitmodules | 6 + BUILD.gn | 3 + build_overrides/stm32_sdk.gni | 18 + config/stm32/toolchain/BUILD.gn | 25 + docs/guides/README.md | 1 + docs/guides/stm32_getting_started_guide.md | 103 ++ examples/build_overrides/stm32_sdk.gni | 18 + examples/lighting-app/stm32/.gn | 28 + examples/lighting-app/stm32/BUILD.gn | 173 ++++ examples/lighting-app/stm32/README.md | 50 + examples/lighting-app/stm32/args.gni | 31 + examples/lighting-app/stm32/build_overrides | 1 + .../stm32/include/STM32WB5/AppEvent.h | 64 ++ .../stm32/include/STM32WB5/AppTask.h | 87 ++ .../include/STM32WB5/CHIPProjectConfig.h | 154 +++ .../stm32/include/STM32WB5/FreeRTOSConfig.h | 191 ++++ .../stm32/include/STM32WB5/LightingManager.h | 74 ++ .../stm32/src/STM32WB5/AppTask.cpp | 591 +++++++++++ .../stm32/src/STM32WB5/LightingManager.cpp | 140 +++ .../stm32/src/STM32WB5/ZclCallbacks.cpp | 47 + .../stm32/third_party/connectedhomeip | 1 + examples/platform/stm32/BUILD.gn | 82 ++ examples/platform/stm32/args.gni | 21 + .../common/STM32WB5MM-DK/Inc/app_common.h | 138 +++ .../stm32/common/STM32WB5MM-DK/Inc/app_conf.h | 667 ++++++++++++ .../common/STM32WB5MM-DK/Inc/app_entry.h | 57 ++ .../common/STM32WB5MM-DK/Inc/flash_driver.h | 181 ++++ .../stm32/common/STM32WB5MM-DK/Inc/flash_wb.h | 116 +++ .../stm32/common/STM32WB5MM-DK/Inc/hw_conf.h | 255 +++++ .../stm32/common/STM32WB5MM-DK/Inc/hw_if.h | 251 +++++ .../stm32/common/STM32WB5MM-DK/Inc/main.h | 65 ++ .../stm32/common/STM32WB5MM-DK/Inc/otp.h | 63 ++ .../common/STM32WB5MM-DK/Inc/stm32_lpm_if.h | 78 ++ .../STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h | 101 ++ .../STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h | 352 +++++++ .../common/STM32WB5MM-DK/Inc/stm32wbxx_it.h | 59 ++ .../common/STM32WB5MM-DK/Inc/stm_logging.h | 71 ++ .../common/STM32WB5MM-DK/Inc/utilities_conf.h | 66 ++ .../STM32WB5MM-DK/STM32_WPAN/App/app_ble.c | 958 ++++++++++++++++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_ble.h | 88 ++ .../STM32WB5MM-DK/STM32_WPAN/App/app_matter.c | 236 +++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_matter.h | 116 +++ .../STM32WB5MM-DK/STM32_WPAN/App/app_thread.c | 665 ++++++++++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_thread.h | 132 +++ .../STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h | 68 ++ .../STM32_WPAN/App/ble_dbg_conf.h | 196 ++++ .../STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c | 261 +++++ .../STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h | 134 +++ .../STM32_WPAN/App/tl_dbg_conf.h | 123 +++ .../STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c | 667 ++++++++++++ .../common/STM32WB5MM-DK/Src/app_entry.cpp | 583 +++++++++++ .../STM32WB5MM-DK/Src/entropy_hardware_poll.c | 76 ++ .../common/STM32WB5MM-DK/Src/flash_driver.c | 322 ++++++ .../stm32/common/STM32WB5MM-DK/Src/flash_wb.c | 357 +++++++ .../common/STM32WB5MM-DK/Src/freertos_port.c | 322 ++++++ .../common/STM32WB5MM-DK/Src/hw_timerserver.c | 899 ++++++++++++++++ .../stm32/common/STM32WB5MM-DK/Src/hw_uart.c | 469 +++++++++ .../stm32/common/STM32WB5MM-DK/Src/main.cpp | 439 ++++++++ .../stm32/common/STM32WB5MM-DK/Src/otp.c | 49 + .../common/STM32WB5MM-DK/Src/stm32_lpm_if.c | 349 +++++++ .../STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c | 385 +++++++ .../Src/stm32wbxx_hal_timebase_tim.c | 149 +++ .../common/STM32WB5MM-DK/Src/stm32wbxx_it.c | 193 ++++ .../common/STM32WB5MM-DK/Src/stm_logging.c | 207 ++++ .../stm32/common/STM32WB5MM-DK/Src/syscalls.c | 156 +++ .../stm32/common/STM32WB5MM-DK/Src/sysmem.c | 57 ++ .../STM32WB5MM-DK/Src/system_stm32wbxx.c | 345 +++++++ .../config_files/STM32WB5/FreeRTOSConfig.h | 191 ++++ .../config_files/STM32WB5/matter_config.h | 139 +++ .../config_files/STM32WB5/threading_alt.h | 50 + .../stm32/ldscripts/STM32WB5MMGHX_FLASH.ld | 198 ++++ .../startup_files/startup_STM32WB5MMGHX.s | 443 ++++++++ scripts/build/build/targets.py | 18 + scripts/build/builders/stm32.py | 93 ++ .../build/testdata/all_targets_linux_x64.txt | 1 + scripts/checkout_submodules.py | 1 + scripts/examples/gn_stm32_example.sh | 198 ++++ scripts/flashing/stm32_firmware_utils.py | 124 +++ src/platform/BUILD.gn | 7 + src/platform/device.gni | 7 +- src/platform/stm32/BLEManagerImpl.cpp | 743 ++++++++++++++ src/platform/stm32/BLEManagerImpl.h | 191 ++++ src/platform/stm32/BUILD.gn | 112 ++ src/platform/stm32/BlePlatformConfig.h | 38 + src/platform/stm32/CHIPDevicePlatformConfig.h | 149 +++ src/platform/stm32/CHIPDevicePlatformEvent.h | 76 ++ src/platform/stm32/CHIPMem-Platform.cpp | 239 +++++ src/platform/stm32/CHIPPlatformConfig.h | 81 ++ .../stm32/ConfigurationManagerImpl.cpp | 168 +++ src/platform/stm32/ConfigurationManagerImpl.h | 89 ++ .../stm32/ConnectivityManagerImpl.cpp | 72 ++ src/platform/stm32/ConnectivityManagerImpl.h | 109 ++ .../stm32/DiagnosticDataProviderImpl.cpp | 63 ++ .../stm32/DiagnosticDataProviderImpl.h | 55 + src/platform/stm32/FactoryDataProvider.cpp | 394 +++++++ src/platform/stm32/FactoryDataProvider.h | 69 ++ src/platform/stm32/InetPlatformConfig.h | 41 + .../stm32/KeyValueStoreManagerImpl.cpp | 121 +++ src/platform/stm32/KeyValueStoreManagerImpl.h | 82 ++ src/platform/stm32/PlatformManagerImpl.cpp | 116 +++ src/platform/stm32/PlatformManagerImpl.h | 101 ++ src/platform/stm32/STM32Config.cpp | 105 ++ src/platform/stm32/STM32Config.h | 93 ++ src/platform/stm32/STM32FreeRtosHooks.cpp | 120 +++ src/platform/stm32/STM32FreeRtosHooks.h | 27 + src/platform/stm32/SystemPlatformConfig.h | 43 + src/platform/stm32/ThreadStackManagerImpl.cpp | 144 +++ src/platform/stm32/ThreadStackManagerImpl.h | 128 +++ src/platform/stm32/args.gni | 53 + src/system/BUILD.gn | 5 + third_party/st/BUILD.gn | 45 + .../FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper | 77 ++ third_party/st/FAMILY/stm32wb5_sdk.gn_helper | 173 ++++ third_party/st/STM32CubeWB | 1 + third_party/st/stm32_arm.gni | 23 + third_party/st/stm32_board.gni | 36 + third_party/st/stm32_executable.gni | 75 ++ third_party/st/stm32_sdk.gni | 182 ++++ 120 files changed, 19412 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/examples-stm32.yaml create mode 100644 build_overrides/stm32_sdk.gni create mode 100644 config/stm32/toolchain/BUILD.gn create mode 100644 docs/guides/stm32_getting_started_guide.md create mode 100644 examples/build_overrides/stm32_sdk.gni create mode 100644 examples/lighting-app/stm32/.gn create mode 100644 examples/lighting-app/stm32/BUILD.gn create mode 100644 examples/lighting-app/stm32/README.md create mode 100644 examples/lighting-app/stm32/args.gni create mode 120000 examples/lighting-app/stm32/build_overrides create mode 100644 examples/lighting-app/stm32/include/STM32WB5/AppEvent.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/AppTask.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/LightingManager.h create mode 100644 examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp create mode 100644 examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp create mode 100644 examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp create mode 120000 examples/lighting-app/stm32/third_party/connectedhomeip create mode 100644 examples/platform/stm32/BUILD.gn create mode 100644 examples/platform/stm32/args.gni create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c create mode 100644 examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h create mode 100644 examples/platform/stm32/config_files/STM32WB5/matter_config.h create mode 100644 examples/platform/stm32/config_files/STM32WB5/threading_alt.h create mode 100644 examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld create mode 100644 examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s create mode 100644 scripts/build/builders/stm32.py create mode 100755 scripts/examples/gn_stm32_example.sh create mode 100644 scripts/flashing/stm32_firmware_utils.py create mode 100644 src/platform/stm32/BLEManagerImpl.cpp create mode 100644 src/platform/stm32/BLEManagerImpl.h create mode 100644 src/platform/stm32/BUILD.gn create mode 100644 src/platform/stm32/BlePlatformConfig.h create mode 100644 src/platform/stm32/CHIPDevicePlatformConfig.h create mode 100644 src/platform/stm32/CHIPDevicePlatformEvent.h create mode 100644 src/platform/stm32/CHIPMem-Platform.cpp create mode 100644 src/platform/stm32/CHIPPlatformConfig.h create mode 100644 src/platform/stm32/ConfigurationManagerImpl.cpp create mode 100644 src/platform/stm32/ConfigurationManagerImpl.h create mode 100644 src/platform/stm32/ConnectivityManagerImpl.cpp create mode 100644 src/platform/stm32/ConnectivityManagerImpl.h create mode 100644 src/platform/stm32/DiagnosticDataProviderImpl.cpp create mode 100644 src/platform/stm32/DiagnosticDataProviderImpl.h create mode 100644 src/platform/stm32/FactoryDataProvider.cpp create mode 100644 src/platform/stm32/FactoryDataProvider.h create mode 100644 src/platform/stm32/InetPlatformConfig.h create mode 100644 src/platform/stm32/KeyValueStoreManagerImpl.cpp create mode 100644 src/platform/stm32/KeyValueStoreManagerImpl.h create mode 100644 src/platform/stm32/PlatformManagerImpl.cpp create mode 100644 src/platform/stm32/PlatformManagerImpl.h create mode 100644 src/platform/stm32/STM32Config.cpp create mode 100644 src/platform/stm32/STM32Config.h create mode 100644 src/platform/stm32/STM32FreeRtosHooks.cpp create mode 100644 src/platform/stm32/STM32FreeRtosHooks.h create mode 100644 src/platform/stm32/SystemPlatformConfig.h create mode 100644 src/platform/stm32/ThreadStackManagerImpl.cpp create mode 100644 src/platform/stm32/ThreadStackManagerImpl.h create mode 100644 src/platform/stm32/args.gni create mode 100644 third_party/st/BUILD.gn create mode 100644 third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper create mode 100644 third_party/st/FAMILY/stm32wb5_sdk.gn_helper create mode 160000 third_party/st/STM32CubeWB create mode 100644 third_party/st/stm32_arm.gni create mode 100644 third_party/st/stm32_board.gni create mode 100644 third_party/st/stm32_executable.gni create mode 100644 third_party/st/stm32_sdk.gni diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index e572827bac80d2..05a46e2da0395e 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1276,6 +1276,9 @@ StatusCode stderr stdout sterm +stmicroelectronics +stm +stlink storagepath str strcpy @@ -1352,6 +1355,7 @@ ThreadNetworkDiagnostics threadOperationalDataset ThreadStackManager ThreadStackManagerImpl +thread ths Thunderboard timedInteractionTimeoutMs diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml new file mode 100644 index 00000000000000..15f80dd84350be --- /dev/null +++ b/.github/workflows/examples-stm32.yaml @@ -0,0 +1,71 @@ +# Copyright (c) 2020-2021 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. + +name: Build example - stm32 + +on: + push: + pull_request: + merge_group: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +env: + CHIP_NO_LOG_TIMESTAMPS: true + +jobs: + stm32: + name: stm32 + timeout-minutes: 60 + + env: + BUILD_TYPE: gn_stm32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:1 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: stm32 + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build stm32 example apps + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target stm32-STM32WB5MM-DK-light build \ + " + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: stm32 + diff --git a/.gitmodules b/.gitmodules index f9050a0595cd6a..6a98ceb1c26ec4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -319,3 +319,9 @@ url = https://github.com/SiliconLabs/wiseconnect branch = master platforms = efr32 +[submodule "third_party/st/STM32CubeWB"] + path = third_party/st/STM32CubeWB + url = https://github.com/STMicroelectronics/STM32CubeWB.git + branch = v1.17.0 + platform = stm32 + diff --git a/BUILD.gn b/BUILD.gn index 5b3a9e480b6336..8c7c5bd4f32c7c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -276,6 +276,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { # Set this to true to enable genio builds by default. enable_genio_builds = false + + # Set this to true to enable stm32 builds by default. + enable_stm32_builds = false } # Pigweed does not provide a clang in some configurations. diff --git a/build_overrides/stm32_sdk.gni b/build_overrides/stm32_sdk.gni new file mode 100644 index 00000000000000..e9942b843942f1 --- /dev/null +++ b/build_overrides/stm32_sdk.gni @@ -0,0 +1,18 @@ +# Copyright (c) 2023 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. + +declare_args() { + # Root directory for stm32 SDK build files. + stm32_sdk_build_root = "//third_party/st" +} diff --git a/config/stm32/toolchain/BUILD.gn b/config/stm32/toolchain/BUILD.gn new file mode 100644 index 00000000000000..8ce717c45ea888 --- /dev/null +++ b/config/stm32/toolchain/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2023 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_overrides/chip.gni") + +import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni") + +arm_toolchain("stm32_lighting_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/lighting-app/stm32/args.gni") + } +} diff --git a/docs/guides/README.md b/docs/guides/README.md index 552f3a30772327..da96c5a8eb7b20 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -22,6 +22,7 @@ - [Silicon Labs - Documentation](https://github.com/SiliconLabs/matter#readme) - [Silicon Labs - Building](./silabs_efr32_building.md) - [Silicon Labs - Software Update](./silabs_efr32_software_update.md) +- [STMicroelectronics (STM32)](./stm32_getting_started_guide.md) - [TI - Platform Overview](./ti_platform_overview.md) - [Open IoT SDK - Platform Overview](./openiotsdk_platform_overview.md) - [Open IoT SDK - Examples](./openiotsdk_examples.md) diff --git a/docs/guides/stm32_getting_started_guide.md b/docs/guides/stm32_getting_started_guide.md new file mode 100644 index 00000000000000..55f856cbc0e872 --- /dev/null +++ b/docs/guides/stm32_getting_started_guide.md @@ -0,0 +1,103 @@ +# STM32 Getting Started Guide + +The stm32 platform uses +[Matter](https://github.com/project-chip/connectedhomeip) sdk with FreeRTOS. + +--- + +- [stm32 Getting Started Guide](#stm32-getting-started-guide) + - [Supported Chips](#supported-chips) + - [Matter Example Applications](#matter-example-applications) + - [Building the Example Application](#building-the-example-application) + - [Commissioning](#commissioning) + - [BLE-Thread mode](#ble-thread-mode) + +--- + +## Supported Chips + +The stm32 platform is supported on: + +- [STM32WB5MM-DK](https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html) + +## Matter Example Applications + +Sample Matter applications are provided for the stm32 platform. They can be used +to speed up development. You can find them in the samples with `/stm32` +subfolder. + +## Building the Example Application + +- [Set Up Matter Environment](./BUILDING.md) + +- Set up STLINK tools + + ``` + apt-get install stlink-tools + ``` + +- Building the Application + + If the lighting example is to be built: + + ``` + ./scripts/build/build_examples.py --target stm32-$stm32_BOARD-lighting build + ``` + +- The output image files are stored in the subdirectories under `out`, the + subdirectory name is the same as the argument specified after the option + `--target` when build the examples. + +- After building the application, `ST-LINK` tool is used to flash it to the + board. Before flashing the application, you will need to flash the fuse and + the co processor binary. The co processor binary and fuse are available + [here](https://github.com/stm32-hotspot/stm32wb-matter-device-over-thread/tree/main/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x) + Dynamic Concurrent Mode BLE Thread for Matter (Supports Full BLE Stack 5.2 + certified and Minimal Thread Device ready v1.3) + + ``` + sudo st-flash write chip-stm32-lighting-example.bin 0x08000000 + + ``` + +## Commissioning + +There is one commissioning modes supported by stm32 platform: + +### BLE-Thread mode + +1. Build and Flash +2. The example will run automatically after booting the stm32 board. +3. Restore factory settings using B1 button by pressing at least 10 seconds +4. Commissioning with + [Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool),for + example: + + ``` + ./chip-tool pairing ble-thread + ``` + +### Bluetooth LE advertising + +In this example, to commission the device onto a Matter network, it must be +discoverable over Bluetooth LE. After powering up the device, the device will +advertise automatically for 30 seconds. After this delay, you will need to reset +the device to start the commissioning procedure. + +### Bluetooth LE rendezvous + +In Matter, the commissioning procedure is done over Bluetooth LE between a +Matter device and the Matter controller(, where the controller has the +commissioner role. + +To start the rendezvous, the controller must get the commissioning information +from the Matter device. The data payload is encoded within a QR code, printed to +the UART console. + +### Thread provisioning + +The provisioning operation, which is the Last part of the rendezvous procedure, +involves sending the Thread network credentials from the Matter controller to +the Matter device. As a result, the device joins the Thread network via a +OpenThread border Router (OTBR) and can communicate with other devices in the +network. diff --git a/examples/build_overrides/stm32_sdk.gni b/examples/build_overrides/stm32_sdk.gni new file mode 100644 index 00000000000000..f9b5048472f6cb --- /dev/null +++ b/examples/build_overrides/stm32_sdk.gni @@ -0,0 +1,18 @@ +# 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. + +declare_args() { + # Root directory for stm32 SDK. + stm32_sdk_build_root = "//third_party/connectedhomeip/third_party/st" +} diff --git a/examples/lighting-app/stm32/.gn b/examples/lighting-app/stm32/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/lighting-app/stm32/.gn @@ -0,0 +1,28 @@ +# 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") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/lighting-app/stm32/BUILD.gn b/examples/lighting-app/stm32/BUILD.gn new file mode 100644 index 00000000000000..6adecf2d04c1f5 --- /dev/null +++ b/examples/lighting-app/stm32/BUILD.gn @@ -0,0 +1,173 @@ +# # Copyright (c) 2023 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_overrides/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") +import("${stm32_sdk_build_root}/stm32_executable.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +assert(current_os == "freertos") + +stm32_project_dir = "${chip_root}/examples/lighting-app/stm32" +examples_plat_dir = "${chip_root}/examples/platform/stm32" +stm32_board_src = "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK" + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false + + # PIN code for PASE session establishment. + setupPinCode = 20202021 + setupDiscriminator = 3840 + + # Monitor & log memory usage at runtime. + enable_heap_monitoring = false + + # Enable Sleepy end device + enable_sleepy_device = false + + # OTA timeout in seconds + OTA_periodic_query_timeout = 86400 +} + +# Sanity check +assert(!(chip_enable_wifi && chip_enable_openthread)) + +# ThunderBoards and Explorer Kit +if (stm32_board == "STM32WB5MM-DK") { + chip_enable_openthread = true +} + +stm32_sdk("sdk") { + if (stm32_board == "STM32WB5MM-DK") { + sources = [ + "${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h", + "${examples_plat_dir}/config_files/STM32WB5/matter_config.h", + "${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h", + ] + } + + include_dirs = [ + "${chip_root}/src/platform/stm32", + "${examples_plat_dir}", + "${chip_root}/src/lib", + ] + + if (stm32_board == "STM32WB5MM-DK") { + include_dirs += [ + "${stm32_project_dir}/include/STM32WB5", + "${examples_plat_dir}/config_files/STM32WB5", + "${chip_root}/src/include", + ] + } + + defines = [ + "BOARD_ID=${stm32_board}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", + "OTA_PERIODIC_TIMEOUT=${OTA_periodic_query_timeout}", + "STM32STORE_MAX_KEY_SIZE=75", + ] +} + +stm32_executable("lighting_app") { + if (stm32_board == "STM32WB5MM-DK") { + output_name = "chip-stm32-lighting-example.elf" + include_dirs = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK/Inc", + "${chip_root}/src/include/", + ] + defines = [] + + sources = [ + "${stm32_board_src}/STM32_WPAN/App/app_ble.c", + "${stm32_board_src}/STM32_WPAN/App/app_matter.c", + "${stm32_board_src}/STM32_WPAN/App/app_thread.c", + "${stm32_board_src}/STM32_WPAN/App/custom_stm.c", + "${stm32_board_src}/Src/app_entry.cpp", + "${stm32_board_src}/Src/main.cpp", + "src/STM32WB5/AppTask.cpp", + "src/STM32WB5/LightingManager.cpp", + "src/STM32WB5/ZclCallbacks.cpp", + ] + } + + # Add the startup file to the target + sources += [ "${examples_plat_dir}/startup_files/startup_${stm32_mcu}.s" ] + + deps = [ + ":sdk", + "${chip_root}/examples/lighting-app/lighting-common", + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] + + defines += [ + "DEBUG", + "USE_HAL_DRIVER", + ] + + # OpenThread Settings + if (chip_enable_openthread) { + deps += [ + "${chip_root}/third_party/openthread:openthread", + "${chip_root}/third_party/openthread:openthread-platform", + ] + } + + if (chip_enable_ota_requestor) { + defines += [ "STM32_OTA_ENABLED" ] + sources += [ "${examples_plat_dir}/OTAConfig.cpp" ] + } + + ldscript = "${examples_plat_dir}/ldscripts/${stm32_mcu}_FLASH.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-T" + rebase_path(ldscript, root_build_dir), + + # other linker flags ... + "-static", + "-Wl,--cref", + "-Wl,--start-group", + "-lc", + "-lm", + "-lstdc++", + "-lsupc++", + "-Wl,--no-warn-rwx-segments", + "-Wl,--end-group", + ] + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + output_dir = root_out_dir +} +group("stm32") { + deps = [ ":lighting_app" ] +} + +group("default") { + deps = [ ":stm32" ] +} diff --git a/examples/lighting-app/stm32/README.md b/examples/lighting-app/stm32/README.md new file mode 100644 index 00000000000000..26a6051d1a963e --- /dev/null +++ b/examples/lighting-app/stm32/README.md @@ -0,0 +1,50 @@ +# Matter STM32 Lighting Example over thread + +This example demonstrates the Matter Lighting application on stm32 platform. + +--- + +- [Matter STM32 Lighting Example over thread](#matter-stm32-lighting-example-over-thread) + - [Building and Commissioning](#building-and-commissioning) + - [Cluster Control](#cluster-control) + - [Indicate current state of lightbulb](#indicate-current-state-of-lightbulb) + +--- + +## Building and Commissioning + +Please refer +[Building and Commissioning](../../../docs/guides/stm32_getting_started_guide.md#building-the-example-application) +guides to get started + +``` +./scripts/build/build_examples.py --target stm32-$stm32_BOARD-lighting build +``` + +## Cluster Control + +After successful commissioning, use `chip-tool` to control the board + +- OnOff Cluster + ``` + ./chip-tool onoff on 1 + ./chip-tool onoff off 1 + ./chip-tool onoff toggle 1 + ``` +- LevelControl Cluster + + ``` + ./chip-tool levelcontrol move-to-level 128 10 0 0 1 + ``` + +- ColorControl Cluster + ``` + ./chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 1 + ``` + +## Indicate current state of lightbulb + +The LCD screen displays "BLE connected" when the BLE rendezvous started. The LCD +screen displays "Network Join" when the board joins thread network. The LCD +screen displays "LED ON" + the light level when the controller enable the light +ON and the line is erased when the controller disable the light. diff --git a/examples/lighting-app/stm32/args.gni b/examples/lighting-app/stm32/args.gni new file mode 100644 index 00000000000000..3fb288dbacef01 --- /dev/null +++ b/examples/lighting-app/stm32/args.gni @@ -0,0 +1,31 @@ +# Copyright (c) 2023 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/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/stm32/args.gni") + +stm32_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +# Size Optimizations +optimize_debug_level = "s" + +chip_enable_ota_requestor = false +chip_project_config_include_dirs = + [ "${chip_root}/examples/lighting-app/stm32/include/STM32WB5" ] +chip_enable_openthread = true +chip_enable_ble = true +chip_config_enable_arg_parser = false +chip_openthread_ftd = false +chip_detail_logging = false diff --git a/examples/lighting-app/stm32/build_overrides b/examples/lighting-app/stm32/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/lighting-app/stm32/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h b/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h new file mode 100644 index 00000000000000..ccb5c3fa9a5b20 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2018 Nest Labs, Inc. + * 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 +#include +#include +#include + +#ifndef APP_EVENT_H +#define APP_EVENT_H + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Level, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t ButtonIdx; + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Color; + } LightingEvent; + }; + + EventHandler Handler; +}; + +#endif // APP_EVENT_H diff --git a/examples/lighting-app/stm32/include/STM32WB5/AppTask.h b/examples/lighting-app/stm32/include/STM32WB5/AppTask.h new file mode 100644 index 00000000000000..5c0344cc8c687a --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/AppTask.h @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2020 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. + */ + +#ifndef APP_TASK_H +#define APP_TASK_H + +#include +#include + +#include "AppEvent.h" +#include "LightingManager.h" +#include "app_entry.h" + +#include +#include +#define APP_NAME "Lighting-app" + +class AppTask +{ + +public: + CHIP_ERROR StartAppTask(); + CHIP_ERROR Init(); + static void AppTaskMain(void * pvParameter); + void PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction); + void PostEvent(const AppEvent * event); + void UpdateClusterState(); + CHIP_ERROR InitMatter(void); + static void ButtonEventHandler(Push_Button_st * Button); + +protected: + TaskHandle_t mAppTask = NULL; + +private: + friend AppTask & GetAppTask(void); + static void ActionInitiated(LightingManager::Action_t aAction); + static void ActionCompleted(LightingManager::Action_t aAction); + void CancelTimer(void); + void DispatchEvent(AppEvent * event); + static void FunctionHandler(AppEvent * aEvent); + static void LightingActionEventHandler(AppEvent * aEvent); + static void TimerEventHandler(TimerHandle_t xTimer); + static void DelayNvmHandler(TimerHandle_t xTimer); + static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + static void UpdateLCD(void); + static void UpdateNvmEventHandler(AppEvent * aEvent); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_Joiner = 1, + kFunction_SaveNvm = 2, + kFunction_FactoryReset = 3, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + bool mSyncClusterToButtonAction; + // chip::Ble::BLEEndPoint * mBLEEndPoint; + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} + +#endif // APP_TASK_H diff --git a/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h b/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h new file mode 100644 index 00000000000000..a911c565e95a1b --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h @@ -0,0 +1,154 @@ +/* + * + * Copyright (c) 2020 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. + */ + +/** + * @file + * CHIP project configuration for stm32wb builds. + * + */ +#ifndef CHIPPROJECTCONFIG_H +#define CHIPPROJECTCONFIG_H + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8004: example lighting app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8004 + +/* define Device type based on the application */ +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 257 // 0x0101 Dimmable Bulb + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * + * The product revision number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software revisions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * + * A string identifying the firmware revision running on the device. + * CHIP service currently expects the firmware version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.17" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 + +/** + * CHIP_DETAIL_LOGGING + * + * Show detail log in terminal + */ +#define CHIP_DETAIL_LOGGING 0 + +/** + * CHIP_ERROR_LOGGING + * + * Show error log in terminal + */ +#define CHIP_ERROR_LOGGING 1 + +/** + * CHIP_PROGRESS_LOGGING + * + * Show progress log in terminal + */ +#define CHIP_PROGRESS_LOGGING 1 + +/** + * CHIP_AUTOMATION_LOGGING + * + * Show automation log in terminal + */ +#define CHIP_AUTOMATION_LOGGING 1 + +#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES 5 +/** + * HIGHWATERMARK + * + * define freertos marker + */ +#define HIGHWATERMARK 0 + +#endif /* CHIPPROJECTCONFIG_H */ diff --git a/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h b/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h new file mode 100644 index 00000000000000..5423994ea0bc12 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h @@ -0,0 +1,191 @@ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.0.1 + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +#include +extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 0 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (56) +#define configMINIMAL_STACK_SIZE ((uint16_t) 128) +#define configTOTAL_HEAP_SIZE ((size_t) 1024 * 25) +#define configMAX_TASK_NAME_LEN (32) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (2) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS +/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ +#define configPRIO_BITS __NVIC_PRIO_BITS +#else +#define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + ; \ + } +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +//#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +#define configGENERATE_RUN_TIME_STATS 1 + +#if (configGENERATE_RUN_TIME_STATS == 1) + +extern void RTOS_AppConfigureTimerForRuntimeStats(); + +extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR(); + +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats() + +#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR() + +#endif + +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h b/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h new file mode 100644 index 00000000000000..ae3222ce045433 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2021 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 + +#include + +#include + +class LightingManager +{ +public: + enum Action_t + { + ON_ACTION = 0, + OFF_ACTION, + LEVEL_ACTION, + COLOR_ACTION_XY, + COLOR_ACTION_HSV, + INVALID_ACTION + } Action; + + enum State_t + { + kState_On = 0, + kState_Off, + } State; + + CHIP_ERROR Init(); + bool IsTurnedOn(); + uint8_t GetLevel(); + bool InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value); + + using LightingCallback_fn = std::function; + + void SetCallbacks(LightingCallback_fn aActionInitiated_CB, LightingCallback_fn aActionCompleted_CB); + +private: + friend LightingManager & LightingMgr(void); + State_t mState; + uint8_t mLevel; + + LightingCallback_fn mActionInitiated_CB; + LightingCallback_fn mActionCompleted_CB; + + void Set(bool aOn); + void SetLevel(uint8_t aLevel); + void UpdateLight(); + + static LightingManager sLight; +}; + +inline LightingManager & LightingMgr(void) +{ + return LightingManager::sLight; +} diff --git a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp new file mode 100644 index 00000000000000..4b9d5427adc8f4 --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp @@ -0,0 +1,591 @@ +/* + * + * Copyright (c) 2020 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. + */ + +/*STM32 includes*/ +#include "AppTask.h" +#include "AppEvent.h" +#include "app_common.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "flash_wb.h" +#include "ssd1315.h" +#include "stm32_lcd.h" +#include "stm32_lpm.h" +#include "stm32wb5mm_dk_lcd.h" + +#include "stm_logging.h" +#if HIGHWATERMARK +#include "memory_buffer_alloc.h" +#endif + +/*Matter includes*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if CHIP_ENABLE_OPENTHREAD +#include +#include +#endif + +using namespace ::chip; +using namespace ::chip::app; +using namespace chip::TLV; +using namespace chip::Credentials; +using namespace chip::DeviceLayer; +using namespace ::chip::Platform; +using namespace ::chip::Credentials; +using namespace ::chip::app::Clusters; +using chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr; + +AppTask AppTask::sAppTask; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + +#define APP_FUNCTION_BUTTON BUTTON_USER1 +#define STM32ThreadDataSet "STM32DataSet" +#define APP_EVENT_QUEUE_SIZE 10 +#define NVM_TIMEOUT 1000 // timer to handle PB to save data in nvm or do a factory reset +#define DELAY_NVM 5000 // save data in nvm after commissioning with a delay of 5 sec +#define STM32_LIGHT_ENDPOINT_ID 1 + +static QueueHandle_t sAppEventQueue; +TimerHandle_t sPushButtonTimeoutTimer; +TimerHandle_t DelayNvmTimer; +const osThreadAttr_t AppTask_attr = { .name = APPTASK_NAME, + .attr_bits = APP_ATTR_BITS, + .cb_mem = APP_CB_MEM, + .cb_size = APP_CB_SIZE, + .stack_mem = APP_STACK_MEM, + .stack_size = APP_STACK_SIZE, + .priority = APP_PRIORITY }; + +static bool sIsThreadProvisioned = false; +static bool sIsThreadEnabled = false; +static bool sHaveBLEConnections = false; +static bool sFabricNeedSaved = false; +static bool sFailCommissioning = false; +static bool sHaveFabric = false; +static uint8_t NvmTimerCpt = 0; +static uint8_t NvmButtonStateCpt = 0; + +CHIP_ERROR AppTask::StartAppTask() +{ + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + APP_DBG("Failed to allocate app event queue"); + return CHIP_ERROR_NO_MEMORY; + } + + // Start App task. + osThreadNew(AppTaskMain, NULL, &AppTask_attr); + + return CHIP_NO_ERROR; +} + +void LockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); +} + +void UnlockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); +} + +CHIP_ERROR AppTask::Init() +{ + + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + + // Setup button handler + APP_ENTRY_PBSetReceiveCallback(ButtonEventHandler); + + // Create FreeRTOS sw timer for Push button timeouts. + sPushButtonTimeoutTimer = xTimerCreate("PushButtonTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(NVM_TIMEOUT), // == default timer period (mS) + true, // no timer reload (==one-shot) + (void *) this, // init timer id + TimerEventHandler // timer callback handler + ); + + DelayNvmTimer = xTimerCreate("Delay_NVM", // Just a text name, not used by the RTOS kernel + DELAY_NVM, // == default timer period (mS) + pdFALSE, // timer reload + 0, // init timer + DelayNvmHandler // timer callback handler + ); + + ThreadStackMgr().InitThreadStack(); + + ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); + + PlatformMgr().AddEventHandler(MatterEventHandler, 0); + + err = LightingMgr().Init(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("LightingMgr().Init() failed"); + return err; + } + LightingMgr().SetCallbacks(ActionInitiated, ActionCompleted); + +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs); +#endif + + // Init ZCL Data Model + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + ReturnErrorOnFailure(mFactoryDataProvider.Init()); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + + chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; + nativeParams.lockCb = LockOpenThreadTask; + nativeParams.unlockCb = UnlockOpenThreadTask; + nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(); + initParams.endpointNativeParams = static_cast(&nativeParams); + chip::Server::GetInstance().Init(initParams); + + ConfigurationMgr().LogDeviceConfig(); + + // Open commissioning after boot if no fabric was available + if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) + { + PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); + // Enable BLE advertisements + chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + APP_DBG("BLE advertising started. Waiting for Pairing."); + } + else + { // try to attach to the thread network + uint8_t datasetBytes[Thread::kSizeOperationalDataset]; + size_t datasetLength = 0; + char Message[20]; + snprintf(Message, sizeof(Message), "Fabric Found: %d", chip::Server::GetInstance().GetFabricTable().FabricCount()); + APP_BLE_Init_Dyn_3(); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) Message, LEFT_MODE); + BSP_LCD_Refresh(0); + CHIP_ERROR error = KeyValueStoreMgr().Get(STM32ThreadDataSet, datasetBytes, sizeof(datasetBytes), &datasetLength); + if (error == CHIP_NO_ERROR) + { + ThreadStackMgr().SetThreadProvision(ByteSpan(datasetBytes, datasetLength)); + ThreadStackMgr().SetThreadEnabled(true); + } + else + { + APP_DBG("Thread network Data set was not found"); + } + } + + err = PlatformMgr().StartEventLoopTask(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("PlatformMgr().StartEventLoopTask() failed"); + } + + return err; +} + +CHIP_ERROR AppTask::InitMatter() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + err = chip::Platform::MemoryInit(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("Platform::MemoryInit() failed"); + } + else + { + APP_DBG("Init CHIP stack"); + err = PlatformMgr().InitChipStack(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("PlatformMgr().InitChipStack() failed"); + } + } + return err; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + CHIP_ERROR err = sAppTask.Init(); +#if HIGHWATERMARK + UBaseType_t uxHighWaterMark; + HeapStats_t HeapStatsInfo; + size_t max_used; + size_t max_blocks; +#endif // endif HIGHWATERMARK + if (err != CHIP_NO_ERROR) + { + APP_DBG("App task init failled "); + } + + APP_DBG("App Task started"); + while (true) + { + + BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); + while (eventReceived == pdTRUE) + { + sAppTask.DispatchEvent(&event); + eventReceived = xQueueReceive(sAppEventQueue, &event, 0); + } +#if HIGHWATERMARK + uxHighWaterMark = uxTaskGetStackHighWaterMark(NULL); + vPortGetHeapStats(&HeapStatsInfo); + mbedtls_memory_buffer_alloc_max_get(&max_used, &max_blocks); + +#endif // endif HIGHWATERMARK + } +} + +void AppTask::LightingActionEventHandler(AppEvent * aEvent) +{ + LightingManager::Action_t action; + + if (aEvent->Type == AppEvent::kEventType_Button) + { + // Toggle light + if (LightingMgr().IsTurnedOn()) + { + action = LightingManager::OFF_ACTION; + } + else + { + action = LightingManager::ON_ACTION; + } + + sAppTask.mSyncClusterToButtonAction = true; + LightingMgr().InitiateAction(action, 0, 0, 0); + } + if (aEvent->Type == AppEvent::kEventType_Level && aEvent->ButtonEvent.Action != 0) + { + // Toggle Dimming of light between 2 fixed levels + uint8_t val = 0x0; + val = LightingMgr().GetLevel() == 0x7f ? 0x1 : 0x7f; + action = LightingManager::LEVEL_ACTION; + + sAppTask.mSyncClusterToButtonAction = true; + LightingMgr().InitiateAction(action, 0, 1, &val); + } +} + +void AppTask::ButtonEventHandler(Push_Button_st * Button) +{ + + AppEvent button_event = {}; + button_event.Type = AppEvent::kEventType_Button; + button_event.ButtonEvent.ButtonIdx = Button->Pushed_Button; + button_event.ButtonEvent.Action = Button->State; + + if (Button->Pushed_Button == APP_FUNCTION_BUTTON) + { + // Hand off to Functionality handler - depends on duration of press + button_event.Handler = FunctionHandler; + } + else + { + return; + } + + sAppTask.PostEvent(&button_event); +} + +void AppTask::TimerEventHandler(TimerHandle_t xTimer) +{ + + NvmTimerCpt++; + if (BSP_PB_GetState(BUTTON_USER1) == 0) + { + NvmButtonStateCpt++; + } + if (NvmTimerCpt >= 10) + { + xTimerStop(sPushButtonTimeoutTimer, 0); + if (NvmButtonStateCpt >= 9) + { + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + sAppTask.mFunction = kFunction_FactoryReset; + sAppTask.PostEvent(&event); + } + } + else if ((NvmTimerCpt > NvmButtonStateCpt) && (NvmTimerCpt <= 2)) + { + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + xTimerStop(sPushButtonTimeoutTimer, 0); + sAppTask.mFunction = kFunction_SaveNvm; + sAppTask.PostEvent(&event); + } +} + +void AppTask::FunctionHandler(AppEvent * aEvent) +{ + if (xTimerIsTimerActive(sPushButtonTimeoutTimer) == 0) + { + xTimerStart(sPushButtonTimeoutTimer, 0); + NvmTimerCpt = 0; + NvmButtonStateCpt = 0; + } +} + +void AppTask::ActionInitiated(LightingManager::Action_t aAction) +{ + // Placeholder for light action + UTIL_LCD_ClearStringLine(2); + if (aAction == LightingManager::ON_ACTION) + { + APP_DBG("Light goes on"); + char Message[11]; + snprintf(Message, sizeof(Message), "LED ON %d", LightingMgr().GetLevel()); + UTIL_LCD_DisplayStringAt(0, LINE(2), (uint8_t *) Message, CENTER_MODE); + } + else if (aAction == LightingManager::OFF_ACTION) + { + APP_DBG("Light goes off "); + UTIL_LCD_ClearStringLine(2); + } + else if (aAction == LightingManager::LEVEL_ACTION) + { + if (LightingMgr().IsTurnedOn()) + { + char Message[11]; + snprintf(Message, sizeof(Message), "LED ON %d", LightingMgr().GetLevel()); + UTIL_LCD_DisplayStringAt(0, LINE(2), (uint8_t *) Message, CENTER_MODE); + APP_DBG("Update level control %d", LightingMgr().GetLevel()); + } + } + BSP_LCD_Refresh(0); +} + +void AppTask::ActionCompleted(LightingManager::Action_t aAction) +{ + // Placeholder for light action completed + if (aAction == LightingManager::ON_ACTION) + { + APP_DBG("Light action on completed"); + } + else if (aAction == LightingManager::OFF_ACTION) + { + APP_DBG("Light action off completed"); + } + if (sAppTask.mSyncClusterToButtonAction) + { + sAppTask.UpdateClusterState(); + sAppTask.mSyncClusterToButtonAction = false; + } +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (sAppEventQueue != NULL) + { + if (!xQueueSend(sAppEventQueue, aEvent, 1)) + { + ChipLogError(NotSpecified, "Failed to post event to app task event queue"); + } + } + else + { + ChipLogError(NotSpecified, "Event Queue is NULL should never happen"); + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + if (aEvent->Handler) + { + aEvent->Handler(aEvent); + } + else + { + ChipLogError(NotSpecified, "Event received with no handler. Dropping event."); + } +} + +/** + * Update cluster status after application level changes + */ +void AppTask::UpdateClusterState(void) +{ + ChipLogProgress(NotSpecified, "UpdateClusterState"); + // Write the new on/off value + EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn()); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + } + + // Write new level value + status = Clusters::LevelControl::Attributes::CurrentLevel::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel()); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: updating level %x", status); + } +} + +void AppTask::DelayNvmHandler(TimerHandle_t xTimer) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + sAppTask.mFunction = kFunction_SaveNvm; + sAppTask.PostEvent(&event); +} + +void AppTask::UpdateLCD(void) +{ + if (sIsThreadProvisioned && sIsThreadEnabled) + { + UTIL_LCD_DisplayStringAt(0, LINE(4), (uint8_t *) "Network Joined", LEFT_MODE); + } + else if ((sIsThreadProvisioned == false) || (sIsThreadEnabled == false)) + { + UTIL_LCD_ClearStringLine(4); + } + if (sHaveBLEConnections) + { + UTIL_LCD_ClearStringLine(1); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "BLE Connected", LEFT_MODE); + } + if (sHaveFabric) + { + UTIL_LCD_ClearStringLine(1); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "Fabric Created", LEFT_MODE); + } + if (sFailCommissioning == true) + { + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "", LEFT_MODE); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "Fabric Failed", LEFT_MODE); + } + BSP_LCD_Refresh(0); +} + +void AppTask::UpdateNvmEventHandler(AppEvent * aEvent) +{ + uint8_t err = 0; + + if (sAppTask.mFunction == kFunction_SaveNvm) + { + if (sIsThreadProvisioned && sIsThreadEnabled) + { + chip::Thread::OperationalDataset dataset{}; + DeviceLayer::ThreadStackMgrImpl().GetThreadProvision(dataset); + ByteSpan datasetbyte = dataset.AsByteSpan(); + KeyValueStoreMgr().Put(STM32ThreadDataSet, datasetbyte.data(), datasetbyte.size()); + } + err = NM_Dump(); + if (err == 0) + { + APP_DBG("SAVE NVM"); + } + else + { + APP_DBG("Failed to SAVE NVM"); + // restart timer to save nvm later + xTimerStart(DelayNvmTimer, 0); + } + } + else if (sAppTask.mFunction == kFunction_FactoryReset) + { + APP_DBG("FACTORY RESET"); + NM_ResetFactory(); + } +} + +void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t) +{ + switch (event->Type) + { + case DeviceEventType::kServiceProvisioningChange: { + sIsThreadProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned; + UpdateLCD(); + break; + } + + case DeviceEventType::kThreadConnectivityChange: { + sIsThreadEnabled = (event->ThreadConnectivityChange.Result == kConnectivity_Established); + UpdateLCD(); + break; + } + + case DeviceEventType::kCHIPoBLEConnectionEstablished: { + sHaveBLEConnections = true; + APP_DBG("kCHIPoBLEConnectionEstablished"); + UpdateLCD(); + break; + } + + case DeviceEventType::kCHIPoBLEConnectionClosed: { + sHaveBLEConnections = false; + APP_DBG("kCHIPoBLEConnectionClosed"); + UpdateLCD(); + if (sFabricNeedSaved) + { + APP_DBG("Start timer to save nvm after commissioning finish"); + // timer is used to avoid to much traffic on m0 side after the end of a commissioning + xTimerStart(DelayNvmTimer, 0); + sFabricNeedSaved = false; + } + break; + } + + case DeviceEventType::kCommissioningComplete: { + sFabricNeedSaved = true; + sHaveFabric = true; + // check if ble is on, since before save in nvm we need to stop m0, Better to write in nvm when m0 is less busy + if (sHaveBLEConnections == false) + { + APP_DBG("Start timer to save nvm after commissioning finish"); + xTimerStart(DelayNvmTimer, 0); + sFabricNeedSaved = false; // put to false to avoid save in nvm 2 times + } + UpdateLCD(); + break; + } + case DeviceEventType::kFailSafeTimerExpired: { + UpdateLCD(); + sFailCommissioning = true; + break; + } + default: + break; + } +} diff --git a/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp b/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp new file mode 100644 index 00000000000000..4b8018d7252cfb --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp @@ -0,0 +1,140 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * 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 "LightingManager.h" +#include + +// default initialization value for the light level after start +constexpr uint8_t kDefaultLevel = 64; + +LightingManager LightingManager::sLight; + +CHIP_ERROR LightingManager::Init() +{ + mState = kState_Off; + mLevel = kDefaultLevel; + + return CHIP_NO_ERROR; +} + +bool LightingManager::IsTurnedOn() +{ + return mState == kState_On; +} + +uint8_t LightingManager::GetLevel() +{ + return mLevel; +} + +void LightingManager::SetCallbacks(LightingCallback_fn aActionInitiated_CB, LightingCallback_fn aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value) +{ + bool action_initiated = false; + State_t new_state = kState_Off; + + switch (aAction) + { + case ON_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:ON: %s->ON", mState == kState_On ? "ON" : "OFF"); + break; + case OFF_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:OFF: %s->OFF", mState == kState_On ? "ON" : "OFF"); + break; + case LEVEL_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:LEVEL: lev:%u->%u", mLevel, *value); + break; + default: + ChipLogProgress(NotSpecified, "LightMgr:Unknown"); + break; + } + + // Initiate On/Off Action only when the previous one is complete. + if (mState == kState_Off && aAction == ON_ACTION) + { + action_initiated = true; + new_state = kState_On; + } + else if (mState == kState_On && aAction == OFF_ACTION) + { + action_initiated = true; + new_state = kState_Off; + } + else if (aAction == LEVEL_ACTION && *value != mLevel) + { + action_initiated = true; + if (*value == 0) + { + new_state = kState_Off; + } + else + { + new_state = kState_On; + } + } + if (aAction == LEVEL_ACTION) + { + SetLevel(*value); + } + else + { + Set(new_state == kState_On); + } + if (action_initiated) + { + if (mActionInitiated_CB) + { + mActionInitiated_CB(aAction); + } + + if (mActionCompleted_CB) + { + mActionCompleted_CB(aAction); + } + } + + return action_initiated; +} + +void LightingManager::SetLevel(uint8_t aLevel) +{ + mLevel = aLevel; + + UpdateLight(); +} + +void LightingManager::Set(bool aOn) +{ + if (aOn) + { + mState = kState_On; + } + else + { + mState = kState_Off; + } + UpdateLight(); +} + +void LightingManager::UpdateLight() {} diff --git a/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp b/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp new file mode 100644 index 00000000000000..762ad402274cf6 --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * 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 "AppTask.h" +#include "LightingManager.h" + +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + + if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) + { + LightingMgr().InitiateAction(*value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION, 0, size, value); + } + else if (clusterId == LevelControl::Id && attributeId == LevelControl::Attributes::CurrentLevel::Id) + { + LightingMgr().InitiateAction(LightingManager::LEVEL_ACTION, 0, size, value); + } +} + +void emberAfOnOffClusterInitCallback(EndpointId endpoint) {} diff --git a/examples/lighting-app/stm32/third_party/connectedhomeip b/examples/lighting-app/stm32/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/lighting-app/stm32/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/platform/stm32/BUILD.gn b/examples/platform/stm32/BUILD.gn new file mode 100644 index 00000000000000..cd843ec196c2df --- /dev/null +++ b/examples/platform/stm32/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2023 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/chip.gni") +import("//build_overrides/stm32_sdk.gni") +import("${chip_root}/src/lib/lib.gni") +import("${chip_root}/src/platform/device.gni") +import("${srm32_sdk_build_root}/stm32_board.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +config("chip_examples_project_config") { + include_dirs = [ "project_include" ] + + # Link options that provide a replacement for dynamic memory operations in standard + # library with the FreeRTOS malloc in platform code. + ldflags = [ + # memory allocation -- these must be re-entrant and do locking + #"-Wl,--wrap=malloc", + #"-Wl,--wrap=free", + #"-Wl,--wrap=realloc", + #"-Wl,--wrap=calloc", + #"-Wl,--wrap=MemoryAlloc", + # Wrap these in case internal newlib call them (e.g. strdup will) + # directly call _malloc_r) + #"-Wl,--wrap=_malloc_r", + #"-Wl,--wrap=_realloc_r", + #"-Wl,--wrap=_free_r", + #"-Wl,--wrap=_calloc_r", + ] +} + +source_set("openthread_core_config_stm32_chip_examples") { + if (chip_enable_openthread) { + sources = [ + # "project_include/OpenThreadConfig.h" + ] + + public_deps = [ "${stm32_sdk_build_root}:stm32_sdk" ] + + if (use_st_thread_lib) { + public_deps += [ "${stm32_sdk_build_root}:openthread_core_config_stm32" ] + } else { + public_deps += [ "${chip_root}/third_party/openthread/platforms/stm32:openthread_core_config_stm32" ] + } + + public_configs = [ ":chip_examples_project_config" ] + } +} + +config("attestation-credentials-config") { + include_dirs = [ "${chip_root}" ] + + defines = [ + # Set to 1 to enable stm32 attestation credentials + "STM32_ATTESTATION_CREDENTIALS", + ] +} + +source_set("stm32-attestation-credentials") { + sources = [ + # "stm32DeviceAttestationCreds.cpp", + # "stm32DeviceAttestationCreds.h", + ] + + public_deps = [ + "${chip_root}/src/credentials", + "${chip_root}/src/platform:platform_base", + ] + + public_configs = [ ":attestation-credentials-config" ] +} diff --git a/examples/platform/stm32/args.gni b/examples/platform/stm32/args.gni new file mode 100644 index 00000000000000..53604116cd174f --- /dev/null +++ b/examples/platform/stm32/args.gni @@ -0,0 +1,21 @@ +# Copyright (c) 2023 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/chip.gni") + +chip_ble_project_config_include = "" +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_inet_project_config_include = "" +chip_system_project_config_include = "" diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h new file mode 100644 index 00000000000000..63b2af6ae8a23b --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h @@ -0,0 +1,138 @@ +/** + ****************************************************************************** + * @file app_common.h + * @author MCD Application Team + * @brief Common + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_COMMON_H +#define __APP_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "app_conf.h" +#include "stm_logging.h" +#include +#include +#include +#include +#include + +/* -------------------------------- * + * Basic definitions * + * -------------------------------- */ + +#undef NULL +#define NULL 0 + +#undef FALSE +#define FALSE 0 + +#undef TRUE +#define TRUE (!0) + +/*SECTION*/ + +#define section_text __attribute__((section(".extendtext"), noinline)) + +/* -------------------------------- * + * Critical Section definition * + * -------------------------------- */ +#define BACKUP_PRIMASK() uint32_t primask_bit = __get_PRIMASK() +#define DISABLE_IRQ() __disable_irq() +#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit) + +/* -------------------------------- * + * Macro delimiters * + * -------------------------------- */ + +#define M_BEGIN \ + do \ + { + +#define M_END \ + } \ + while (0) + +/* -------------------------------- * + * Some useful macro definitions * + * -------------------------------- */ + +#ifndef MAX +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#endif + +#ifndef MIN +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) +#endif + +#define MODINC(a, m) \ + M_BEGIN(a)++; \ + if ((a) >= (m)) \ + (a) = 0; \ + M_END + +#define MODDEC(a, m) \ + M_BEGIN if ((a) == 0)(a) = (m); \ + (a)--; \ + M_END + +#define MODADD(a, b, m) \ + M_BEGIN(a) += (b); \ + if ((a) >= (m)) \ + (a) -= (m); \ + M_END + +#define MODSUB(a, b, m) MODADD(a, (m) - (b), m) + +#define PAUSE(t) \ + M_BEGIN \ + volatile int _i; \ + for (_i = t; _i > 0; _i--) \ + ; \ + M_END + +#define DIVF(x, y) ((x) / (y)) + +#define DIVC(x, y) (((x) + (y) -1) / (y)) + +#define DIVR(x, y) (((x) + ((y) / 2)) / (y)) + +#define SHRR(x, n) ((((x) >> ((n) -1)) + 1) >> 1) + +#define BITN(w, n) (((w)[(n) / 32] >> ((n) % 32)) & 1) + +#define BITNSET(w, n, b) \ + M_BEGIN(w)[(n) / 32] |= ((U32)(b)) << ((n) % 32); \ + M_END + +/* -------------------------------- * + * Compiler * + * -------------------------------- */ +#define PLACE_IN_SECTION(__x__) __attribute__((section(__x__))) + +#ifdef WIN32 +#define ALIGN(n) +#else +#define ALIGN(n) __attribute__((aligned(n))) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*__APP_COMMON_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h new file mode 100644 index 00000000000000..fe6e3b2aa16a29 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h @@ -0,0 +1,667 @@ +/** + ****************************************************************************** + * File Name : app_conf.h + * Description : Application configuration file for STM32WPAN middleWare. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_CONF_H +#define APP_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "hw.h" +#include "hw_conf.h" +#include "hw_if.h" + +/****************************************************************************** + * Application Config + ******************************************************************************/ + +/**< generic parameters */ + +/** + * + * Define Tx Power + */ +#define CFG_TX_POWER (0x18) /**< 0dbm */ + +/** + * Define Advertising parameters + */ +#define CFG_ADV_BD_ADDRESS (0x7257acd87a6c) +#define CFG_FAST_CONN_ADV_INTERVAL_MIN (0x80) /**< 80ms */ +#define CFG_FAST_CONN_ADV_INTERVAL_MAX (0xa0) /**< 100ms */ +#define CFG_LP_CONN_ADV_INTERVAL_MIN (0x640) /**< 1s */ +#define CFG_LP_CONN_ADV_INTERVAL_MAX (0xfa0) /**< 2.5s */ + +/** + * Define IO Authentication + */ +#define CFG_BONDING_MODE (1) +#define CFG_FIXED_PIN (111111) +#define CFG_USED_FIXED_PIN (0) +#define CFG_ENCRYPTION_KEY_SIZE_MAX (16) +#define CFG_ENCRYPTION_KEY_SIZE_MIN (8) + +/** + * Define IO capabilities + */ +#define CFG_IO_CAPABILITY_DISPLAY_ONLY (0x00) +#define CFG_IO_CAPABILITY_DISPLAY_YES_NO (0x01) +#define CFG_IO_CAPABILITY_KEYBOARD_ONLY (0x02) +#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03) +#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04) + +#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO + +/** + * Define MITM modes + */ +#define CFG_MITM_PROTECTION_NOT_REQUIRED (0x00) +#define CFG_MITM_PROTECTION_REQUIRED (0x01) + +#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED + +/** + * Define PHY + */ +#define ALL_PHYS_PREFERENCE 0x00 +#define RX_2M_PREFERRED 0x02 +#define TX_2M_PREFERRED 0x02 +#define TX_1M 0x01 +#define TX_2M 0x02 +#define RX_1M 0x01 +#define RX_2M 0x02 + +/* freertos defines */ +#define CFG_SHCI_USER_EVT_PROCESS_NAME "SHCI_USER_EVT_PROCESS" +#define CFG_SHCI_USER_EVT_PROCESS_ATTR_BITS (0) +#define CFG_SHCI_USER_EVT_PROCESS_CB_MEM (0) +#define CFG_SHCI_USER_EVT_PROCESS_CB_SIZE (0) +#define CFG_SHCI_USER_EVT_PROCESS_STACK_MEM (0) +#define CFG_SHCI_USER_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_SHCI_USER_EVT_PROCESS_STACK_SIZE (128 * 20) + +#define CFG_PUSH_BUTTON_EVT_PROCESS_NAME "PUSH_BUTTON_EVT_PROCESS" +#define CFG_PUSH_BUTTON_EVT_PROCESS_ATTR_BITS (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_CB_MEM (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_CB_SIZE (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_STACK_MEM (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_PUSH_BUTTON_EVT_PROCESS_STACK_SIZE (128 * 4) + +#define CFG_SEND_COAP_NAME "SEND_COAP_EVT_PROCESS" + +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_NAME "SWITCH_PROTCOL_EVT_PROCESS" +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_ATTR_BITS (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_CB_MEM (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_CB_SIZE (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_STACK_MEM (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_NAME "THREAD_MSG_M0_TO_M4_PROCESS" +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_MEM (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_SIZE (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_MEM (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_CLI_PROCESS_NAME "THREAD_CLI_PROCESS" +#define CFG_THREAD_CLI_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_CLI_PROCESS_CB_MEM (0) +#define CFG_THREAD_CLI_PROCESS_CB_SIZE (0) +#define CFG_THREAD_CLI_PROCESS_STACK_MEM (0) +#define CFG_THREAD_CLI_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_CLI_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_NAME "THREAD_SEND_COAP_MSG_PROCESS" +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_CB_MEM (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_CB_SIZE (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_STACK_MEM (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_STACk_SIZE (128 * 8) + +#define CFG_THREAD_SET_SED_MODE_PROCESS_NAME "THREAD_SET_SED_MODE_PROCESS" +#define CFG_THREAD_SET_SED_MODE_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_CB_MEM (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_CB_SIZE (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_STACK_MEM (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_SET_SED_MODE_PROCESS_STACk_SIZE (128 * 8) + +#define CFG_HCI_USER_EVT_PROCESS_NAME "HCI_USER_EVT_PROCESS" +#define CFG_HCI_USER_EVT_PROCESS_ATTR_BITS (0) +#define CFG_HCI_USER_EVT_PROCESS_CB_MEM (0) +#define CFG_HCI_USER_EVT_PROCESS_CB_SIZE (0) +#define CFG_HCI_USER_EVT_PROCESS_STACK_MEM (0) +#define CFG_HCI_USER_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_HCI_USER_EVT_PROCESS_STACK_SIZE (128 * 40) + +#define CFG_ADV_UPDATE_PROCESS_NAME "ADV_UPDATE_PROCESS" +#define CFG_ADV_UPDATE_PROCESS_ATTR_BITS (0) +#define CFG_ADV_UPDATE_PROCESS_CB_MEM (0) +#define CFG_ADV_UPDATE_PROCESS_CB_SIZE (0) +#define CFG_ADV_UPDATE_PROCESS_STACK_MEM (0) +#define CFG_ADV_UPDATE_PROCESS_PRIORITY osPriorityNormal +#define CFG_ADV_UPDATE_PROCESS_STACK_SIZE (128 * 20) + +#define CFG_P2P_SERVER_PROCESS_NAME "P2P_SERVER_PROCESS" +#define CFG_P2P_SERVER_PROCESS_ATTR_BITS (0) +#define CFG_P2P_SERVER_PROCESS_CB_MEM (0) +#define CFG_P2P_SERVER_PROCESS_CB_SIZE (0) +#define CFG_P2P_SERVER_PROCESS_STACK_MEM (0) +#define CFG_P2P_SERVER_PROCESS_PRIORITY osPriorityNormal +#define CFG_P2P_SERVER_PROCESS_STACK_SIZE (128 * 20) + +#define LED_PROCESS_NAME "LED_CUBE_PROCESS" +#define LED_PROCESS_ATTR_BITS (0) +#define LED_PROCESS_CB_MEM (0) +#define LED_PROCESS_CB_SIZE (0) +#define LED_PROCESS_STACK_MEM (0) +#define LED_PROCESS_PRIORITY osPriorityNormal +#define LED_PROCESS_STACK_SIZE (128 * 10) + +#define APPTASK_NAME "APPTASK" +#define APP_ATTR_BITS (0) +#define APP_CB_MEM (0) +#define APP_CB_SIZE (0) +#define APP_STACK_MEM (0) +#define APP_PRIORITY osPriorityNormal +#define APP_STACK_SIZE (1024 * 6) + +/** + * Identity root key used to derive LTK and CSRK + */ +#define CFG_BLE_IRK \ + { \ + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 \ + } + +/** + * Encryption root key used to derive LTK and CSRK + */ +#define CFG_BLE_ERK \ + { \ + 0xfe, 0xdc, 0xba, 0x09, 0x87, 0x65, 0x43, 0x21, 0xfe, 0xdc, 0xba, 0x09, 0x87, 0x65, 0x43, 0x21 \ + } + +/* USER CODE BEGIN Generic_Parameters */ +/** + * SMPS supply + * SMPS not used when Set to 0 + * SMPS used when Set to 1 + */ +#define CFG_USE_SMPS 1 +/* USER CODE END Generic_Parameters */ + +/**< specific parameters */ +/*****************************************************/ +#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler +#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler +#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler + +#define P2P_SERVER1 1 /*1 = Device is Peripherique*/ + +#define CFG_DEV_ID_P2P_SERVER1 (0x83) + +#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */ + +/** + * AD Element - Group B Feature + */ +/* LSB - First Byte */ +#define CFG_FEATURE_THREAD_SWITCH (0x40) + +/* LSB - Second Byte */ +#define CFG_FEATURE_OTA_REBOOT (0x20) + +#define CONN_L(x) ((int) ((x) / 0.625f)) +#define CONN_P(x) ((int) ((x) / 1.25f)) + +/* L2CAP Connection Update request parameters used for test only with smart Phone */ +#define L2CAP_REQUEST_NEW_CONN_PARAM 1 + +#define L2CAP_INTERVAL_MIN CONN_P(1000) /* 1s */ +#define L2CAP_INTERVAL_MAX CONN_P(1000) /* 1s */ +#define L2CAP_SLAVE_LATENCY 0x0000 +#define L2CAP_TIMEOUT_MULTIPLIER 0x1F4 + +/****************************************************************************** + * BLE Stack + ******************************************************************************/ +/** + * Maximum number of simultaneous connections that the device will support. + * Valid values are from 1 to 8 + */ +#define CFG_BLE_NUM_LINK 8 + +/** + * Maximum number of Services that can be stored in the GATT database. + * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services + */ +#define CFG_BLE_NUM_GATT_SERVICES 8 + +/** + * Maximum number of Attributes + * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services) + * that can be stored in the GATT database. + * Note that certain characteristics and relative descriptors are added automatically during device initialization + * so this parameters should be 9 plus the number of user Attributes + */ +#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 + +/** + * Maximum supported ATT_MTU size + */ +#define CFG_BLE_MAX_ATT_MTU (251) + +/** + * Size of the storage area for Attribute values + * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in + * octets) should be made for each attribute: + * - attribute value length + * - 5, if UUID is 16 bit; 19, if UUID is 128 bit + * - 2, if server configuration descriptor is used + * - 2*DTM_NUM_LINK, if client configuration descriptor is used + * - 2, if extended properties is used + * The total amount of memory needed is the sum of the above quantities for each attribute. + */ +#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) + +/** + * Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes + */ +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) + +/** + * Number of allocated memory blocks + */ +#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) + +/** + * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. + */ +#define CFG_BLE_DATA_LENGTH_EXTENSION 1 + +/** + * Sleep clock accuracy in Slave mode (ppm value) + */ +#define CFG_BLE_SLAVE_SCA 500 + +/** + * Sleep clock accuracy in Master mode + * 0 : 251 ppm to 500 ppm + * 1 : 151 ppm to 250 ppm + * 2 : 101 ppm to 150 ppm + * 3 : 76 ppm to 100 ppm + * 4 : 51 ppm to 75 ppm + * 5 : 31 ppm to 50 ppm + * 6 : 21 ppm to 30 ppm + * 7 : 0 ppm to 20 ppm + */ +#define CFG_BLE_MASTER_SCA 0 + +/** + * Source for the 32 kHz slow speed clock + * 1 : internal RO + * 0 : external crystal ( no calibration ) + */ +#define CFG_BLE_LSE_SOURCE 0 + +/** + * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) + */ +#define CFG_BLE_HSE_STARTUP_TIME 0x148 + +/** + * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) + */ +#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) + +/** + * Viterbi Mode + * 1 : enabled + * 0 : disabled + */ +#define CFG_BLE_VITERBI_MODE 1 + +/** + * BLE stack Options flags to be configured with: + * - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY + * - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST + * - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 + * which are used to set following configuration bits: + * (bit 0): 1: LL only + * 0: LL + host + * (bit 1): 1: no service change desc. + * 0: with service change desc. + * (bit 2): 1: device name Read-Only + * 0: device name R/W + * (bit 7): 1: LE Power Class 1 + * 0: LE Power Class 2-3 + * other bits: reserved (shall be set to 0) + */ +#define CFG_BLE_OPTIONS SHCI_C2_BLE_INIT_OPTIONS_LL_HOST + +#define CFG_BLE_MAX_COC_INITIATOR_NBR (32) + +#define CFG_BLE_MIN_TX_POWER (0) + +#define CFG_BLE_MAX_TX_POWER (0) +/****************************************************************************** + * Transport Layer + ******************************************************************************/ +/** + * Queue length of BLE Event + * This parameter defines the number of asynchronous events that can be stored in the HCI layer before + * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer + * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large + * enough to store all asynchronous events received in between. + * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events + * between the HCI command and its event. + * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small, + * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting + * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate + * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout). + */ +#define CFG_TLBLE_EVT_QUEUE_LENGTH 5 + +/** + * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element + * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager. + * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will + * never be used) + * It shall be at least 4 to receive the command status event in one frame. + * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced + * further depending on the application. + * + */ +#define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */ + +#define TL_BLE_EVENT_FRAME_SIZE (TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE) + +/****************************************************************************** + * UART interfaces + ******************************************************************************/ +#define CFG_DEBUG_TRACE_UART hw_uart1 +#define CFG_CLI_UART hw_lpuart1 + +/****************************************************************************** + * USB interface + ******************************************************************************/ + +/** + * Enable/Disable USB interface + */ +#define CFG_USB_INTERFACE_ENABLE 0 + +/****************************************************************************** + * Low Power + * + * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full + * low power mode. It means that all what can have an impact on the consumptions + * are powered down.(For instance LED, Access to Debugger, Etc.) + * + * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated + * + ******************************************************************************/ + +#define CFG_FULL_LOW_POWER 0 + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_LPM_SUPPORTED +#define CFG_LPM_SUPPORTED 1 +#endif /* CFG_FULL_LOW_POWER */ + +/* FOR DEBUGGING ONLY ! */ +//#define CFG_LPM_SUPPORTED 1 + +/****************************************************************************** + * Timer Server + ******************************************************************************/ +/** + * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer. + * The higher is the value, the better is the power consumption and the accuracy of the timerserver + * The lower is the value, the finest is the granularity + * + * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to output + * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding + * the wakeup timer. A lower clock speed would impact the accuracy of the timer server. + * + * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC. + * When the 1Hz calendar clock is required, it shall be sets according to other settings + * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE) + * + * CFG_RTCCLK_DIVIDER_CONF: + * Shall be set to either 0,2,4,8,16 + * When set to either 2,4,8,16, the 1Hhz calendar is supported + * When set to 0, the user sets its own configuration + * + * The following settings are computed with LSI as input to the RTC + */ +#define CFG_RTCCLK_DIVIDER_CONF 0 + +#if (CFG_RTCCLK_DIVIDER_CONF == 0) +/** + * Custom configuration + * It does not support 1Hz calendar + * It divides the RTC CLK by 16 + */ +#define CFG_RTCCLK_DIV (16) +#define CFG_RTC_WUCKSEL_DIVIDER (0) +#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1) +#define CFG_RTC_SYNCH_PRESCALER (0x7FFF) + +#else + +#if (CFG_RTCCLK_DIVIDER_CONF == 2) +/** + * It divides the RTC CLK by 2 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (3) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 4) +/** + * It divides the RTC CLK by 4 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (2) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 8) +/** + * It divides the RTC CLK by 8 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (1) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 16) +/** + * It divides the RTC CLK by 16 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (0) +#endif + +#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF +#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1) +#define CFG_RTC_SYNCH_PRESCALER (DIVR(LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER + 1)) - 1) + +#endif + +/** tick timer value in us */ +#define CFG_TS_TICK_VAL DIVR((CFG_RTCCLK_DIV * 1000000), LSE_VALUE) + +typedef enum +{ + CFG_TIM_PROC_ID_ISR, +} CFG_TimProcID_t; + +/****************************************************************************** + * Debug + ******************************************************************************/ +/** + * When set, this resets some hw resources to set the device in the same state than the power up + * The FW resets only register that may prevent the FW to run properly + * + * This shall be set to 0 in a final product + * + */ +#define CFG_HW_RESET_BY_FW 1 + +/** + * keep debugger enabled while in any low power mode when set to 1 + * should be set to 0 in production + */ +#define CFG_DEBUGGER_SUPPORTED 1 + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_DEBUGGER_SUPPORTED +#define CFG_DEBUGGER_SUPPORTED 0 +#endif /* CFG_FULL_LOW_POWER */ + +/***************************************************************************** + * Traces + * Enable or Disable traces in application + * When CFG_DEBUG_TRACE is set, traces are activated + * + * Note : Refer to utilities_conf.h file in order to details + * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT + *****************************************************************************/ + +/** + * When set to 1, the traces are enabled in the BLE services + */ +#define CFG_DEBUG_BLE_TRACE 1 + +/** + * Enable or Disable traces in application + */ +#define CFG_DEBUG_APP_TRACE 1 + +#if (CFG_DEBUG_APP_TRACE != 0) +#define APP_DBG_MSG PRINT_MESG_DBG +#else +#define APP_DBG_MSG PRINT_NO_MESG +#endif +#if ((CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0)) +#define CFG_DEBUG_TRACE 1 +#endif + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_DEBUG_TRACE +#define CFG_DEBUG_TRACE 0 +#endif /* CFG_FULL_LOW_POWER */ + +/** + * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number + * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output + * + * When both are set to 0, no trace are output + * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected + */ +#define CFG_DEBUG_TRACE_LIGHT 1 +#define CFG_DEBUG_TRACE_FULL 0 + +#if ((CFG_DEBUG_TRACE != 0) && (CFG_DEBUG_TRACE_LIGHT == 0) && (CFG_DEBUG_TRACE_FULL == 0)) +#undef CFG_DEBUG_TRACE_FULL +#undef CFG_DEBUG_TRACE_LIGHT +#define CFG_DEBUG_TRACE_FULL 0 +#define CFG_DEBUG_TRACE_LIGHT 1 +#endif + +#if (CFG_DEBUG_TRACE == 0) +#undef CFG_DEBUG_TRACE_FULL +#undef CFG_DEBUG_TRACE_LIGHT +#define CFG_DEBUG_TRACE_FULL 0 +#define CFG_DEBUG_TRACE_LIGHT 0 +#endif + +/** + * When not set, the traces is looping on sending the trace over UART + */ +#define DBG_TRACE_USE_CIRCULAR_QUEUE 1 + +/** + * max buffer Size to queue data traces and max data trace allowed. + * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined + */ +#define DBG_TRACE_MSG_QUEUE_SIZE (1024 * 5) +#define MAX_DBG_TRACE_MSG_SIZE 1024 + +/****************************************************************************** + * Configure Log level for Application + ******************************************************************************/ +#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO +#define APPLI_PRINT_FILE_FUNC_LINE 0 + +/* USER CODE BEGIN Defines */ +/****************************************************************************** + * User interaction + * When CFG_LED_SUPPORTED is set, LEDS are activated if requested + * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested + ******************************************************************************/ +#if (CFG_FULL_LOW_POWER == 1) +#define CFG_LED_SUPPORTED 0 +#define CFG_BUTTON_SUPPORTED 0 +#else +#define CFG_LED_SUPPORTED 1 +#define CFG_BUTTON_SUPPORTED 1 +#endif /* CFG_FULL_LOW_POWER */ +/* USER CODE END Defines */ + +/****************************************************************************** + * LOW POWER + ******************************************************************************/ +/** + * Supported requester to the MCU Low Power Manager - can be increased up to 32 + * It lists a bit mapping of all user of the Low Power Manager + */ +typedef enum +{ + CFG_LPM_APP, + CFG_LPM_APP_BLE, + CFG_LPM_APP_THREAD + /* USER CODE BEGIN CFG_LPM_Id_t */ + + /* USER CODE END CFG_LPM_Id_t */ +} CFG_LPM_Id_t; + +/****************************************************************************** + * OTP manager + ******************************************************************************/ +#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE + +#define CFG_OTP_END_ADDRESS OTP_AREA_END_ADDR + +typedef enum +{ + BUTTON_1 = 0x1, +} button_type_t; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* APP_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h new file mode 100644 index 00000000000000..9d0378c18792c1 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h @@ -0,0 +1,57 @@ + +/** + ****************************************************************************** + * @file app_entry.h + * @author MCD Application Team + * @brief Interface to the application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_ENTRY_H +#define __APP_ENTRY_H + +#include "stm32wbxx_hal.h" +#include "tl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* External variables --------------------------------------------------------*/ +typedef struct +{ + uint8_t Pushed_Button; + uint8_t State; // 1 pushed +} Push_Button_st; + +typedef void (*PushButtonCallback)(Push_Button_st * aMessage); + +/* Exported macros -----------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ +void APPE_Init(void); +void APP_ENTRY_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer); +void APP_ENTRY_ProcessMsgM0ToM4(void); +void APP_ENTRY_Init_CFG_CLI_UART(void); +void APP_ENTRY_TL_THREAD_INIT(void); +void APP_ENTRY_PBSetReceiveCallback(PushButtonCallback aCallback); +void APP_ENTRY_LedBlink(uint8_t LedStatus); + +#ifdef __cplusplus +} +#endif + +#endif /* __APP_ENTRY_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h new file mode 100644 index 00000000000000..24f4cfc6253572 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h @@ -0,0 +1,181 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file flash_driver.h + * @author MCD Application Team + * @brief Dual core Flash driver interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef FLASH_DRIVER_H +#define FLASH_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + SINGLE_FLASH_OPERATION_DONE, + SINGLE_FLASH_OPERATION_NOT_EXECUTED, +} SingleFlashOperationStatus_t; + +typedef enum +{ + WAITED_SEM_BUSY, + WAITED_SEM_FREE, +} WaitedSemStatus_t; + +typedef enum +{ + WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU1, + WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU2, +} WaitedSemId_t; + +typedef enum +{ + ReadyToWrite, + NotReadyToWrite, + +} StatusReadyToWrite; +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief Implements the Dual core algorithm to erase multiple sectors in flash with CPU1 + * It calls for each sector to be erased the API FD_EraseSingleSector() + * + * @param FirstSector: The first sector to be erased + * This parameter must be a value between 0 and (SFSA - 1) + * @param NbrOfSectors: The number of sectors to erase + * This parameter must be a value between 1 and (SFSA - FirstSector) + * @retval Number of sectors not erased: + * Depending on the implementation of FD_WaitForSemAvailable(), + * it may still have some sectors not erased when the timing protection has been + * enabled by either CPU1 or CPU2. When the value returned is not 0, the application + * should wait until both timing protection before retrying to erase the last missing sectors. + * + * In addition, When the returned value is not 0: + * - The Sem2 is NOT released + * - The FLASH is NOT locked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF) is NOT called + * It is expected that the user will call one more time this function to finish the process + */ +uint32_t FD_EraseSectors(uint32_t FirstSector, uint32_t NbrOfSectors); + +/** + * @brief Implements the Dual core algorithm to write multiple 64bits data in flash with CPU1 + * The user shall first make sure the location to be written has been first erase. + * Otherwise, the API will loop for ever as it will be not able to write in flash + * The only value that can be written even though the destination is not erased is 0. + * It calls for each 64bits to be written the API FD_WriteSingleData() + * + * @param DestAddress: Address of the flash to write the first data. It shall be 64bits aligned + * @param pSrcBuffer: Address of the buffer holding the 64bits data to be written in flash + * @param NbrOfData: Number of 64bits data to be written + * @retval Number of 64bits data not written: + * Depending on the implementation of FD_WaitForSemAvailable(), + * it may still have 64bits data not written when the timing protection has been + * enabled by either CPU1 or CPU2. When the value returned is not 0, the application + * should wait until both timing protection before retrying to write the last missing 64bits data. + * + * In addition, When the returned value is not 0: + * - The Sem2 is NOT released + * - The FLASH is NOT locked + * It is expected that the user will call one more time this function to finish the process + */ +uint32_t FD_WriteData(uint32_t DestAddress, uint64_t * pSrcBuffer, uint32_t NbrOfData); + +/** + * @brief Implements the Dual core algorithm to erase one sector in flash with CPU1 + * + * It expects the following point before calling this API: + * - The Sem2 is taken + * - The FLASH is unlocked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON) has been called + * It expects the following point to be done when no more sectors need to be erased + * - The Sem2 is released + * - The FLASH is locked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF) is called + * + * The two point above are implemented in FD_EraseSectors() + * This API needs to be used instead of FD_EraseSectors() in case a provided library is taking + * care of these two points and request only a single operation. + * + * @param FirstSector: The sector to be erased + * This parameter must be a value between 0 and (SFSA - 1) + * @retval: SINGLE_FLASH_OPERATION_DONE -> The data has been written + * SINGLE_FLASH_OPERATION_NOT_EXECUTED -> The data has not been written due to timing protection + * from either CPU1 or CPU2. On a failure status, the user should check + * both timing protection before retrying. + */ +SingleFlashOperationStatus_t FD_EraseSingleSector(uint32_t SectorNumber); + +/** + * @brief Implements the Dual core algorithm to write one 64bits data in flash with CPU1 + * The user shall first make sure the location to be written has been first erase. + * Otherwise, the API will loop for ever as it will be not able to write in flash + * The only value that can be written even though the destination is not erased is 0. + * + * It expects the following point before calling this API: + * - The Sem2 is taken + * - The FLASH is unlocked + * It expects the following point to be done when no more sectors need to be erased + * - The Sem2 is released + * - The FLASH is locked + * + * The two point above are implemented in FD_WriteData() + * This API needs to be used instead of FD_WriteData() in case a provided library is taking + * care of these two points and request only a single operation. + * + * @param DestAddress: Address of the flash to write the data. It shall be 64bits aligned + * @param Data: 64bits Data to be written + * @retval: SINGLE_FLASH_OPERATION_DONE -> The data has been written + * SINGLE_FLASH_OPERATION_NOT_EXECUTED -> The data has not been written due to timing protection + * from either CPU1 or CPU2. On a failure status, the user should check + * both timing protection before retrying. + */ +SingleFlashOperationStatus_t FD_WriteSingleData(uint32_t DestAddress, uint64_t Data); + +/** + * By default, this function is implemented weakly in flash_driver.c to return WAITED_SEM_BUSY. + * When the semaphore is busy, this will result in either FD_WriteSingleData() or FD_EraseSingleSector() + * to loop until the semaphore is free. + * + * This function may be implemented so that when using either an OS or the UTIL_SEQ_WaitEvt() API from the sequencer, + * it could possible to run other tasks or enter idle mode until the waited semaphore is free. + * This function shall not take the waited semaphore but just return when it is free. + * + * @param WaitedSemId: The semaphore ID this function should not return until it is free + * @retval: WAITED_SEM_BUSY -> The function returned before waiting for the semaphore to be free. This will exit the loop + * from either FD_EraseSingleSector() or FD_WriteSingleData() and the number of actions left to + * be processed are reported to the user + * WAITED_SEM_FREE -> The semaphore has been checked as free. Both FD_EraseSingleSector() and FD_WriteSingleData() + * try again to process one more time the flash. + */ +WaitedSemStatus_t FD_WaitForSemAvailable(WaitedSemId_t WaitedSemId); + +#ifdef __cplusplus +} +#endif + +#endif /*FLASH_DRIVER_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h new file mode 100644 index 00000000000000..5a866b3edf7fbe --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h @@ -0,0 +1,116 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file flash_wb.h + * @author MCD Application Team + * @brief Header file for flash_wb.c + ****************************************************************************** + * @attention + * + * Copyright (c) 2023 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef FLASH_NVM_H +#define FLASH_NVM_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + NVM_OK, + NVM_KEY_NOT_FOUND, + NVM_WRITE_FAILED, + NVM_READ_FAILED, + NVM_DELETE_FAILED, + NVM_SIZE_FULL, + NVM_BLOCK_SIZE_OVERFLOW, + NVM_ERROR_BLOCK_ALIGN, + NVM_FLASH_CORRUPTION, + NVM_BUFFER_TOO_SMALL +} NVM_StatusTypeDef; + +typedef enum +{ + SECTOR_DEFAULT = 0, + SECTOR_NO_SECURE, + SECTOR_SECURE + +} NVM_Sector; + +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief Copy Flash to RAM NVM + */ + +void NM_Init(void); + +/** + * @brief Copy RAM NVM to Flash + */ +NVM_StatusTypeDef NM_Dump(void); + +/** + * @brief check the nvm if it s corrupted or not + * @retval return NVM_OK if nvm is empty or NVM_FLASH_CORRUPTION if it s not empty + */ +NVM_StatusTypeDef NM_Check_Validity(void); + +/** + * @brief Get KeyName in RAM NVM and return the value of Key in KeyValue + * + * @param KeyValue: Address of the buffer changed in this function if the key found + * @param KeyName: Name of Key needed + * @param KeySize: size of KeyValue + * @param read_by_size: return size of KeyValue found + * @retval return state of function + */ +NVM_StatusTypeDef NM_GetKeyValue(void * KeyValue, const char * KeyName, uint32_t KeySize, size_t * read_by_size, NVM_Sector sector); + +/** + * @brief Set KeyName and value in RAM NVM + * + * @param KeyValue: Address of the buffer + * @param KeyName: Name of Key needed + * @param KeyAddr: TODO DELETED this param + * @param KeySize: size of KeyValue + * @param read_by_size: return size of KeyValue found + * @retval return state of function + */ + +NVM_StatusTypeDef NM_SetKeyValue(char * KeyValue, char * KeyName, uint32_t KeySize, NVM_Sector sector); + +/** + * @brief Delete Key in RAM NVM + * @param KeyName: Name of Key needed + * @retval return state of function + */ + +NVM_StatusTypeDef NM_DeleteKey(const char * Keyname, NVM_Sector sector); + +/** + * @brief Erase all persistent and reboot program + */ + +void NM_ResetFactory(void); +void NM_FullErase(void); + +#ifdef __cplusplus +} +#endif + +#endif /*FLASH_NVM_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h new file mode 100644 index 00000000000000..109084d298637f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h @@ -0,0 +1,255 @@ +/** + ****************************************************************************** + * @file hw_conf.h + * @author MCD Application Team + * @brief Configuration of hardware interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __HW_CONF_H +#define __HW_CONF_H + +/****************************************************************************** + * Semaphores + * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+ + *****************************************************************************/ +/** + * Index of the semaphore used by CPU2 to prevent the CPU1 to either write or erase data in flash + * The CPU1 shall not either write or erase in flash when this semaphore is taken by the CPU2 + * When the CPU1 needs to either write or erase in flash, it shall first get the semaphore and release it just + * after writing a raw (64bits data) or erasing one sector. + * On v1.4.0 and older CPU2 wireless firmware, this semaphore is unused and CPU2 is using PES bit. + * By default, CPU2 is using the PES bit to protect its timing. The CPU1 may request the CPU2 to use the semaphore + * instead of the PES bit by sending the system command SHCI_C2_SetFlashActivityControl() + */ +#define CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID 7 + +/** + * Index of the semaphore used by CPU1 to prevent the CPU2 to either write or erase data in flash + * In order to protect its timing, the CPU1 may get this semaphore to prevent the CPU2 to either + * write or erase in flash (as this will stall both CPUs) + * The PES bit shall not be used as this may stall the CPU2 in some cases. + */ +#define CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID 6 + +/** + * Index of the semaphore used to manage the CLK48 clock configuration + * When the USB is required, this semaphore shall be taken before configuring te CLK48 for USB + * and should be released after the application switch OFF the clock when the USB is not used anymore + * When using the RNG, it is good enough to use CFG_HW_RNG_SEMID to control CLK48. + * More details in AN5289 + */ +#define CFG_HW_CLK48_CONFIG_SEMID 5 + +/* Index of the semaphore used to manage the entry Stop Mode procedure */ +#define CFG_HW_ENTRY_STOP_MODE_SEMID 4 + +/* Index of the semaphore used to access the RCC */ +#define CFG_HW_RCC_SEMID 3 + +/* Index of the semaphore used to access the FLASH */ +#define CFG_HW_FLASH_SEMID 2 + +/* Index of the semaphore used to access the PKA */ +#define CFG_HW_PKA_SEMID 1 + +/* Index of the semaphore used to access the RNG */ +#define CFG_HW_RNG_SEMID 0 + +/****************************************************************************** + * HW TIMER SERVER + *****************************************************************************/ +/** + * The user may define the maximum number of virtual timers supported. + * It shall not exceed 255 + */ +#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6 + +/** + * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the + * wakeup timer. + * This setting is the preemptpriority part of the NVIC. + */ +#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3 + +/** + * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the + * wakeup timer. + * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported + * on the CPU, the setting is ignored + */ +#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0 + +/** + * Define a critical section in the Timer server + * The Timer server does not support the API to be nested + * The Application shall either: + * a) Ensure this will never happen + * b) Define the critical section + * The default implementations is masking all interrupts using the PRIMASK bit + * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro + * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set + * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI + * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall + * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer + * API are called when the TIMER critical section is entered + */ +#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1 + +/** + * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt + * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in + * number of RTCCLK ticks. + * A relaxed timing would be 10ms + * When the value is too short, the timerserver will not be able to count properly and all timeout may be random. + * When the value is too long, the device may wake up more often than the most optimal configuration. However, the + * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly + * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system + * as this will have marginal impact on low power mode + */ +#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY (10 * (LSI_VALUE / 1000)) + +/** + * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler + * It shall be type of IRQn_Type + */ +#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn + +/****************************************************************************** + * HW UART + *****************************************************************************/ +/* For release: set to 1 CFG_HW_LPUART1_ENABLED and CFG_HW_LPUART1_DMA_TX_SUPPORTED */ +#define CFG_HW_LPUART1_ENABLED 1 +#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1 + +#define CFG_HW_USART1_ENABLED 1 +#define CFG_HW_USART1_DMA_TX_SUPPORTED 1 + +/** + * LPUART1 + */ +#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F +#define CFG_HW_LPUART1_SUBPRIORITY 0 + +/** < The application shall check the selected source clock is enable */ +#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK + +#define CFG_HW_LPUART1_BAUDRATE 115200 +#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B +#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1 +#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE +#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE +#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX +#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT +#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8 + +#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_TX_PORT GPIOA +#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2 +#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL +#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_RX_PORT GPIOA +#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3 +#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL +#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_CTS_PORT GPIOA +#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_6 +#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN +#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F +#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0 + +#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE +#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE +#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX +#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_Channel4 +#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_Channel4_IRQn +#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_Channel4_IRQHandler + +/** + * UART1 + */ +#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F +#define CFG_HW_USART1_SUBPRIORITY 0 + +/** < The application shall check the selected source clock is enable */ +#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK + +#define CFG_HW_USART1_BAUDRATE 115200 +#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B +#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1 +#define CFG_HW_USART1_PARITY UART_PARITY_NONE +#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE +#define CFG_HW_USART1_MODE UART_MODE_TX_RX +#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT +#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8 + +#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define CFG_HW_USART1_TX_PORT GPIOB +#define CFG_HW_USART1_TX_PIN GPIO_PIN_6 +#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_TX_PULL GPIO_NOPULL +#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define CFG_HW_USART1_RX_PORT GPIOB +#define CFG_HW_USART1_RX_PIN GPIO_PIN_7 +#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_RX_PULL GPIO_NOPULL +#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_USART1_CTS_PORT GPIOA +#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11 +#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN +#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F +#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0 + +#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE +#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE +#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX +#define CFG_HW_USART1_TX_DMA_CHANNEL DMA2_Channel4 +#define CFG_HW_USART1_TX_DMA_IRQn DMA2_Channel4_IRQn +#define CFG_HW_USART1_DMA_TX_IRQHandler DMA2_Channel4_IRQHandler + +/****************************************************************************** + * External PA + *****************************************************************************/ +#define CFG_HW_EXTPA_ENABLED 0 + +// External PA enable pin is chosen by user +#define GPIO_EXT_PA_EN_PIN GPIO_PIN_9 +#define GPIO_EXT_PA_EN_PORT GPIOB + +// External PA TX/RX pin is fixed by the chip +#define GPIO_EXT_PA_TX_PIN GPIO_PIN_0 +#define GPIO_EXT_PA_TX_PORT GPIOB +#endif /*__HW_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h new file mode 100644 index 00000000000000..b2a79590e9238a --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h @@ -0,0 +1,251 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file hw_if.h + * @author MCD Application Team + * @brief Hardware Interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef HW_IF_H +#define HW_IF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_ll_bus.h" +#include "stm32wbxx_ll_cortex.h" +#include "stm32wbxx_ll_exti.h" +#include "stm32wbxx_ll_gpio.h" +#include "stm32wbxx_ll_hsem.h" +#include "stm32wbxx_ll_ipcc.h" +#include "stm32wbxx_ll_pwr.h" +#include "stm32wbxx_ll_rcc.h" +#include "stm32wbxx_ll_rtc.h" +#include "stm32wbxx_ll_system.h" +#include "stm32wbxx_ll_utils.h" + +#ifdef USE_STM32WBXX_USB_DONGLE +#include "stm32wbxx_usb_dongle.h" +#endif +#ifdef USE_STM32WBXX_NUCLEO +#include "stm32wbxx_nucleo.h" +#endif +#ifdef USE_X_NUCLEO_EPD +#include "x_nucleo_epd.h" +#endif +#ifdef USE_STM32WB5M_DK +#include "stm32wb5mm_dk.h" +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/****************************************************************************** + * HW UART + ******************************************************************************/ +typedef enum +{ + hw_uart1, + hw_uart2, + hw_lpuart1, +} hw_uart_id_t; + +typedef enum +{ + hw_uart_ok, + hw_uart_error, + hw_uart_busy, + hw_uart_to, +} hw_status_t; + +void HW_UART_Init(hw_uart_id_t hw_uart_id); +void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t * pData, uint16_t Size, void (*Callback)(void)); +void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t * pData, uint16_t Size, void (*Callback)(void)); +hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, uint32_t timeout); +hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*Callback)(void)); +void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id); +void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id); + +/****************************************************************************** + * HW TimerServer + ******************************************************************************/ +/* Exported types ------------------------------------------------------------*/ +/** + * This setting is used when standby mode is supported. + * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does + * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured + * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized. + */ +typedef enum +{ + hw_ts_InitMode_Full, + hw_ts_InitMode_Limited, +} HW_TS_InitMode_t; + +/** + * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However, + * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start() + * + * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs. + */ +typedef enum +{ + hw_ts_SingleShot, + hw_ts_Repeated +} HW_TS_Mode_t; + +/** + * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed + * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a + * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased + */ +typedef enum +{ + hw_ts_Successful, + hw_ts_Failed, +} HW_TS_ReturnStatus_t; + +typedef void (*HW_TS_pTimerCb_t)(void); + +/** + * @brief Initialize the timer server + * This API shall be called by the application before any timer is requested to the timer server. It + * configures the RTC module to be connected to the LSI input clock. + * + * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the + * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested + * @param hrtc: RTC Handle + * @retval None + */ +void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef * hrtc); + +/** + * @brief Interface to create a virtual timer + * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it + * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the + * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler + * which module is concerned. In return, the user gets a timer ID to handle it. + * + * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow + * identification of the requester + * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete) + * @param TimerMode: Mode of the virtual timer (Single shot or repeated) + * @param pTimerCallBack: Callback when the virtual timer expires + * @retval HW_TS_ReturnStatus_t: Return whether the creation is successful or not + */ +HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t * pTimerId, HW_TS_Mode_t TimerMode, + HW_TS_pTimerCb_t pTimerCallBack); + +/** + * @brief Stop a virtual timer + * This API may be used to stop a running timer. A timer which is stopped is move to the pending state. + * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed. + * Nothing is done when it is called to stop a timer which has been already stopped + * + * @param TimerID: Id of the timer to stop + * @retval None + */ +void HW_TS_Stop(uint8_t TimerID); + +/** + * @brief Start a virtual timer + * This API shall be used to start a timer. The timeout value is specified and may be different each time. + * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may + * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always + * stay in the running state. When the timer expires, it will be restarted with the same timeout value. + * This API shall not be called on a running timer. + * + * @param TimerID: The ID Id of the timer to start + * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000) + * @retval None + */ +void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks); + +/** + * @brief Delete a virtual timer from the list + * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from + * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the + * creation of a new timer if required and may get a different timer id + * + * @param TimerID: The ID of the timer to remove from the list + * @retval None + */ +void HW_TS_Delete(uint8_t TimerID); + +/** + * @brief Schedule the timer list on the timer interrupt handler + * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes + * care of clearing all status flag required in the RTC and EXTI peripherals + * + * @param None + * @retval None + */ +void HW_TS_RTC_Wakeup_Handler(void); + +/** + * @brief Return the number of ticks to count before the interrupt + * This API returns the number of ticks left to be counted before an interrupt is generated by the + * Timer Server. This API may be used by the application for power management optimization. When the system + * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running + * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the + * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time + * versus time in low power mode is implementation specific + * When the timer is disabled (No timer in the list), it returns 0xFFFF + * + * @param None + * @retval The number of ticks left to count + */ +uint16_t HW_TS_RTC_ReadLeftTicksToCount(void); + +/** + * @brief Notify the application that a registered timer has expired + * This API shall be implemented by the user application. + * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt + * context. The application may implement an Operating System to change the context priority where the timer + * callback may be handled. This API provides the module ID to identify which module is concerned and to allow + * sending the information to the correct task + * + * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created + * @param TimerID: The TimerID of the expired timer + * @param pTimerCallBack: The Callback associated with the timer when it has been created + * @retval None + */ +void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack); + +/** + * @brief Notify the application that the wakeupcounter has been updated + * This API should be implemented by the user application + * This API notifies the application that the counter has been updated. This is expected to be used along + * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the + * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification + * provides a way to the application to solve that race condition to reevaluate the counter value before + * entering low power mode + * + * @param None + * @retval None + */ +void HW_TS_RTC_CountUpdated_AppNot(void); + +#ifdef __cplusplus +} +#endif + +#endif /*HW_IF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h new file mode 100644 index 00000000000000..6ea2f076e6a8ae --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h @@ -0,0 +1,65 @@ +/** + ****************************************************************************** + * @file main.h + * @author MCD Application Team + * @brief Header for main.c module + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#ifdef USE_STM32WBXX_USB_DONGLE +#include "stm32wbxx_usb_dongle.h" +#endif +#ifdef USE_STM32WBXX_NUCLEO +#include "stm32wbxx_nucleo.h" +#endif +#ifdef USE_X_NUCLEO_EPD +#include "x_nucleo_epd.h" +#endif +#ifdef USE_STM32WB5M_DK +#include "./../../../../../Drivers/BSP/STM32WB5MM-DK/stm32wb5mm_dk.h" + +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported variables --------------------------------------------------------*/ +extern RTC_HandleTypeDef hrtc; /**< RTC handler declaration */ +extern RNG_HandleTypeDef hrng; + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#endif /* __MAIN_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h new file mode 100644 index 00000000000000..d6b24d42b93bc1 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h @@ -0,0 +1,63 @@ +/** + ****************************************************************************** + * @file otp.h + * @author MCD Application Team + * @brief OTP manager interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __OTP_H +#define __OTP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "utilities_common.h" + +/* Exported types ------------------------------------------------------------*/ +typedef PACKED_STRUCT +{ + uint8_t bd_address[6]; + uint8_t hse_tuning; + uint8_t id; +} +OTP_ID0_t; + +/* Exported constants --------------------------------------------------------*/ +/* External variables --------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief This API return the address (64 bits aligned) of the ID parameter in the OTP + * It returns the first ID declaration found from the higher address down to the base address + * The user shall fill the OTP from the base address to the top of the OTP so that the more recent + * declaration is returned by the API + * The OTP manager handles only 64bits parameter + * | Id | Parameter | + * | 8bits | 58bits | + * | MSB | LSB | + * + * @param id: ID of the parameter to read from OTP + * @retval Address of the ID in the OTP - returns 0 when no ID found + */ +uint8_t * OTP_Read(uint8_t id); + +#ifdef __cplusplus +} +#endif + +#endif /*__OTP_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h new file mode 100644 index 00000000000000..6c5dacb2f8c15c --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h @@ -0,0 +1,78 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32_lpm_if.h + * @brief Header for stm32_lpm_if.c module (device specific LP management) + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_LPM_IF_H +#define __STM32_LPM_IF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ + +/** + * @brief Enters Low Power Off Mode + * @param none + * @retval none + */ +void PWR_EnterOffMode(void); +/** + * @brief Exits Low Power Off Mode + * @param none + * @retval none + */ +void PWR_ExitOffMode(void); + +/** + * @brief Enters Low Power Stop Mode + * @note ARM exists the function when waking up + * @param none + * @retval none + */ +void PWR_EnterStopMode(void); +/** + * @brief Exits Low Power Stop Mode + * @note Enable the pll at 32MHz + * @param none + * @retval none + */ +void PWR_ExitStopMode(void); + +/** + * @brief Enters Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_EnterSleepMode(void); + +/** + * @brief Exits Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_ExitSleepMode(void); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32_LPM_IF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h new file mode 100644 index 00000000000000..7c387dd27e1bb8 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h @@ -0,0 +1,101 @@ +/** + ****************************************************************************** + * @file stm32wb5mm_dk_conf_template.h + * @author MCD Application Team + * @brief configuration file. + * This file should be copied to the application folder and renamed + * to stm32wb5mm_dk_conf.h + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32WB5MM_DK_CONF_H +#define STM32WB5MM_DK_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +/* Environmental Sensors usage */ +#define USE_ENV_SENSOR_HTS221_0 0U +#define USE_ENV_SENSOR_LPS22HH_0 0U + +/* Motion Sensors usage */ +#define USE_MOTION_SENSOR_ISM330DLC_0 0U +#define USE_MOTION_SENSOR_IIS2MDC_0 0U + +/* COM port usage */ +#define USE_BSP_COM_FEATURE 0U +#define USE_COM_LOG 0U + +#define USE_LCD_CTRL_SSD1315 1U +#define ENV_TEMPERATURE 0U +#define USE_MOTION_SENSOR_ISM330DHCX_0 0U +#define ENV_PRESSURE 0U +#define ENV_HUMIDITY 0U + +/* IRQ priorities */ +#define BSP_BUTTON_USERx_IT_PRIORITY 0x05UL +#define PWM_LED_CLOCK_IT_PRIORITY 0x03UL + +/* I2C3 Frequency in Hz */ +#define BUS_I2C3_FREQUENCY 100000UL /* Frequency of I2C3 = 100 KHz*/ + +/* Indicates whether or not TCXO is supported by the board + * 0: TCXO not supported + * 1: TCXO supported + */ +#define IS_TCXO_SUPPORTED 0U + +/* Indicates whether or not DCDC is supported by the board + * 0: DCDC not supported + * 1: DCDC supported + */ +#define IS_DCDC_SUPPORTED 1U + +#define STM32WB5MM_DK_I2C_Init BSP_I2C3_Init +#define STM32WB5MM_DK_I2C_DeInit BSP_I2C3_DeInit +#define STM32WB5MM_DK_I2C_ReadReg BSP_I2C3_ReadReg +#define STM32WB5MM_DK_I2C_WriteReg BSP_I2C3_WriteReg + +#define STM32WB5MM_DK_GetTick BSP_GetTick + +/*Number of millisecond of audio at each DMA interrupt*/ +#define N_MS_PER_INTERRUPT (20U) + +#define AUDIO_IN_CHANNELS 1 +#define AUDIO_IN_SAMPLING_FREQUENCY 16000 + +#define AUDIO_CHANNELS_OUT 1 +#define AUDIO_OUT_SAMPLING_FREQUENCY 16000 + +#define AUDIO_IN_BUFFER_SIZE DEFAULT_AUDIO_IN_BUFFER_SIZE + +#if (AUDIO_IN_SAMPLING_FREQUENCY == 8000) +#define MAX_DECIMATION_FACTOR 160 +#else +#define MAX_DECIMATION_FACTOR 128 +#endif + +#define MAX_MIC_FREQ 1280 /*kHz - Maximum PDM clock */ +#define MAX_AUDIO_IN_CHANNEL_NBR_PER_IF 1 /* Maximum number of microphones channels for peripheral interface */ +#define MAX_AUDIO_IN_CHANNEL_NBR_TOTAL 1 + +#ifdef __cplusplus +} +#endif + +#endif /* STM32WB5MM_DK_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h new file mode 100644 index 00000000000000..4a78560dcf6a2f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h @@ -0,0 +1,352 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +/*#define HAL_ADC_MODULE_ENABLED */ +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_COMP_MODULE_ENABLED */ +/*#define HAL_CRC_MODULE_ENABLED */ +#define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IPCC_MODULE_ENABLED +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +/*#define HAL_PCD_MODULE_ENABLED */ +/*#define HAL_PKA_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined(HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined(HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT ((uint32_t) 100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined(MSI_VALUE) +#define MSI_VALUE ((uint32_t) 4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined(HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined(LSI1_VALUE) +#define LSI1_VALUE ((uint32_t) 32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ + The real value may vary depending on the variations \ + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined(LSI2_VALUE) +#define LSI2_VALUE ((uint32_t) 32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ + The real value may vary depending on the variations \ + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined(LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined(HSI48_VALUE) +#define HSI48_VALUE ((uint32_t) 48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined(LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined(EXTERNAL_SAI1_CLOCK_VALUE) +#define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t) 2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED +#include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED +#include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED +#include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED +#include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED +#include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void) 0U : assert_failed((uint8_t *) __FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t * file, uint32_t line); +#else +#define assert_param(expr) ((void) 0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h new file mode 100644 index 00000000000000..fbba7c4af75667 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h @@ -0,0 +1,59 @@ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @author MCD Application Team + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); +void IPCC_C1_RX_IRQHandler(void); +void IPCC_C1_TX_IRQHandler(void); +void EXTI4_IRQHandler(void); +void EXTI0_IRQHandler(void); +void EXTI1_IRQHandler(void); +void USART1_IRQHandler(void); +void DMA2_Channel4_IRQHandler(void); +void CFG_HW_USART1_DMA_TX_IRQHandler(void); +void RTC_WKUP_IRQHandler(void); +void LPUART1_IRQHandler(void); +void DMA1_Channel4_IRQHandler(void); +void QUADSPI_IRQHandler(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h new file mode 100644 index 00000000000000..21400abd1df463 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h @@ -0,0 +1,71 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm_logging.h + * Description : Application header file for logging + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +#ifndef STM_LOGGING_H_ +#define STM_LOGGING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOG_LEVEL_NONE 0 /* None */ +#define LOG_LEVEL_CRIT 1U /* Critical */ +#define LOG_LEVEL_WARN 2U /* Warning */ +#define LOG_LEVEL_INFO 3U /* Info */ +#define LOG_LEVEL_DEBG 4U /* Debug */ + +#define APP_DBG_FULL(level, region, ...) \ + { \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(level, region, __VA_ARGS__); \ + } + +#define APP_DBG(...) \ + { \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__); \ + } + +/** + * This enumeration represents log regions. + * + */ +typedef enum +{ + APPLI_LOG_REGION_GENERAL = 1U, /* General */ + APPLI_LOG_REGION_OPENTHREAD_API = 2U, /* OpenThread API */ + APPLI_LOG_REGION_OT_API_LINK = 3U, /* OpenThread Link API */ + APPLI_LOG_REGION_OT_API_INSTANCE = 4U, /* OpenThread Instance API */ + APPLI_LOG_REGION_OT_API_MESSAGE = 5U /* OpenThread Message API */ +} appliLogRegion_t; + +typedef uint8_t appliLogLevel_t; + +void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char * aFormat, ...); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif /* STM_LOGGING_H_ */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h new file mode 100644 index 00000000000000..8fb35a2edc5d0f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h @@ -0,0 +1,66 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : utilities_conf.h + * Description : Configuration file for STM32 Utilities. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef UTILITIES_CONF_H +#define UTILITIES_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cmsis_compiler.h" +#include "string.h" + +/****************************************************************************** + * common + ******************************************************************************/ +#define UTILS_ENTER_CRITICAL_SECTION() \ + uint32_t primask_bit = __get_PRIMASK(); \ + __disable_irq() + +#define UTILS_EXIT_CRITICAL_SECTION() __set_PRIMASK(primask_bit) + +#define UTILS_MEMSET8(dest, value, size) memset(dest, value, size); + +/****************************************************************************** + * tiny low power manager + * (any macro that does not need to be modified can be removed) + ******************************************************************************/ +#define UTIL_LPM_INIT_CRITICAL_SECTION() +#define UTIL_LPM_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() +#define UTIL_LPM_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() + +/****************************************************************************** + * sequencer + * (any macro that does not need to be modified can be removed) + ******************************************************************************/ +#define UTIL_SEQ_INIT_CRITICAL_SECTION() +#define UTIL_SEQ_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() +#define UTIL_SEQ_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() +#define UTIL_SEQ_CONF_TASK_NBR (32) +#define UTIL_SEQ_CONF_PRIO_NBR (2) +#define UTIL_SEQ_MEMSET8(dest, value, size) UTILS_MEMSET8(dest, value, size) + +#ifdef __cplusplus +} +#endif + +#endif /*UTILITIES_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c new file mode 100644 index 00000000000000..65b870a9ba1e5e --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c @@ -0,0 +1,958 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_ble.c + * @author MCD Application Team + * @brief BLE Application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" + +#include "app_ble.h" +#include "ble.h" +#include "dbg_trace.h" +#include "tl.h" + +#include "app_matter.h" +#include "cmsis_os.h" +#include "otp.h" +#include "shci.h" +#include "stm32_lpm.h" +#include "timers.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ + +/** + * security parameters structure + */ +typedef struct _tSecurityParams +{ + /** + * IO capability of the device + */ + uint8_t ioCapability; + + /** + * Authentication requirement of the device + * Man In the Middle protection required? + */ + uint8_t mitm_mode; + + /** + * bonding mode of the device + */ + uint8_t bonding_mode; + + /** + * Flag to tell whether OOB data has + * to be used during the pairing process + */ + uint8_t OOB_Data_Present; + + /** + * OOB data to be used in the pairing process if + * OOB_Data_Present is set to TRUE + */ + uint8_t OOB_Data[16]; + + /** + * this variable indicates whether to use a fixed pin + * during the pairing process or a passkey has to be + * requested to the application during the pairing process + * 0 implies use fixed pin and 1 implies request for passkey + */ + uint8_t Use_Fixed_Pin; + + /** + * minimum encryption key size requirement + */ + uint8_t encryptionKeySizeMin; + + /** + * maximum encryption key size requirement + */ + uint8_t encryptionKeySizeMax; + + /** + * fixed pin to be used in the pairing process if + * Use_Fixed_Pin is set to 1 + */ + uint32_t Fixed_Pin; + + /** + * this flag indicates whether the host has to initiate + * the security, wait for pairing or does not have any security + * requirements.\n + * 0x00 : no security required + * 0x01 : host should initiate security by sending the slave security + * request command + * 0x02 : host need not send the clave security request but it + * has to wait for paiirng to complete before doing any other + * processing + */ + uint8_t initiateSecurity; +} tSecurityParams; + +/** + * global context + * contains the variables common to all + * services + */ +typedef struct _tBLEProfileGlobalContext +{ + + /** + * security requirements of the host + */ + tSecurityParams bleSecurityParam; + + /** + * gap service handle + */ + uint16_t gapServiceHandle; + + /** + * device name characteristic handle + */ + uint16_t devNameCharHandle; + + /** + * appearance characteristic handle + */ + uint16_t appearanceCharHandle; + + /** + * connection handle of the current active connection + * When not in connection, the handle is set to 0xFFFF + */ + uint16_t connectionHandle; + + /** + * length of the UUID list to be used while advertising + */ + uint8_t advtServUUIDlen; + + /** + * the UUID list to be used while advertising + */ + uint8_t advtServUUID[100]; + +} BleGlobalContext_t; + +typedef struct +{ + BleGlobalContext_t BleApplicationContext_legacy; + APP_BLE_ConnStatus_t Device_Connection_Status; + /** + * ID of the Advertising Timeout + */ + uint8_t Advertising_mgr_timer_Id; + + uint8_t SwitchOffGPIO_timer_Id; +} BleApplicationContext_t; +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +#define APPBLE_GAP_DEVICE_NAME_LENGTH 7 +#define FAST_ADV_TIMEOUT (30 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 30s */ +#define INITIAL_ADV_TIMEOUT (60 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 60s */ + +#define BD_ADDR_SIZE_LOCAL 6 + +/* USER CODE BEGIN PD */ +#define LED_ON_TIMEOUT (0.005 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 5ms */ +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +osMutexId_t MtxHciId; +osSemaphoreId_t SemHciId; +osThreadId_t HciUserEvtProcessId; +// FreeeRTOS sw timer +TimerHandle_t sbleWorkaroundAdvTimeoutTimer; + +const osThreadAttr_t HciUserEvtProcess_attr = { .name = CFG_HCI_USER_EVT_PROCESS_NAME, + .attr_bits = CFG_HCI_USER_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_HCI_USER_EVT_PROCESS_CB_MEM, + .cb_size = CFG_HCI_USER_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_HCI_USER_EVT_PROCESS_STACK_MEM, + .priority = CFG_HCI_USER_EVT_PROCESS_PRIORITY, + .stack_size = CFG_HCI_USER_EVT_PROCESS_STACK_SIZE }; + +/* Private variables ---------------------------------------------------------*/ +PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer; + +static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] = { + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000000000FF)), (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00000000FF00) >> 8), + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x000000FF0000) >> 16), (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000FF000000) >> 24), + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00FF00000000) >> 32), (uint8_t)((CFG_ADV_BD_ADDRESS & 0xFF0000000000) >> 40) +}; +static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL]; + +/** + * Identity root key used to derive LTK and CSRK + */ +static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK; + +/** + * Encryption root key used to derive LTK and CSRK + */ +static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK; + +PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicationContext; +PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax; + +MATTER_App_Notification_evt_t handleNotification; + +#if L2CAP_REQUEST_NEW_CONN_PARAM != 0 +#define SIZE_TAB_CONN_INT 2 +float tab_conn_interval[SIZE_TAB_CONN_INT] = { 50, 1000 }; /* ms */ +uint8_t index_con_int, mutex; +#endif + +/** + * Advertising Data + */ +static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'S', 'T', 'D', 'K', 'M', 'A', 'T', 'T', 'E', 'R' }; +uint8_t manuf_data[15] = { + 0x02, 0x01, 0x06, 0x0B, 0x16, 0xF6, 0xFF, 0x00, 0x00, 0x0F, 0xF1, 0xFF, 0x04, 0x80, 0x00, +}; + +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +static void BLE_UserEvtRx(void * pPayload); +static void BLE_StatusNot(HCI_TL_CmdStatus_t status); +static void Ble_Tl_Init(void); +static void Ble_Hci_Gap_Gatt_Init(void); +static const uint8_t * BleGetBdAddress(void); +static void Switch_OFF_GPIO(void); +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) +static void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle); +#endif +static void HciUserEvtProcess(void * argument); +void BleAdvWorkaroundTimeoutHandler(TimerHandle_t xTimer); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Functions Definition ------------------------------------------------------*/ +void APP_BLE_Init_Dyn_1(void) +{ + /* USER CODE BEGIN APP_BLE_Init_1 */ + + /* USER CODE END APP_BLE_Init_1 */ + SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet = { { { 0, 0, 0 } }, /**< Header unused */ + { 0, /** pBleBufferAddress not used */ + 0, /** BleBufferSize not used */ + CFG_BLE_NUM_GATT_ATTRIBUTES, + CFG_BLE_NUM_GATT_SERVICES, + CFG_BLE_ATT_VALUE_ARRAY_SIZE, + CFG_BLE_NUM_LINK, + CFG_BLE_DATA_LENGTH_EXTENSION, + CFG_BLE_PREPARE_WRITE_LIST_SIZE, + CFG_BLE_MBLOCK_COUNT, + CFG_BLE_MAX_ATT_MTU, + CFG_BLE_SLAVE_SCA, + CFG_BLE_MASTER_SCA, + CFG_BLE_LSE_SOURCE, + CFG_BLE_MAX_CONN_EVENT_LENGTH, + CFG_BLE_HSE_STARTUP_TIME, + CFG_BLE_VITERBI_MODE, + CFG_BLE_OPTIONS, + 0, + CFG_BLE_MAX_COC_INITIATOR_NBR, + CFG_BLE_MIN_TX_POWER, + CFG_BLE_MAX_TX_POWER } }; + + /** + * Initialize Ble Transport Layer + */ + Ble_Tl_Init(); + + /** + * Do not allow standby in the application + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE); + + MtxHciId = osMutexNew(NULL); + SemHciId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + /** + * Register the hci transport layer to handle BLE User Asynchronous Events + */ + HciUserEvtProcessId = osThreadNew(HciUserEvtProcess, NULL, &HciUserEvtProcess_attr); + + /** + * Starts the BLE Stack on CPU2 + */ + SHCI_C2_BLE_Init(&ble_init_cmd_packet); + + /** + * Initialization of HCI & GATT & GAP layer + */ + Ble_Hci_Gap_Gatt_Init(); + + /** + * Initialization of the BLE Services + */ + SVCCTL_Init(); + + /** + * Initialization of the BLE App Context + */ + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0xFFFF; + /** + * Initialization of ADV - Ad Manufacturer Element - Support OTA Bit Mask + */ + +#if (RADIO_ACTIVITY_EVENT != 0) + aci_hal_set_radio_activity_mask(0x0006); +#endif + +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) + index_con_int = 0; + mutex = 1; +#endif + /** + * Initialize P2P Server Application + */ + APP_MATTER_Init(); + + /** + * Create timer to handle the Led Switch OFF + */ + HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(BleApplicationContext.SwitchOffGPIO_timer_Id), hw_ts_SingleShot, Switch_OFF_GPIO); +} + +void APP_BLE_Init_Dyn_2(void) +{ + /** + * Make device discoverable + */ + BleApplicationContext.BleApplicationContext_legacy.advtServUUID[0] = NULL; + BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen = 0; + /* Initialize intervals for reconnexion without intervals update */ + AdvIntervalMin = CFG_FAST_CONN_ADV_INTERVAL_MIN; + AdvIntervalMax = CFG_FAST_CONN_ADV_INTERVAL_MAX; + + /* USER CODE BEGIN APP_BLE_Init_2 */ + + /* USER CODE END APP_BLE_Init_2 */ +} + +void APP_BLE_Init_Dyn_3(void) +{ + + sbleWorkaroundAdvTimeoutTimer = xTimerCreate("BleAdvWorkaroundTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(2000), // == default timer period (mS) + 0, // no timer reload (==one-shot) + NULL, // init timer id = ble obj context + BleAdvWorkaroundTimeoutHandler // timer callback handler + ); + if (xTimerStart(sbleWorkaroundAdvTimeoutTimer, 0) != pdPASS) + { + /* The timer could not be set into the Active + state. */ + } + APP_BLE_Adv_Request(APP_BLE_FAST_ADV); +} + +SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void * pckt) +{ + hci_event_pckt * event_pckt; + evt_le_meta_event * meta_evt; + event_pckt = (hci_event_pckt *) ((hci_uart_pckt *) pckt)->data; + + switch (event_pckt->evt) + { + case HCI_DISCONNECTION_COMPLETE_EVT_CODE: { + hci_disconnection_complete_event_rp0 * disconnection_complete_event; + disconnection_complete_event = (hci_disconnection_complete_event_rp0 *) event_pckt->data; + + if (disconnection_complete_event->Connection_Handle == BleApplicationContext.BleApplicationContext_legacy.connectionHandle) + { + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0; + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH CLIENT \n"); + } + /* + * SPECIFIC to P2P Server APP + */ + handleNotification.P2P_Evt_Opcode = MATTER_STM_PEER_DISCON_HANDLE_EVT; + handleNotification.ConnectionHandle = disconnection_complete_event->Connection_Handle; + APP_MATTER_Notification(&handleNotification); + + /* USER CODE BEGIN EVT_DISCONN_COMPLETE */ + + /* USER CODE END EVT_DISCONN_COMPLETE */ + } + + break; /* EVT_DISCONN_COMPLETE */ + + case HCI_LE_META_EVT_CODE: { + meta_evt = (evt_le_meta_event *) event_pckt->data; + /* USER CODE BEGIN EVT_LE_META_EVENT */ + + /* USER CODE END EVT_LE_META_EVENT */ + switch (meta_evt->subevent) + { + case HCI_LE_CONNECTION_UPDATE_COMPLETE_SUBEVT_CODE: + APP_DBG_MSG("\r\n\r** CONNECTION UPDATE EVENT WITH CLIENT \n"); + + /** + * The connection is done, there is no need anymore to schedule the LP ADV + */ + break; + case HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE: { + hci_le_connection_complete_event_rp0 * connection_complete_event; + + /** + * The connection is done, there is no need anymore to schedule the LP ADV + */ + connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data; + + // HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id); + + APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n", connection_complete_event->Connection_Handle); + + if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING) + { + /* Connection as client */ + BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT; + } + else + { + /* Connection as server */ + BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER; + } + + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = connection_complete_event->Connection_Handle; + + /** SPECIFIC to P2P Server APP*/ + hci_le_set_data_length(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 251, 2120); + handleNotification.P2P_Evt_Opcode = MATTER_STM_PEER_CONN_HANDLE_EVT; + handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle; + APP_MATTER_Notification(&handleNotification); + /**/ + /* USER CODE END HCI_EVT_LE_CONN_COMPLETE */ + } + break; /* HCI_EVT_LE_CONN_COMPLETE */ + + default: + /* USER CODE BEGIN SUBEVENT_DEFAULT */ + /* USER CODE END SUBEVENT_DEFAULT */ + break; + } + } + break; /* HCI_EVT_LE_META_EVENT */ + default: + /* USER CODE BEGIN ECODE_DEFAULT*/ + + /* USER CODE END ECODE_DEFAULT*/ + break; + } + + return (SVCCTL_UserEvtFlowEnable); +} + +APP_BLE_ConnStatus_t APP_BLE_Get_Server_Connection_Status(void) +{ + return BleApplicationContext.Device_Connection_Status; +} + +void APP_BLE_Key_Button2_Action(void) +{ +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) + if (BleApplicationContext.Device_Connection_Status != APP_BLE_FAST_ADV && + BleApplicationContext.Device_Connection_Status != APP_BLE_IDLE) + { + BLE_SVC_L2CAP_Conn_Update(BleApplicationContext.BleApplicationContext_legacy.connectionHandle); + } + return; +#endif +} + +void APP_BLE_Key_Button3_Action(void) {} + +void APP_BLE_Stop(void) +{ + /* Stop Advertising Timer */ + // HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id); + // HW_TS_Delete(BleApplicationContext.Advertising_mgr_timer_Id); + /* BLE STOP Procedure */ + aci_hal_stack_reset(); +} +/* USER CODE END FD*/ +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Ble_Tl_Init(void) +{ + HCI_TL_HciInitConf_t Hci_Tl_Init_Conf; + + Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t *) &BleCmdBuffer; + Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot; + hci_init(BLE_UserEvtRx, (void *) &Hci_Tl_Init_Conf); + + return; +} + +static void Ble_Hci_Gap_Gatt_Init(void) +{ + + uint8_t role; + uint8_t index; + uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle; + const uint8_t * bd_addr; + uint32_t srd_bd_addr[2]; + uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE }; + + /** + * Initialize HCI layer + */ + /*HCI Reset to synchronise BLE Stack*/ + hci_reset(); + + /** + * Write the BD Address + */ + + bd_addr = BleGetBdAddress(); + aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET, CONFIG_DATA_PUBADDR_LEN, (uint8_t *) bd_addr); + + /* BLE MAC in ADV Packet */ + // manuf_data[ sizeof(manuf_data)-6] = bd_addr[5]; + // manuf_data[ sizeof(manuf_data)-5] = bd_addr[4]; + // manuf_data[ sizeof(manuf_data)-4] = bd_addr[3]; + // manuf_data[ sizeof(manuf_data)-3] = bd_addr[2]; + // manuf_data[ sizeof(manuf_data)-2] = bd_addr[1]; + // manuf_data[ sizeof(manuf_data)-1] = bd_addr[0]; + // + /** + * Static random Address + * The two upper bits shall be set to 1 + * The lowest 32bits is read from the UDN to differentiate between devices + * The RNG may be used to provide a random number on each power on + */ + srd_bd_addr[1] = 0x0000ED6E; + srd_bd_addr[0] = LL_FLASH_GetUDN(); + aci_hal_write_config_data(CONFIG_DATA_RANDOM_ADDRESS_OFFSET, CONFIG_DATA_RANDOM_ADDRESS_LEN, (uint8_t *) srd_bd_addr); + + /** + * Write Identity root key used to derive LTK and CSRK + */ + aci_hal_write_config_data(CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t *) BLE_CFG_IR_VALUE); + + /** + * Write Encryption root key used to derive LTK and CSRK + */ + aci_hal_write_config_data(CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t *) BLE_CFG_ER_VALUE); + + /** + * Set TX Power to 0dBm. + */ + aci_hal_set_tx_power_level(1, CFG_TX_POWER); + + /** + * Initialize GATT interface + */ + aci_gatt_init(); + + /** + * Initialize GAP interface + */ + role = 0; + +#if (BLE_CFG_PERIPHERAL == 1) + role |= GAP_PERIPHERAL_ROLE; +#endif + +#if (BLE_CFG_CENTRAL == 1) + role |= GAP_CENTRAL_ROLE; +#endif + + if (role > 0) + { + const char * name = "STM32WB"; + aci_gap_init(role, 0, APPBLE_GAP_DEVICE_NAME_LENGTH, &gap_service_handle, &gap_dev_name_char_handle, + &gap_appearance_char_handle); + + if (aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, strlen(name), (uint8_t *) name)) + { + BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n"); + } + } + + if (aci_gatt_update_char_value(gap_service_handle, gap_appearance_char_handle, 0, 2, (uint8_t *) &appearance)) + { + BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n"); + } + /** + * Initialize Default PHY + */ + hci_le_set_default_phy(ALL_PHYS_PREFERENCE, TX_2M_PREFERRED, RX_2M_PREFERRED); + + /** + * Initialize IO capability + */ + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY; + aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability); + + /** + * Initialize authentication + */ + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 111111; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 1; + for (index = 0; index < 16; index++) + { + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index; + } + + aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode, 1, 0, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin, 0); + + /** + * Initialize whitelist + */ + if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode) + { + aci_gap_configure_whitelist(); + } +} + +void APP_BLE_Adv_Request(APP_BLE_ConnStatus_t New_Status) +{ + tBleStatus ret = BLE_STATUS_INVALID_PARAMS; + uint16_t Min_Inter, Max_Inter; + + if (New_Status == APP_BLE_FAST_ADV) + { + Min_Inter = AdvIntervalMin; + Max_Inter = AdvIntervalMax; + } + else + { + Min_Inter = CFG_LP_CONN_ADV_INTERVAL_MIN; + Max_Inter = CFG_LP_CONN_ADV_INTERVAL_MAX; + } + + APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status); + + if ((New_Status == APP_BLE_LP_ADV) && + ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV) || + (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV))) + { + /* Connection in ADVERTISE mode have to stop the current advertising */ + ret = aci_gap_set_non_discoverable(); + if (ret == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG("Successfully Stopped Advertising"); + } + else + { + APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret); + } + } + + BleApplicationContext.Device_Connection_Status = New_Status; + /* Start Fast or Low Power Advertising */ + ret = aci_gap_set_discoverable(ADV_IND, Min_Inter, Max_Inter, GAP_PUBLIC_ADDR, NO_WHITE_LIST_USE, /* use white list */ + sizeof(local_name), (uint8_t *) &local_name, + BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen, + BleApplicationContext.BleApplicationContext_legacy.advtServUUID, 0, 0); + /* Update Advertising data */ + ret = aci_gap_update_adv_data(sizeof(manuf_data), (uint8_t *) manuf_data); + + APP_DBG_MSG("check set discoverable , result: %d \n", ret); + if (ret == BLE_STATUS_SUCCESS) + { + if (New_Status == APP_BLE_FAST_ADV) + { + APP_DBG_MSG("Successfully Start Fast Advertising \n"); + } + else + { + APP_DBG_MSG("Successfully Start Low Power Advertising \n"); + } + } + else + { + if (New_Status == APP_BLE_FAST_ADV) + { + APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret); + } + else + { + APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret); + } + } + + return; +} + +const uint8_t * BleGetBdAddress(void) +{ + uint8_t * otp_addr; + const uint8_t * bd_addr; + uint32_t udn; + uint32_t company_id; + uint32_t device_id; + + udn = LL_FLASH_GetUDN(); + + if (udn != 0xFFFFFFFF) + { + company_id = LL_FLASH_GetSTCompanyID(); + device_id = LL_FLASH_GetDeviceID(); + + /** + * Public Address with the ST company ID + * bit[47:24] : 24bits (OUI) equal to the company ID + * bit[23:16] : Device ID. + * bit[15:0] : The last 16bits from the UDN + * Note: In order to use the Public Address in a final product, a dedicated + * 24bits company ID (OUI) shall be bought. + */ + bd_addr_udn[0] = (uint8_t)(udn & 0x000000FF); + bd_addr_udn[1] = (uint8_t)((udn & 0x0000FF00) >> 8); + bd_addr_udn[2] = (uint8_t) device_id; + bd_addr_udn[3] = (uint8_t)(company_id & 0x000000FF); + ; + bd_addr_udn[4] = (uint8_t)((company_id & 0x0000FF00) >> 8); + bd_addr_udn[5] = (uint8_t)((company_id & 0x00FF0000) >> 16); + + bd_addr = (const uint8_t *) bd_addr_udn; + } + else + { + otp_addr = OTP_Read(0); + if (otp_addr) + { + bd_addr = ((OTP_ID0_t *) otp_addr)->bd_address; + } + else + { + bd_addr = M_bd_addr; + } + } + + return bd_addr; +} + +/* USER CODE BEGIN FD_LOCAL_FUNCTION */ + +/* USER CODE END FD_LOCAL_FUNCTION */ + +/************************************************************* + * + *SPECIFIC FUNCTIONS FOR P2P SERVER + * + *************************************************************/ +void BleAdvWorkaroundTimeoutHandler(TimerHandle_t xTimer) +{ + APP_BLE_Adv_Cancel(); +} + +void APP_BLE_Adv_Cancel(void) +{ + /* USER CODE BEGIN Adv_Cancel_1 */ + // BSP_LED_Off(LED_GREEN); + /* USER CODE END Adv_Cancel_1 */ + + if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_SERVER) + + { + + tBleStatus result = 0x00; + + result = aci_gap_set_non_discoverable(); + + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + if (result == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG(" \r\n\r"); + APP_DBG_MSG("** STOP ADVERTISING ** \r\n\r"); + } + else + { + APP_DBG_MSG("** STOP ADVERTISING ** Failed \r\n\r"); + } + } + + /* USER CODE BEGIN Adv_Cancel_2 */ + + /* USER CODE END Adv_Cancel_2 */ + return; +} + +static void Switch_OFF_GPIO() +{ + /* USER CODE BEGIN Switch_OFF_GPIO */ + // BSP_LED_Off(LED_GREEN); + /* USER CODE END Switch_OFF_GPIO */ +} + +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) +void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle) +{ + /* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_1 */ + + /* USER CODE END BLE_SVC_L2CAP_Conn_Update_1 */ + if (mutex == 1) + { + mutex = 0; + index_con_int = (index_con_int + 1) % SIZE_TAB_CONN_INT; + uint16_t interval_min = CONN_P(tab_conn_interval[index_con_int]); + uint16_t interval_max = CONN_P(tab_conn_interval[index_con_int]); + uint16_t slave_latency = L2CAP_SLAVE_LATENCY; + uint16_t timeout_multiplier = L2CAP_TIMEOUT_MULTIPLIER; + tBleStatus result; + + result = aci_l2cap_connection_parameter_update_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, + interval_min, interval_max, slave_latency, timeout_multiplier); + if (result == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Successfully \r\n\r"); + } + else + { + APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Failed \r\n\r"); + } + } + /* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_2 */ + + /* USER CODE END BLE_SVC_L2CAP_Conn_Update_2 */ + return; +} +#endif + +/* USER CODE BEGIN FD_SPECIFIC_FUNCTIONS */ + +/* USER CODE END FD_SPECIFIC_FUNCTIONS */ +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ + +static void HciUserEvtProcess(void * argument) +{ + UNUSED(argument); + + for (;;) + { + osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + hci_user_evt_proc(); + } +} + +void hci_notify_asynch_evt(void * pdata) +{ + osThreadFlagsSet(HciUserEvtProcessId, 1); + return; +} + +void hci_cmd_resp_release(uint32_t flag) +{ + osSemaphoreRelease(SemHciId); + return; +} + +void hci_cmd_resp_wait(uint32_t timeout) +{ + osSemaphoreAcquire(SemHciId, osWaitForever); + return; +} + +static void BLE_UserEvtRx(void * pPayload) +{ + SVCCTL_UserEvtFlowStatus_t svctl_return_status; + tHCI_UserEvtRxParam * pParam; + + pParam = (tHCI_UserEvtRxParam *) pPayload; + + svctl_return_status = SVCCTL_UserEvtRx((void *) &(pParam->pckt->evtserial)); + if (svctl_return_status != SVCCTL_UserEvtFlowDisable) + { + pParam->status = HCI_TL_UserEventFlow_Enable; + } + else + { + pParam->status = HCI_TL_UserEventFlow_Disable; + } +} + +static void BLE_StatusNot(HCI_TL_CmdStatus_t status) +{ + switch (status) + { + case HCI_TL_CmdBusy: + /** + * All tasks that may send an aci/hci commands shall be listed here + * This is to prevent a new command is sent while one is already pending + */ + osMutexAcquire(MtxHciId, osWaitForever); + + break; + + case HCI_TL_CmdAvailable: + /** + * All tasks that may send an aci/hci commands shall be listed here + * This is to prevent a new command is sent while one is already pending + */ + osMutexRelease(MtxHciId); + + break; + + default: + break; + } + return; +} + +void SVCCTL_ResumeUserEventFlow(void) +{ + hci_resume_flow(); + return; +} + +/* USER CODE BEGIN FD_WRAP_FUNCTIONS */ + +/* USER CODE END FD_WRAP_FUNCTIONS */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h new file mode 100644 index 00000000000000..cb0b80a25628f6 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h @@ -0,0 +1,88 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_ble.h + * @author MCD Application Team + * @brief Header for ble application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_BLE_H +#define APP_BLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "hci_tl.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + APP_BLE_IDLE, + APP_BLE_FAST_ADV, + APP_BLE_LP_ADV, + APP_BLE_SCAN, + APP_BLE_LP_CONNECTING, + APP_BLE_CONNECTED_SERVER, + APP_BLE_CONNECTED_CLIENT +} APP_BLE_ConnStatus_t; + +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ---------------------------------------------*/ +void APP_BLE_Init_Dyn_1(void); +void APP_BLE_Init_Dyn_2(void); +void APP_BLE_Init_Dyn_3(void); + +APP_BLE_ConnStatus_t APP_BLE_Get_Server_Connection_Status(void); + +/* USER CODE BEGIN EF */ +void APP_BLE_Key_Button1_Action(void); +void APP_BLE_Key_Button2_Action(void); +void APP_BLE_Key_Button3_Action(void); +void APP_BLE_Stop(void); +void APP_BLE_Adv_Request(APP_BLE_ConnStatus_t New_Status); +void APP_BLE_Adv_Cancel(void); +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*APP_BLE_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c new file mode 100644 index 00000000000000..49881b1bcfa2df --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c @@ -0,0 +1,236 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_matter.c + * @author MCD Application Team + * @brief matter application to handle ble between matter api and stm32 world + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_matter.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_entry.h" +#include "ble.h" +#include "cmsis_os.h" +#include "custom_stm.h" +#include "dbg_trace.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ +typedef struct +{ + uint8_t Device_Led_Selection; + uint8_t Led1; +} P2P_LedCharValue_t; + +typedef struct +{ + uint8_t Device_Button_Selection; + uint8_t ButtonStatus; +} P2P_ButtonCharValue_t; + +typedef struct +{ + uint8_t Notification_Status; /* used to check if P2P Server is enabled to Notify */ + P2P_LedCharValue_t LedControl; + P2P_ButtonCharValue_t ButtonControl; + uint16_t ConnectionHandle; +} P2P_Server_App_Context_t; +/* USER CODE END PTD */ + +/* Private defines ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macros -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ +/** + * START of Section BLE_APP_CONTEXT + */ + +PLACE_IN_SECTION("BLE_APP_CONTEXT") static P2P_Server_App_Context_t P2P_Server_App_Context; + +BLEReceiveCallback BLEReceiveCb = NULL; +BLETXCharCCCDWriteCallback BLETXCharCCCDWriteCb = NULL; +BLEConnectionCallback BLEConnectionCb = NULL; +BLEDisconnectionCallback BLEDisconnectionCb = NULL; +BLEDAckCallback BLEAckCb = NULL; + +/** + * END of Section BLE_APP_CONTEXT + */ +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ +/* USER CODE END PFP */ + +void APP_MATTER_BLE_Set_Receive_Callback(BLEReceiveCallback aCallback) +{ + BLEReceiveCb = aCallback; +} + +void APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(BLETXCharCCCDWriteCallback aCallback) +{ + BLETXCharCCCDWriteCb = aCallback; +} + +void APP_MATTER_BLE_Set_Connection_Callback(BLEConnectionCallback aCallback) +{ + BLEConnectionCb = aCallback; +} + +void APP_MATTER_BLE_Set_Disconnection_Callback(BLEDisconnectionCallback aCallback) +{ + BLEDisconnectionCb = aCallback; +} + +void APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(BLEDAckCallback aCallback) +{ + BLEAckCb = aCallback; +} + +/* Functions Definition ------------------------------------------------------*/ +void APP_MATTER_Notification(MATTER_App_Notification_evt_t * pNotification) +{ + /* USER CODE BEGIN APP_MATTER_Notification */ + BLE_Matter_TXCharCCCD message; + /* USER CODE END APP_MATTER_Notification */ + switch (pNotification->P2P_Evt_Opcode) + { + /* USER CODE BEGIN APP_MATTER_Notification */ + /* USER CODE END APP_MATTER_Notification */ + + case MATTER_STM_PEER_CONN_HANDLE_EVT: + /* USER CODE BEGIN PEER_CONN_HANDLE_EVT */ + BLEConnectionCb(); + /* USER CODE END PEER_CONN_HANDLE_EVT */ + break; + + case MATTER_STM_PEER_DISCON_HANDLE_EVT: + /* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */ + BLEDisconnectionCb(&pNotification->ConnectionHandle); + /* USER CODE END PEER_DISCON_HANDLE_EVT */ + break; + + case MATTER_STM_ACK_INDICATE_EVT: + /* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */ + BLEAckCb(&pNotification->ConnectionHandle); + /* USER CODE END PEER_DISCON_HANDLE_EVT */ + break; + + case MATTER_STM_INDICATE_ENABLED_EVT: + /* USER CODE BEGIN P2PS_STM__NOTIFY_ENABLED_EVT */ + message.connid = pNotification->ConnectionHandle; + message.notif = 1; + P2P_Server_App_Context.Notification_Status = 1; + APP_DBG_MSG("-- Matter APPLICATION SERVER : INDICATE ENABLED\n"); + APP_DBG_MSG(" \n\r"); + BLETXCharCCCDWriteCb(&message); + /* USER CODE END P2PS_STM__NOTIFY_ENABLED_EVT */ + break; + + case MATTER_STM_INDICATE_DISABLED_EVT: + /* USER CODE BEGIN P2PS_STM_NOTIFY_DISABLED_EVT */ + message.connid = pNotification->ConnectionHandle; + message.notif = 0; + P2P_Server_App_Context.Notification_Status = 0; + APP_DBG_MSG("-- Matter APPLICATION SERVER : INDICATE DISABLED\n"); + APP_DBG_MSG(" \n\r"); + BLETXCharCCCDWriteCb(&message); + /* USER CODE END P2PS_STM_NOTIFY_DISABLED_EVT */ + break; + + case MATTER_STM_WRITE_EVT:; + BLE_Matter_RX Message; + Message.Length = pNotification->DataTransfered.Length; + Message.Payload = pNotification->DataTransfered.pPayload; + Message.connid = pNotification->ConnectionHandle; + BLEReceiveCb(&Message); // call matter callback + /* USER CODE BEGIN MATTER_STM_WRITE_EVT */ + + /* USER CODE END MATTER_STM_WRITE_EVT */ + break; + + default: + /* USER CODE BEGIN APP_MATTER_Notification */ + + /* USER CODE END APP_MATTER_Notification */ + break; + } + /* USER CODE BEGIN APP_MATTER_Notification */ + + /* USER CODE END APP_MATTER_Notification */ + return; +} + +void APP_MATTER_Init(void) +{ + /* USER CODE BEGIN APP_MATTER_Init */ + + /** + * Initialize LedButton Service + */ + P2P_Server_App_Context.Notification_Status = 0; + /* USER CODE END APP_MATTER_Init */ + return; +} + +/* USER CODE END FD */ + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +/* USER CODE BEGIN FD_LOCAL_FUNCTIONS*/ +void APP_MATTER_Send_Notification(uint16_t datalength, uint8_t * data) +{ + + if (P2P_Server_App_Context.ButtonControl.ButtonStatus == 0x00) + { + P2P_Server_App_Context.ButtonControl.ButtonStatus = 0x01; + } + else + { + P2P_Server_App_Context.ButtonControl.ButtonStatus = 0x00; + } + + if (P2P_Server_App_Context.Notification_Status) + { + CUSTOM_STM_App_Update_Char(P2P_NOTIFY_CHAR_UUID, (uint8_t *) data, datalength); + } + else + { + APP_DBG_MSG("-- Matter APPLICATION SERVER : CAN'T INFORM CLIENT - NOTIFICATION DISABLED\n "); + } + + return; +} + +/* USER CODE END FD_LOCAL_FUNCTIONS*/ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h new file mode 100644 index 00000000000000..c3dccc8e142133 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h @@ -0,0 +1,116 @@ +/* USER CODE BEGIN */ +/** + ****************************************************************************** + * File Name : App/app_matter.h + * Description : Header for p2p_server_app.c module + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_MATTER_H +#define __APP_MATTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ + +typedef enum +{ + MATTER_STM_PEER_CONN_HANDLE_EVT, + MATTER_STM_PEER_DISCON_HANDLE_EVT, + MATTER_STM_ACK_INDICATE_EVT, + MATTER_STM_INDICATE_ENABLED_EVT, + MATTER_STM_INDICATE_DISABLED_EVT, + MATTER_STM_READ_EVT, + MATTER_STM_WRITE_EVT, + MATTER_STM_BOOT_REQUEST_EVT, +} MATTER_STM_Opcode_evt_t; + +typedef struct +{ + uint8_t * pPayload; + uint8_t Length; +} MATTER_STM_Data_t; + +typedef struct +{ + MATTER_STM_Opcode_evt_t P2P_Evt_Opcode; + MATTER_STM_Data_t DataTransfered; + uint16_t ConnectionHandle; + uint8_t ServiceInstance; +} MATTER_App_Notification_evt_t; + +typedef struct +{ + uint8_t * Payload; + uint16_t Length; + uint16_t connid; +} BLE_Matter_RX; + +typedef struct +{ + uint16_t connid; + uint8_t notif; +} BLE_Matter_TXCharCCCD; + +typedef void (*BLEReceiveCallback)(BLE_Matter_RX * aMessage); +typedef void (*BLETXCharCCCDWriteCallback)(BLE_Matter_TXCharCCCD * aMessage); +typedef void (*BLEConnectionCallback)(void); +typedef void (*BLEDisconnectionCallback)(uint16_t * connid); +typedef void (*BLEDAckCallback)(uint16_t * connid); + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ---------------------------------------------*/ +/* USER CODE BEGIN EF */ +void APP_MATTER_Init(void); +void APP_MATTER_Send_Notification(uint16_t datalength, uint8_t * data); +void APP_MATTER_Notification(MATTER_App_Notification_evt_t * pNotification); + +void APP_MATTER_BLE_Set_Connection_Callback(BLEConnectionCallback aCallback); +void APP_MATTER_BLE_Set_Disconnection_Callback(BLEDisconnectionCallback aCallback); +void APP_MATTER_BLE_Set_Receive_Callback(BLEReceiveCallback aCallback); +void APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(BLETXCharCCCDWriteCallback aCallback); +void APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(BLEDAckCallback aCallback); +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*__APP_MATTER_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c new file mode 100644 index 00000000000000..f917b8542fc4bf --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c @@ -0,0 +1,665 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : App/app_thread.c + * Description : Thread Application. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_thread.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_entry.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "openthread_api_wb.h" +#include "queue.h" +#include "shci.h" +#include "stm32_lpm.h" +#include "stm32wbxx_core_interface_def.h" +#include "stm_logging.h" +#include "utilities_common.h" + +/* Private includes -----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +#define C_SIZE_CMD_STRING 256U +#define MO_NOTIF_QUEUE_SIZE 10 + +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +static osSemaphoreId_t TransferToM0Semaphore; +static osMutexId_t MtxThreadId; + +/* FreeRtos stacks attributes */ +const osThreadAttr_t ThreadMsgM0ToM4Process_attr = { .name = CFG_THREAD_MSG_M0_TO_M4_PROCESS_NAME, + .attr_bits = CFG_THREAD_MSG_M0_TO_M4_PROCESS_ATTR_BITS, + .cb_mem = CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_MEM, + .cb_size = CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_SIZE, + .stack_mem = CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_MEM, + .priority = CFG_THREAD_MSG_M0_TO_M4_PROCESS_PRIORITY, + .stack_size = CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_SIZE }; + +const osThreadAttr_t ThreadCliProcess_attr = { .name = CFG_THREAD_CLI_PROCESS_NAME, + .attr_bits = CFG_THREAD_CLI_PROCESS_ATTR_BITS, + .cb_mem = CFG_THREAD_CLI_PROCESS_CB_MEM, + .cb_size = CFG_THREAD_CLI_PROCESS_CB_SIZE, + .stack_mem = CFG_THREAD_CLI_PROCESS_STACK_MEM, + .priority = CFG_THREAD_CLI_PROCESS_PRIORITY, + .stack_size = CFG_THREAD_CLI_PROCESS_STACK_SIZE }; + +static volatile int FlagReceiveAckFromM0 = 0; +/* Private macros ------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private function prototypes -----------------------------------------------*/ +static void APP_THREAD_CheckWirelessFirmwareInfo(void); +static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode); +#if (CFG_FULL_LOW_POWER == 0) +static void Send_CLI_To_M0(void); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +static void Send_CLI_Ack_For_OT(void); +static void HostTxCb(void); +static void Wait_Getting_Ack_From_M0(void); +static void Receive_Ack_From_M0(void); +static void Receive_Notification_From_M0(void); +static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void * argument); +static void Ot_Cmd_Transfer_Common(void); +#if (CFG_FULL_LOW_POWER == 0) +static void APP_THREAD_FreeRTOSSendCLIToM0Task(void * argument); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +#if (CFG_FULL_LOW_POWER == 0) +static void RxCpltCallback(void); +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/* USER CODE BEGIN PFP */ +/* USER CODE END PFP */ + +/* Private variables ---------------------------------------------------------*/ +#if (CFG_FULL_LOW_POWER == 0) +static uint8_t aRxBuffer[C_SIZE_CMD_STRING]; +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) +static uint8_t CommandString[C_SIZE_CMD_STRING]; +#endif /* (CFG_FULL_LOW_POWER == 0) */ +static __IO uint16_t indexReceiveChar = 0; +static __IO uint16_t CptReceiveCmdFromUser = 0; + +static TL_CmdPacket_t * p_thread_otcmdbuffer; +static TL_EvtPacket_t * p_thread_notif_M0_to_M4; +PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_TH_Config_t ThreadConfigBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadOtCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliNotBuffer; +extern uint8_t g_ot_notification_allowed; + +/* USER CODE BEGIN PV */ +static QueueHandle_t MoNotifQueue; +static osThreadId_t OsTaskMsgM0ToM4Id; /* Task managing the M0 to M4 messaging */ +#if (CFG_FULL_LOW_POWER == 0) +static osThreadId_t OsTaskCliId; /* Task used to manage CLI command */ +#endif /* (CFG_FULL_LOW_POWER == 0) */ +/* Debug */ +/* USER CODE END PV */ + +/* Functions Definition ------------------------------------------------------*/ + +void APP_THREAD_Init(void) +{ + /* USER CODE BEGIN APP_THREAD_INIT_1 */ + /* Do not allow stop mode before Thread is initialized */ + UTIL_LPM_SetStopMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE); + /* USER CODE END APP_THREAD_INIT_1 */ + + SHCI_CmdStatus_t ThreadInitStatus; + + /* Check the compatibility with the Coprocessor Wireless Firmware loaded */ + APP_THREAD_CheckWirelessFirmwareInfo(); + + /* Register cmdbuffer */ + APP_THREAD_RegisterCmdBuffer(&ThreadOtCmdBuffer); + + /** + * Do not allow standby in the application + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE); + + /* Init config buffer and call TL_THREAD_Init */ + APP_THREAD_TL_THREAD_INIT(); + + /* Configure UART for sending CLI command from M4 */ + // APP_THREAD_Init_UART_CLI(); Conflict with qspi gpio + /* Send Thread start system cmd to M0 */ + ThreadInitStatus = SHCI_C2_THREAD_Init(); + + /* Prevent unused argument(s) compilation warning */ + UNUSED(ThreadInitStatus); + + /* Semaphore */ + TransferToM0Semaphore = osSemaphoreNew(1, 0, NULL); + /* Initialize the mutex */ + MtxThreadId = osMutexNew(NULL); + + MoNotifQueue = xQueueCreate(MO_NOTIF_QUEUE_SIZE, sizeof(uint8_t)); + if (MoNotifQueue == NULL) + { + APP_DBG("Failed to allocate M0 notification queue"); + } + + /* Create the different FreeRTOS tasks requested to run this Thread application*/ + OsTaskMsgM0ToM4Id = osThreadNew(APP_THREAD_FreeRTOSProcessMsgM0ToM4Task, NULL, &ThreadMsgM0ToM4Process_attr); + + /* USER CODE BEGIN APP_THREAD_INIT_FREERTOS */ + /* USER CODE END APP_THREAD_INIT_FREERTOS */ + /* USER CODE BEGIN APP_THREAD_INIT_2 */ + /* USER CODE END APP_THREAD_INIT_2 */ +} + +/** + * @brief Trace the error or the warning reported. + * @param ErrId : + * @param ErrCode + * @retval None + */ +void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode) +{ + /* USER CODE BEGIN APP_THREAD_Error_1 */ + + /* USER CODE END APP_THREAD_Error_1 */ + switch (ErrId) + { + case ERR_REC_MULTI_MSG_FROM_M0: + APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode); + break; + case ERR_THREAD_SET_STATE_CB: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ", ErrCode); + break; + case ERR_THREAD_SET_CHANNEL: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ", ErrCode); + break; + case ERR_THREAD_SET_PANID: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_PANID ", ErrCode); + break; + case ERR_THREAD_IPV6_ENABLE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_IPV6_ENABLE ", ErrCode); + break; + case ERR_THREAD_START: + APP_THREAD_TraceError("ERROR: ERR_THREAD_START ", ErrCode); + break; + case ERR_THREAD_ERASE_PERSISTENT_INFO: + APP_THREAD_TraceError("ERROR : ERR_THREAD_ERASE_PERSISTENT_INFO ", ErrCode); + break; + case ERR_THREAD_CHECK_WIRELESS: + APP_THREAD_TraceError("ERROR : ERR_THREAD_CHECK_WIRELESS ", ErrCode); + break; + /* USER CODE BEGIN APP_THREAD_Error_2 */ + case ERR_THREAD_COAP_START: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_START ", ErrCode); + break; + case ERR_THREAD_COAP_ADD_RESSOURCE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_ADD_RESSOURCE ", ErrCode); + break; + case ERR_THREAD_MESSAGE_READ: + APP_THREAD_TraceError("ERROR : ERR_THREAD_MESSAGE_READ ", ErrCode); + break; + case ERR_THREAD_COAP_SEND_RESPONSE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_RESPONSE ", ErrCode); + break; + case ERR_THREAD_COAP_APPEND: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_APPEND ", ErrCode); + break; + case ERR_THREAD_COAP_SEND_REQUEST: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_REQUEST ", ErrCode); + break; + case ERR_TIMER_INIT: + APP_THREAD_TraceError("ERROR : ERR_TIMER_INIT ", ErrCode); + break; + case ERR_TIMER_START: + APP_THREAD_TraceError("ERROR : ERR_TIMER_START ", ErrCode); + break; + /* USER CODE END APP_THREAD_Error_2 */ + default: + APP_THREAD_TraceError("ERROR Unknown ", 0); + break; + } +} + +/** + * @brief Perform initialization of CLI UART interface. + * @param None + * @retval None + */ +void APP_THREAD_Init_UART_CLI(void) +{ +#if (CFG_FULL_LOW_POWER == 0) + OsTaskCliId = osThreadNew(APP_THREAD_FreeRTOSSendCLIToM0Task, NULL, &ThreadCliProcess_attr); +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) + HW_UART_Init(CFG_CLI_UART); + HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +} + +/** + * @brief Perform initialization of TL for THREAD. + * @param None + * @retval None + */ +void APP_THREAD_TL_THREAD_INIT(void) +{ + ThreadConfigBuffer.p_ThreadOtCmdRspBuffer = (uint8_t *) &ThreadOtCmdBuffer; + ThreadConfigBuffer.p_ThreadNotAckBuffer = (uint8_t *) ThreadNotifRspEvtBuffer; + ThreadConfigBuffer.p_ThreadCliRspBuffer = (uint8_t *) &ThreadCliCmdBuffer; + ThreadConfigBuffer.p_ThreadCliNotBuffer = (uint8_t *) &ThreadCliNotBuffer; + + TL_THREAD_Init(&ThreadConfigBuffer); +} + +/** + * @brief This function is used to transfer the Ot commands from the + * M4 to the M0. + * + * @param None + * @return None + */ +void Ot_Cmd_Transfer(void) +{ + Ot_Cmd_Transfer_Common(); +} + +/** + * @brief This function is used to transfer the Ot commands from the + * M4 to the M0 with Notification M0 to M4 allowed. + * + * @param None + * @return None + */ +void Ot_Cmd_TransferWithNotif(void) +{ + /* Flag to specify to UTIL_SEQ_EvtIdle that M0 to M4 notifications are allowed */ + g_ot_notification_allowed = 1U; + + Ot_Cmd_Transfer_Common(); +} + +/** + * @brief This function is called when acknowledge from OT command is received from the M0+. + * + * @param Otbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_OT_CmdEvtReceived(TL_EvtPacket_t * Otbuffer) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(Otbuffer); + + Receive_Ack_From_M0(); + + /* Does not allow OpenThread M0 to M4 notification */ + g_ot_notification_allowed = 0U; +} + +/** + * @brief This function is called when notification from M0+ is received. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_THREAD_NotReceived(TL_EvtPacket_t * Notbuffer) +{ + p_thread_notif_M0_to_M4 = Notbuffer; + + Receive_Notification_From_M0(); +} + +/** + * @brief This function is called when notification on CLI TL Channel from M0+ is received. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_THREAD_CliNotReceived(TL_EvtPacket_t * Notbuffer) +{ + TL_CmdPacket_t * l_CliBuffer = (TL_CmdPacket_t *) Notbuffer; + uint8_t l_size = l_CliBuffer->cmdserial.cmd.plen; + + /* WORKAROUND: if string to output is "> " then respond directly to M0 and do not output it */ + if (strcmp((const char *) l_CliBuffer->cmdserial.cmd.payload, "> ") != 0) + { + /* Write to CLI UART */ + HW_UART_Transmit_IT(CFG_CLI_UART, l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb); + } + else + { + Send_CLI_Ack_For_OT(); + } +} + +/** + * @brief This function is called before sending any ot command to the M0 + * core. The purpose of this function is to be able to check if + * there are no notifications coming from the M0 core which are + * pending before sending a new ot command. + * @param None + * @retval None + */ +void Pre_OtCmdProcessing(void) +{ + osMutexAcquire(MtxThreadId, osWaitForever); +} + +void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer) +{ + p_thread_otcmdbuffer = p_buffer; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_OTCmdPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) p_thread_otcmdbuffer->cmdserial.cmd.payload; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_OTCmdRspPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) ((TL_EvtPacket_t *) p_thread_otcmdbuffer)->evtserial.evt.payload; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_NotificationPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) (p_thread_notif_M0_to_M4)->evtserial.evt.payload; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +/** + * @brief Warn the user that an error has occurred.In this case, + * the LEDs on the Board will start blinking. + * + * @param pMess : Message associated to the error. + * @param ErrCode: Error code associated to the module (OpenThread or other module if any) + * @retval None + */ +static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode) +{ + /* USER CODE BEGIN TRACE_ERROR */ + APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode); + while (1U == 1U) + { + HAL_Delay(500U); + } + /* USER CODE END TRACE_ERROR */ +} + +/** + * @brief Check if the Coprocessor Wireless Firmware loaded supports Thread + * and display associated information + * @param None + * @retval None + */ +static void APP_THREAD_CheckWirelessFirmwareInfo(void) +{ + WirelessFwInfo_t wireless_info_instance; + WirelessFwInfo_t * p_wireless_info = &wireless_info_instance; + + if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success) + { + APP_THREAD_Error((uint32_t) ERR_THREAD_CHECK_WIRELESS, (uint32_t) ERR_INTERFACE_FATAL); + } + else + { + APP_DBG("**********************************************************"); + APP_DBG("WIRELESS COPROCESSOR FW:"); + /* Print version */ + APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub); + + switch (p_wireless_info->StackType) + { + case INFO_STACK_TYPE_THREAD_FTD: + APP_DBG("FW Type : Thread FTD"); + break; + case INFO_STACK_TYPE_THREAD_MTD: + APP_DBG("FW Type : Thread MTD"); + break; + case INFO_STACK_TYPE_BLE_THREAD_FTD_DYAMIC: + APP_DBG("FW Type : Dynamic Concurrent Mode BLE/Thread"); + break; + // case INFO_STACK_TYPE_BLE_THREAD_FOR_MATTER: + // APP_DBG("FW Type : Dynamic Concurrent Mode BLE/Thread for Matter ") + // ; + // break; + default: + /* No Thread device supported ! */ + APP_THREAD_Error((uint32_t) ERR_THREAD_CHECK_WIRELESS, (uint32_t) ERR_INTERFACE_FATAL); + break; + } + APP_DBG("**********************************************************"); + } +} + +/************************************************************* + * + * FREERTOS WRAPPER FUNCTIONS + * + *************************************************************/ +static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void * argument) +{ + UNUSED(argument); + uint8_t NotUsed = 0; + for (;;) + { + /* USER CODE BEGIN APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_1 */ + + /* USER END END APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_1 */ + xQueueReceive(MoNotifQueue, &NotUsed, portMAX_DELAY); + + if (uxQueueMessagesWaiting(MoNotifQueue) > 1U) + { + APP_THREAD_Error(ERR_REC_MULTI_MSG_FROM_M0, 0); + } + else + { + OpenThread_CallBack_Processing(); + } + /* USER CODE BEGIN APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_2 */ + + /* USER END END APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_2 */ + } +} + +#if (CFG_FULL_LOW_POWER == 0) +static void APP_THREAD_FreeRTOSSendCLIToM0Task(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN APP_THREAD_FREERTOS_SEND_CLI_TO_M0_1 */ + + /* USER END END APP_THREAD_FREERTOS_SEND_CLI_TO_M0_1 */ + osThreadFlagsWait(1, osFlagsWaitAll, osWaitForever); + Send_CLI_To_M0(); + /* USER CODE BEGIN APP_THREAD_FREERTOS_SEND_CLI_TO_M0_2 */ + + /* USER END END APP_THREAD_FREERTOS_SEND_CLI_TO_M0_2 */ + } +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/* USER CODE BEGIN FREERTOS_WRAPPER_FUNCTIONS */ +/* USER CODE END FREERTOS_WRAPPER_FUNCTIONS */ + +/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */ + +/* USER CODE END FD_LOCAL_FUNCTIONS */ + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +static void Ot_Cmd_Transfer_Common(void) +{ + /* OpenThread OT command cmdcode range 0x280 .. 0x3DF = 352 */ + p_thread_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U; + /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes) + * + ID (4 bytes) + Size (4 bytes) */ + uint32_t l_size = ((Thread_OT_Cmd_Request_t *) (p_thread_otcmdbuffer->cmdserial.cmd.payload))->Size * 4U + 8U; + p_thread_otcmdbuffer->cmdserial.cmd.plen = l_size; + + TL_OT_SendCmd(); + + /* Wait completion of cmd */ + Wait_Getting_Ack_From_M0(); +} + +/** + * @brief This function waits for getting an acknowledgment from the M0. + * + * @param None + * @retval None + */ +static void Wait_Getting_Ack_From_M0(void) +{ + while (FlagReceiveAckFromM0 == 0) + { + } + FlagReceiveAckFromM0 = 0; + osMutexRelease(MtxThreadId); + // osSemaphoreAcquire( TransferToM0Semaphore, osWaitForever ); +} + +/** + * @brief Receive an acknowledgment from the M0+ core. + * Each command send by the M4 to the M0 are acknowledged. + * This function is called under interrupt. + * @param None + * @retval None + */ +static void Receive_Ack_From_M0(void) +{ + FlagReceiveAckFromM0 = 1; + // osSemaphoreRelease( TransferToM0Semaphore); +} + +/** + * @brief Receive a notification from the M0+ through the IPCC. + * This function is called under interrupt. + * @param None + * @retval None + */ +static void Receive_Notification_From_M0(void) +{ + /* The xHigherPriorityTaskWoken parameter must be initialized to pdFALSE as + it will get set to pdTRUE inside the interrupt safe API function if a + context switch is required. */ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + + uint8_t NotUsed = 0; + xQueueSendToFrontFromISR(MoNotifQueue, &NotUsed, &xHigherPriorityTaskWoken); + + /* Pass the xHigherPriorityTaskWoken value into portEND_SWITCHING_ISR(). If + xHigherPriorityTaskWoken was set to pdTRUE inside xSemaphoreGiveFromISR() + then calling portEND_SWITCHING_ISR() will request a context switch. If + xHigherPriorityTaskWoken is still pdFALSE then calling + portEND_SWITCHING_ISR() will have no effect */ + portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); +} + +#if (CFG_FULL_LOW_POWER == 0) +static void RxCpltCallback(void) +{ + /* Filling buffer and wait for '\r' char */ + if (indexReceiveChar < C_SIZE_CMD_STRING) + { + CommandString[indexReceiveChar++] = aRxBuffer[0]; + if (aRxBuffer[0] == '\r') + { + CptReceiveCmdFromUser = 1U; + + /* UART task scheduling*/ + osThreadFlagsSet(OsTaskCliId, 1); + } + } + + /* Once a character has been sent, put back the device in reception mode */ + HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback); +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) +/** + * @brief Process sends receive CLI command to M0. + * @param None + * @retval None + */ +static void Send_CLI_To_M0(void) +{ + memset(ThreadCliCmdBuffer.cmdserial.cmd.payload, 0x0U, 255U); + memcpy(ThreadCliCmdBuffer.cmdserial.cmd.payload, CommandString, indexReceiveChar); + ThreadCliCmdBuffer.cmdserial.cmd.plen = indexReceiveChar; + ThreadCliCmdBuffer.cmdserial.cmd.cmdcode = 0x0; + + /* Clear receive buffer, character counter and command complete */ + CptReceiveCmdFromUser = 0; + indexReceiveChar = 0; + memset(CommandString, 0, C_SIZE_CMD_STRING); + + TL_CLI_SendCmd(); +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/** + * @brief Send notification for CLI TL Channel. + * @param None + * @retval None + */ +static void Send_CLI_Ack_For_OT(void) +{ + + /* Notify M0 that characters have been sent to UART */ + TL_THREAD_CliSendAck(); +} + +/** + * @brief End of transfer callback for CLI UART sending. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +static void HostTxCb(void) +{ + Send_CLI_Ack_For_OT(); +} + +/* USER CODE BEGIN FD_WRAP_FUNCTIONS */ + +/* USER CODE END FD_WRAP_FUNCTIONS */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h new file mode 100644 index 00000000000000..512b3bcd544538 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h @@ -0,0 +1,132 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : App/app_thread.h + * Description : Header for Thread Application. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_THREAD_H +#define APP_THREAD_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Private includes ----------------------------------------------------------*/ +#include "stm32wbxx_core_interface_def.h" +#include "tl.h" +#include "tl_thread_hci.h" + +/* OpenThread Library */ +#include OPENTHREAD_CONFIG_FILE + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ + +/* Thread application generic defines */ +/*------------------------------------*/ +typedef enum +{ + APP_THREAD_LIMITED, + APP_THREAD_FULL, +} APP_THREAD_InitMode_t; + +/* ipv6-addressing defines */ +/*------------------------------------*/ +/* Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to the ff03::2 multicast address. + * MTDs do not. */ + +#define MULICAST_FTD_MED "ff03::1" +#define MULICAST_FTD_BORDER_ROUTER "ff03::2" + +/* Application errors */ +/*------------------------------------*/ + +/* + * List of all errors tracked by the Thread application + * running on M4. Some of these errors may be fatal + * or just warnings + */ +typedef enum +{ + ERR_REC_MULTI_MSG_FROM_M0, + ERR_THREAD_SET_STATE_CB, + ERR_THREAD_SET_CHANNEL, + ERR_THREAD_SET_PANID, + ERR_THREAD_IPV6_ENABLE, + ERR_THREAD_START, + ERR_THREAD_ERASE_PERSISTENT_INFO, + ERR_THREAD_SET_NETWORK_KEY, + /* USER CODE BEGIN ERROR_APPLI_ENUM */ + ERR_THREAD_COAP_START, + ERR_THREAD_COAP_ADD_RESSOURCE, + ERR_THREAD_MESSAGE_READ, + ERR_THREAD_COAP_SEND_RESPONSE, + ERR_THREAD_COAP_APPEND, + ERR_THREAD_COAP_SEND_REQUEST, + ERR_THREAD_SETUP, + ERR_THREAD_LINK_MODE, + ERR_TIMER_INIT, + ERR_TIMER_START, + ERR_THREAD_COAP_NEW_MSG, + ERR_THREAD_COAP_ADDRESS_NOT_DEFINED, + ERR_THREAD_STOP, + /* USER CODE END ERROR_APPLI_ENUM */ + ERR_THREAD_CHECK_WIRELESS +} ErrAppliIdEnum_t; +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ------------------------------------------------------- */ +void APP_THREAD_Init(void); +void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode); +void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer); +void APP_THREAD_ProcessMsgM0ToM4(void); +void APP_THREAD_Init_UART_CLI(void); +void APP_THREAD_TL_THREAD_INIT(void); +void APP_THREAD_SEND_MSG(void); +/* **** */ +void APP_THREAD_Stop(void); +void APP_THREAD_CleanCallbacks(void); + +/* USER CODE BEGIN EF */ + +/* USER CODE END EF */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* APP_THREAD_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h new file mode 100644 index 00000000000000..9cdee1a82cc217 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h @@ -0,0 +1,68 @@ +/** + ****************************************************************************** + * File Name : App/ble_conf.h + * Description : Configuration file for BLE Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef BLE_CONF_H +#define BLE_CONF_H + +#include "app_conf.h" + +/****************************************************************************** + * + * BLE SERVICES CONFIGURATION + * blesvc + * + ******************************************************************************/ + +/** + * This setting shall be set to '1' if the device needs to support the Peripheral Role + * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1' + */ +#define BLE_CFG_PERIPHERAL 1 + +/** + * This setting shall be set to '1' if the device needs to support the Central Role + * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1' + */ +#define BLE_CFG_CENTRAL 0 + +/** + * There is one handler per service enabled + * Note: There is no handler for the Device Information Service + * + * This shall take into account all registered handlers + * (from either the provided services or the custom services) + */ +#define BLE_CFG_SVC_MAX_NBR_CB 3 + +#define BLE_CFG_CLT_MAX_NBR_CB 0 + +/****************************************************************************** + * GAP Service - Appearance + ******************************************************************************/ + +#define BLE_CFG_UNKNOWN_APPEARANCE (0) +#define BLE_CFG_HR_SENSOR_APPEARANCE (832) +#define BLE_CFG_GAP_APPEARANCE (BLE_CFG_UNKNOWN_APPEARANCE) + +/****************************************************************************** + * Over The Air Feature (OTA) - STM Proprietary + ******************************************************************************/ +#define BLE_CFG_OTA_REBOOT_CHAR 0 /**< REBOOT OTA MODE CHARACTERISTIC */ + +#endif /*BLE_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h new file mode 100644 index 00000000000000..0951cc1372a405 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h @@ -0,0 +1,196 @@ +/** + ****************************************************************************** + * File Name : App/ble_dbg_conf.h + * Description : Debug configuration file for BLE Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __BLE_DBG_CONF_H +#define __BLE_DBG_CONF_H + +/** + * Enable or Disable traces from BLE + */ + +#define BLE_DBG_APP_EN 0 +#define BLE_DBG_DIS_EN 0 +#define BLE_DBG_HRS_EN 0 +#define BLE_DBG_SVCCTL_EN 0 +#define BLE_DBG_BLS_EN 0 +#define BLE_DBG_HTS_EN 0 +#define BLE_DBG_P2P_STM_EN 1 + +/** + * Macro definition + */ +#if (BLE_DBG_APP_EN != 0) +#define BLE_DBG_APP_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_APP_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_DIS_EN != 0) +#define BLE_DBG_DIS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_DIS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HRS_EN != 0) +#define BLE_DBG_HRS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HRS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_P2P_STM_EN != 0) +#define BLE_DBG_P2P_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_P2P_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_TEMPLATE_STM_EN != 0) +#define BLE_DBG_TEMPLATE_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_TEMPLATE_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_EDS_STM_EN != 0) +#define BLE_DBG_EDS_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_EDS_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LBS_STM_EN != 0) +#define BLE_DBG_LBS_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LBS_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_SVCCTL_EN != 0) +#define BLE_DBG_SVCCTL_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_SVCCTL_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_CTS_EN != 0) +#define BLE_DBG_CTS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_CTS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HIDS_EN != 0) +#define BLE_DBG_HIDS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HIDS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_PASS_EN != 0) +#define BLE_DBG_PASS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_PASS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_BLS_EN != 0) +#define BLE_DBG_BLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_BLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HTS_EN != 0) +#define BLE_DBG_HTS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HTS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_ANS_EN != 0) +#define BLE_DBG_ANS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_ANS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_ESS_EN != 0) +#define BLE_DBG_ESS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_ESS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_GLS_EN != 0) +#define BLE_DBG_GLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_GLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_BAS_EN != 0) +#define BLE_DBG_BAS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_BAS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_RTUS_EN != 0) +#define BLE_DBG_RTUS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_RTUS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HPS_EN != 0) +#define BLE_DBG_HPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_TPS_EN != 0) +#define BLE_DBG_TPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_TPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LLS_EN != 0) +#define BLE_DBG_LLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_IAS_EN != 0) +#define BLE_DBG_IAS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_IAS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_WSS_EN != 0) +#define BLE_DBG_WSS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_WSS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LNS_EN != 0) +#define BLE_DBG_LNS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LNS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_SCPS_EN != 0) +#define BLE_DBG_SCPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_SCPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_DTS_EN != 0) +#define BLE_DBG_DTS_MSG PRINT_MESG_DBG +#define BLE_DBG_DTS_BUF PRINT_LOG_BUFF_DBG +#else +#define BLE_DBG_DTS_MSG PRINT_NO_MESG +#define BLE_DBG_DTS_BUF PRINT_NO_MESG +#endif + +#endif /*__BLE_DBG_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c new file mode 100644 index 00000000000000..a4e4a492cbc360 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c @@ -0,0 +1,261 @@ +/** + ****************************************************************************** + * @file custom_stm.c + * @author MCD Application Team + * @brief matter Service using gatt(Custom STM) + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_matter.h" +#include "common_blesvc.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef struct +{ + uint16_t PeerToPeerSvcHdle; /**< Service handle */ + uint16_t P2PWriteClientToServerCharHdle; /**< Characteristic handle */ + uint16_t P2PNotifyServerToClientCharHdle; /**< Characteristic handle */ +} PeerToPeerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#define UUID_128_SUPPORTED 1 + +#if (UUID_128_SUPPORTED == 1) +#define BM_UUID_LENGTH UUID_TYPE_128 +#else +#define BM_UUID_LENGTH UUID_TYPE_16 +#endif + +#define BM_REQ_CHAR_SIZE (3) + +/* Private macros ------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ + +MATTER_App_Notification_evt_t Notification; + +/** + * START of Section BLE_DRIVER_CONTEXT + */ +PLACE_IN_SECTION("BLE_DRIVER_CONTEXT") static PeerToPeerContext_t aPeerToPeerContext; + +/** + * END of Section BLE_DRIVER_CONTEXT + */ +/* Private function prototypes -----------------------------------------------*/ +static SVCCTL_EvtAckStatus_t Matter_Event_Handler(void * Event); + +/* Functions Definition ------------------------------------------------------*/ +/* Private functions ----------------------------------------------------------*/ + +#define COPY_UUID_128(uuid_struct, uuid_15, uuid_14, uuid_13, uuid_12, uuid_11, uuid_10, uuid_9, uuid_8, uuid_7, uuid_6, uuid_5, \ + uuid_4, uuid_3, uuid_2, uuid_1, uuid_0) \ + do \ + { \ + uuid_struct[0] = uuid_0; \ + uuid_struct[1] = uuid_1; \ + uuid_struct[2] = uuid_2; \ + uuid_struct[3] = uuid_3; \ + uuid_struct[4] = uuid_4; \ + uuid_struct[5] = uuid_5; \ + uuid_struct[6] = uuid_6; \ + uuid_struct[7] = uuid_7; \ + uuid_struct[8] = uuid_8; \ + uuid_struct[9] = uuid_9; \ + uuid_struct[10] = uuid_10; \ + uuid_struct[11] = uuid_11; \ + uuid_struct[12] = uuid_12; \ + uuid_struct[13] = uuid_13; \ + uuid_struct[14] = uuid_14; \ + uuid_struct[15] = uuid_15; \ + } while (0) + +/* Hardware Characteristics Service */ + +#define MATTER_SERVICE_UUID (0xFFF6) +#define COPY_CHAR_RX_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x11) +#define COPY_CHAR_TX_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x12) +#define COPY_CHAR_ADDCOMMISSIONING_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83, 0x21, 0x8F, 0x04) + +/* Public functions ----------------------------------------------------------*/ +/** + * @brief Service initialization + * @param None + * @retval None + */ +void SVCCTL_InitCustomSvc(void) +{ + + Char_UUID_t uuid16; + + /** + * Register the event handler to the BLE controller + */ + SVCCTL_RegisterSvcHandler(Matter_Event_Handler); + + /** + * Peer To Peer Service + * + * Max_Attribute_Records = 2*no_of_char + 1 + * service_max_attribute_record = 1 for Peer To Peer service + + * 2 for P2P Write characteristic + + * 2 for P2P Notify characteristic + + * 1 for client char configuration descriptor + + * + */ + + uint16_t uuid = MATTER_SERVICE_UUID; + + aci_gatt_add_service(UUID_TYPE_16, (Service_UUID_t *) &uuid, PRIMARY_SERVICE, 8, &(aPeerToPeerContext.PeerToPeerSvcHdle)); + + /** + * Add RX Characteristic + */ + COPY_CHAR_RX_UUID(uuid16.Char_UUID_128); + aci_gatt_add_char(aPeerToPeerContext.PeerToPeerSvcHdle, UUID_TYPE_128, &uuid16, 247, CHAR_PROP_WRITE, ATTR_PERMISSION_NONE, + GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */ + 10, /* encryKeySize */ + 1, /* isVariable */ + &(aPeerToPeerContext.P2PWriteClientToServerCharHdle)); + + /** + * Add notification Characteristic + */ + + COPY_CHAR_TX_UUID(uuid16.Char_UUID_128); + aci_gatt_add_char(aPeerToPeerContext.PeerToPeerSvcHdle, UUID_TYPE_128, &uuid16, 247, CHAR_PROP_INDICATE, ATTR_PERMISSION_NONE, + GATT_NOTIFY_ATTRIBUTE_WRITE, /* gattEvtMask */ + 10, /* encryKeySize */ + 1, /* isVariable: 1 */ + &(aPeerToPeerContext.P2PNotifyServerToClientCharHdle)); + + return; +} + +/** + * @brief Characteristic update + * @param UUID: UUID of the characteristic + * @param Service_Instance: Instance of the service to which the characteristic belongs + * + */ +tBleStatus CUSTOM_STM_App_Update_Char(uint16_t UUID, uint8_t * pPayload, uint16_t Length) +{ + tBleStatus result = BLE_STATUS_INVALID_PARAMS; + switch (UUID) + { + case P2P_NOTIFY_CHAR_UUID: + + result = aci_gatt_update_char_value(aPeerToPeerContext.PeerToPeerSvcHdle, + aPeerToPeerContext.P2PNotifyServerToClientCharHdle, 0, /* charValOffset */ + Length, /* charValueLen */ + (uint8_t *) pPayload); + + break; + + default: + break; + } + + return result; +} + +/* Private functions ----------------------------------------------------------*/ + +/** + * @brief Event handler + * @param Event: Address of the buffer holding the Event + * @retval Ack: Return whether the Event has been managed or not + */ +static SVCCTL_EvtAckStatus_t Matter_Event_Handler(void * Event) +{ + SVCCTL_EvtAckStatus_t return_value; + hci_event_pckt * event_pckt; + evt_blecore_aci * blecore_evt; + aci_gatt_attribute_modified_event_rp0 * attribute_modified; + + return_value = SVCCTL_EvtNotAck; + event_pckt = (hci_event_pckt *) (((hci_uart_pckt *) Event)->data); + + switch (event_pckt->evt) + { + case HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE: { + blecore_evt = (evt_blecore_aci *) event_pckt->data; + switch (blecore_evt->ecode) + { + case ACI_GATT_SERVER_CONFIRMATION_VSEVT_CODE: { + attribute_modified = (aci_gatt_attribute_modified_event_rp0 *) blecore_evt->data; + Notification.P2P_Evt_Opcode = MATTER_STM_ACK_INDICATE_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + case ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE: { + attribute_modified = (aci_gatt_attribute_modified_event_rp0 *) blecore_evt->data; + if (attribute_modified->Attr_Handle == (aPeerToPeerContext.P2PNotifyServerToClientCharHdle + 2)) + { + /** + * Descriptor handle + */ + return_value = SVCCTL_EvtAckFlowEnable; + APP_DBG_MSG("Subscribe for c2 notification\n"); + /** + * Indicate to application + */ + if (attribute_modified->Attr_Data[0] & COMSVC_Indication) + { + Notification.P2P_Evt_Opcode = MATTER_STM_INDICATE_ENABLED_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + else + { + Notification.P2P_Evt_Opcode = MATTER_STM_INDICATE_DISABLED_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + } + + else if (attribute_modified->Attr_Handle == (aPeerToPeerContext.P2PWriteClientToServerCharHdle + 1)) + { + Notification.P2P_Evt_Opcode = MATTER_STM_WRITE_EVT; + Notification.DataTransfered.Length = attribute_modified->Attr_Data_Length; + Notification.DataTransfered.pPayload = attribute_modified->Attr_Data; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + } + break; + case ACI_GATT_WRITE_PERMIT_REQ_VSEVT_CODE: { + aci_gatt_write_permit_req_event_rp0 * write_perm_req; + write_perm_req = (aci_gatt_write_permit_req_event_rp0 *) blecore_evt->data; + aci_gatt_write_resp(write_perm_req->Connection_Handle, write_perm_req->Attribute_Handle, + 0x00, /* write_status = 0 (no error))*/ + 0x00, /* err_code */ + write_perm_req->Data_Length, (uint8_t *) &(write_perm_req->Data[0])); + } + break; + default: + break; + } + } + break; /* HCI_HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE_SPECIFIC */ + + default: + break; + } + + return (return_value); +} /* end SVCCTL_EvtAckStatus_t */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h new file mode 100644 index 00000000000000..a4627c05ae9223 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h @@ -0,0 +1,134 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file custom_stm.h + * @author MCD Application Team + * @brief Header for custom_stm.c module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef CUSTOM_STM_H +#define CUSTOM_STM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#include +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + /* My_P2P_Server */ + CUSTOM_STM_LED_C, + CUSTOM_STM_SWITCH_C, + /* My_Heart_Rate */ + CUSTOM_STM_HRS_M, + CUSTOM_STM_HRS_SL, + CUSTOM_STM_HRS_CTRLP, +} Custom_STM_Char_Opcode_t; + +typedef enum +{ + /* My_LED_Char */ + CUSTOM_STM_LED_C_READ_EVT, + CUSTOM_STM_LED_C_WRITE_NO_RESP_EVT, + /* My_Switch_Char */ + CUSTOM_STM_SWITCH_C_NOTIFY_ENABLED_EVT, + CUSTOM_STM_SWITCH_C_NOTIFY_DISABLED_EVT, + /* My_HRS_Meas */ + CUSTOM_STM_HRS_M_NOTIFY_ENABLED_EVT, + CUSTOM_STM_HRS_M_NOTIFY_DISABLED_EVT, + /* My_Sensor_Loc */ + CUSTOM_STM_HRS_SL_READ_EVT, + /* My_HRS_CTRL_Point */ + CUSTOM_STM_HRS_CTRLP_WRITE_EVT, + + CUSTOM_STM_BOOT_REQUEST_EVT +} Custom_STM_Opcode_evt_t; + +typedef struct +{ + uint8_t * pPayload; + uint8_t Length; +} Custom_STM_Data_t; + +typedef struct +{ + Custom_STM_Opcode_evt_t Custom_Evt_Opcode; + Custom_STM_Data_t DataTransfered; + uint16_t ConnectionHandle; + uint8_t ServiceInstance; +} Custom_STM_App_Notification_evt_t; + +/* USER CODE BEGIN ET */ +typedef enum +{ + CUSTOM_STM_HRS_HRM_VALUE_FORMAT_UINT16 = 1, + CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_PRESENT = 2, + CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_SUPPORTED = 4, + CUSTOM_STM_HRS_HRM_ENERGY_EXPENDED_PRESENT = 8, + CUSTOM_STM_HRS_HRM_RR_INTERVAL_PRESENT = 0x10 +} Custom_STM_HRS_HrmFlags_t; + +typedef enum +{ + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_OTHER = 0, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_CHEST = 1, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_WRIST = 2, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FINGER = 3, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_HAND = 4, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_EAR_LOBE = 5, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FOOT = 6 +} Custom_STM_HRS_BodySensorLocation_t; + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +extern uint8_t SizeLed_C; +extern uint8_t SizeSwitch_C; +extern uint8_t SizeHrs_M; +extern uint8_t SizeHrs_Sl; +extern uint8_t SizeHrs_Ctrlp; + +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros -----------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ------------------------------------------------------- */ +void SVCCTL_InitCustomSvc(void); +tBleStatus CUSTOM_STM_App_Update_Char(uint16_t UUID, uint8_t * pPayload, uint16_t Length); +/* USER CODE BEGIN EF */ + +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*CUSTOM_STM_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h new file mode 100644 index 00000000000000..4a56cfea5fc562 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h @@ -0,0 +1,123 @@ +/** + ****************************************************************************** + * File Name : tl_dbg_conf.h + * Description : Debug configuration file for stm32wpan transport layer interface. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TL_DBG_CONF_H +#define __TL_DBG_CONF_H + +/* USER CODE BEGIN Tl_Conf */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_conf.h" /* required as some configuration used in dbg_trace.h are set there */ +#include "dbg_trace.h" +#include "hw_if.h" + +/** + * Enable or Disable traces + * The raw data output is the hci binary packet format as specified by the BT specification * + */ +#define TL_SHCI_CMD_DBG_EN 0 /* Reports System commands sent to CPU2 and the command response */ +#define TL_SHCI_CMD_DBG_RAW_EN 0 /* Reports raw data System commands sent to CPU2 and the command response */ +#define TL_SHCI_EVT_DBG_EN 0 /* Reports System Asynchronous Events received from CPU2 */ +#define TL_SHCI_EVT_DBG_RAW_EN 0 /* Reports raw data System Asynchronous Events received from CPU2 */ + +#define TL_HCI_CMD_DBG_EN 0 /* Reports BLE command sent to CPU2 and the command response */ +#define TL_HCI_CMD_DBG_RAW_EN 0 /* Reports raw data BLE command sent to CPU2 and the command response */ +#define TL_HCI_EVT_DBG_EN 0 /* Reports BLE Asynchronous Events received from CPU2 */ +#define TL_HCI_EVT_DBG_RAW_EN 0 /* Reports raw data BLE Asynchronous Events received from CPU2 */ + +#define TL_MM_DBG_EN 0 /* Reports the information of the buffer released to CPU2 */ + +/** + * Macro definition + */ + +/** + * System Transport Layer + */ +#if (TL_SHCI_CMD_DBG_EN != 0) +#define TL_SHCI_CMD_DBG_MSG PRINT_MESG_DBG +#define TL_SHCI_CMD_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_SHCI_CMD_DBG_MSG(...) +#define TL_SHCI_CMD_DBG_BUF(...) +#endif + +#if (TL_SHCI_CMD_DBG_RAW_EN != 0) +#define TL_SHCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_SHCI_CMD_DBG_RAW(...) +#endif + +#if (TL_SHCI_EVT_DBG_EN != 0) +#define TL_SHCI_EVT_DBG_MSG PRINT_MESG_DBG +#define TL_SHCI_EVT_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_SHCI_EVT_DBG_MSG(...) +#define TL_SHCI_EVT_DBG_BUF(...) +#endif + +#if (TL_SHCI_EVT_DBG_RAW_EN != 0) +#define TL_SHCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_SHCI_EVT_DBG_RAW(...) +#endif + +/** + * BLE Transport Layer + */ +#if (TL_HCI_CMD_DBG_EN != 0) +#define TL_HCI_CMD_DBG_MSG PRINT_MESG_DBG +#define TL_HCI_CMD_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_HCI_CMD_DBG_MSG(...) +#define TL_HCI_CMD_DBG_BUF(...) +#endif + +#if (TL_HCI_CMD_DBG_RAW_EN != 0) +#define TL_HCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_HCI_CMD_DBG_RAW(...) +#endif + +#if (TL_HCI_EVT_DBG_EN != 0) +#define TL_HCI_EVT_DBG_MSG PRINT_MESG_DBG +#define TL_HCI_EVT_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_HCI_EVT_DBG_MSG(...) +#define TL_HCI_EVT_DBG_BUF(...) +#endif + +#if (TL_HCI_EVT_DBG_RAW_EN != 0) +#define TL_HCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_HCI_EVT_DBG_RAW(...) +#endif + +/** + * Memory Manager - Released buffer tracing + */ +#if (TL_MM_DBG_EN != 0) +#define TL_MM_DBG_MSG PRINT_MESG_DBG +#else +#define TL_MM_DBG_MSG(...) +#endif + +/* USER CODE END Tl_Conf */ + +#endif /*__TL_DBG_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c new file mode 100644 index 00000000000000..7e1f5d5d43348f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c @@ -0,0 +1,667 @@ +/** + ****************************************************************************** + * File Name : Target/hw_ipcc.c + * Description : Hardware IPCC source file for STM32WPAN Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "mbox_def.h" + +/* Global variables ---------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +#define HW_IPCC_TX_PENDING(channel) (!(LL_C1_IPCC_IsActiveFlag_CHx(IPCC, channel))) && (((~(IPCC->C1MR)) & (channel << 16U))) +#define HW_IPCC_RX_PENDING(channel) (LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel)) && (((~(IPCC->C1MR)) & (channel << 0U))) + +/* Private macros ------------------------------------------------------------*/ +/* Private typedef -----------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +static void (*FreeBufCb)(void); + +/* Private function prototypes -----------------------------------------------*/ +static void HW_IPCC_BLE_EvtHandler(void); +static void HW_IPCC_BLE_AclDataEvtHandler(void); +static void HW_IPCC_MM_FreeBufHandler(void); +static void HW_IPCC_SYS_CmdEvtHandler(void); +static void HW_IPCC_SYS_EvtHandler(void); +static void HW_IPCC_TRACES_EvtHandler(void); + +#ifdef THREAD_WB +static void HW_IPCC_OT_CmdEvtHandler(void); +static void HW_IPCC_THREAD_NotEvtHandler(void); +static void HW_IPCC_THREAD_CliNotEvtHandler(void); +#endif + +#ifdef LLD_TESTS_WB +static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler(void); +static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(void); +#endif +#ifdef LLD_BLE_WB +/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void );*/ +static void HW_IPCC_LLD_BLE_ReceiveRspHandler(void); +static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(void); +#endif + +#ifdef MAC_802_15_4_WB +static void HW_IPCC_MAC_802_15_4_CmdEvtHandler(void); +static void HW_IPCC_MAC_802_15_4_NotEvtHandler(void); +#endif + +#ifdef ZIGBEE_WB +static void HW_IPCC_ZIGBEE_CmdEvtHandler(void); +static void HW_IPCC_ZIGBEE_StackNotifEvtHandler(void); +static void HW_IPCC_ZIGBEE_StackM0RequestHandler(void); +#endif + +/* Public function definition -----------------------------------------------*/ + +/****************************************************************************** + * INTERRUPT HANDLER + ******************************************************************************/ +void HW_IPCC_Rx_Handler(void) +{ + if (HW_IPCC_RX_PENDING(HW_IPCC_SYSTEM_EVENT_CHANNEL)) + { + HW_IPCC_SYS_EvtHandler(); + } +#ifdef MAC_802_15_4_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_MAC_802_15_4_NotEvtHandler(); + } +#endif /* MAC_802_15_4_WB */ +#ifdef THREAD_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_THREAD_NotEvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_THREAD_CliNotEvtHandler(); + } +#endif /* THREAD_WB */ +#ifdef LLD_TESTS_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL)) + { + HW_IPCC_LLDTESTS_ReceiveCliRspHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLDTESTS_M0_CMD_CHANNEL)) + { + HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(); + } +#endif /* LLD_TESTS_WB */ +#ifdef LLD_BLE_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLD_BLE_RSP_CHANNEL)) + { + HW_IPCC_LLD_BLE_ReceiveRspHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLD_BLE_M0_CMD_CHANNEL)) + { + HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(); + } +#endif /* LLD_TESTS_WB */ +#ifdef ZIGBEE_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL)) + { + HW_IPCC_ZIGBEE_StackNotifEvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL)) + { + HW_IPCC_ZIGBEE_StackM0RequestHandler(); + } +#endif /* ZIGBEE_WB */ + else if (HW_IPCC_RX_PENDING(HW_IPCC_BLE_EVENT_CHANNEL)) + { + HW_IPCC_BLE_EvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_TRACES_CHANNEL)) + { + HW_IPCC_TRACES_EvtHandler(); + } + + return; +} + +void HW_IPCC_Tx_Handler(void) +{ + if (HW_IPCC_TX_PENDING(HW_IPCC_SYSTEM_CMD_RSP_CHANNEL)) + { + HW_IPCC_SYS_CmdEvtHandler(); + } +#ifdef MAC_802_15_4_WB + else if (HW_IPCC_TX_PENDING(HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL)) + { + HW_IPCC_MAC_802_15_4_CmdEvtHandler(); + } +#endif /* MAC_802_15_4_WB */ +#ifdef THREAD_WB + else if (HW_IPCC_TX_PENDING(HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL)) + { + HW_IPCC_OT_CmdEvtHandler(); + } +#endif /* THREAD_WB */ +#ifdef LLD_TESTS_WB +// No TX handler for LLD tests +#endif /* LLD_TESTS_WB */ +#ifdef ZIGBEE_WB + if (HW_IPCC_TX_PENDING(HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL)) + { + HW_IPCC_ZIGBEE_CmdEvtHandler(); + } +#endif /* ZIGBEE_WB */ + + else if (HW_IPCC_TX_PENDING(HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) + { + HW_IPCC_MM_FreeBufHandler(); + } + else if (HW_IPCC_TX_PENDING(HW_IPCC_HCI_ACL_DATA_CHANNEL)) + { + HW_IPCC_BLE_AclDataEvtHandler(); + } + + return; +} +/****************************************************************************** + * GENERAL + ******************************************************************************/ +void HW_IPCC_Enable(void) +{ + /** + * Such as IPCC IP available to the CPU2, it is required to keep the IPCC clock running + when FUS is running on CPU2 and CPU1 enters deep sleep mode + */ + LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_IPCC); + + /** + * When the device is out of standby, it is required to use the EXTI mechanism to wakeup CPU2 + */ + LL_C2_EXTI_EnableEvent_32_63(LL_EXTI_LINE_41); + LL_EXTI_EnableRisingTrig_32_63(LL_EXTI_LINE_41); + + /** + * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2. + * In that case, to keep the mechanism transparent to the user application, it shall call the system command + * SHCI_C2_Reinit( ) before jumping to the application. + * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware. + * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect. + * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect + * So, by default, the application shall both set the event flag and set the C2BOOT bit. + */ + __SEV(); /* Set the internal event flag and send an event to the CPU2 */ + __WFE(); /* Clear the internal event flag */ + LL_PWR_EnableBootC2(); + + return; +} + +void HW_IPCC_Init(void) +{ + LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC); + + LL_C1_IPCC_EnableIT_RXO(IPCC); + LL_C1_IPCC_EnableIT_TXF(IPCC); + + HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn); + + return; +} + +/****************************************************************************** + * BLE + ******************************************************************************/ +void HW_IPCC_BLE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_BLE_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_BLE_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_BLE_CMD_CHANNEL); + + return; +} + +static void HW_IPCC_BLE_EvtHandler(void) +{ + HW_IPCC_BLE_RxEvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_BLE_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_BLE_SendAclData(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + + return; +} + +static void HW_IPCC_BLE_AclDataEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + + HW_IPCC_BLE_AclDataAckNot(); + + return; +} + +__weak void HW_IPCC_BLE_AclDataAckNot(void){}; +__weak void HW_IPCC_BLE_RxEvtNot(void){}; + +/****************************************************************************** + * SYSTEM + ******************************************************************************/ +void HW_IPCC_SYS_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_SYS_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + + return; +} + +static void HW_IPCC_SYS_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + + HW_IPCC_SYS_CmdEvtNot(); + + return; +} + +static void HW_IPCC_SYS_EvtHandler(void) +{ + HW_IPCC_SYS_EvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL); + + return; +} + +__weak void HW_IPCC_SYS_CmdEvtNot(void){}; +__weak void HW_IPCC_SYS_EvtNot(void){}; + +/****************************************************************************** + * MAC 802.15.4 + ******************************************************************************/ +#ifdef MAC_802_15_4_WB +void HW_IPCC_MAC_802_15_4_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_MAC_802_15_4_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + + return; +} + +void HW_IPCC_MAC_802_15_4_SendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_MAC_802_15_4_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + + HW_IPCC_MAC_802_15_4_CmdEvtNot(); + + return; +} + +static void HW_IPCC_MAC_802_15_4_NotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_MAC_802_15_4_EvtNot(); + + return; +} +__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot(void){}; +__weak void HW_IPCC_MAC_802_15_4_EvtNot(void){}; +#endif + +/****************************************************************************** + * THREAD + ******************************************************************************/ +#ifdef THREAD_WB +void HW_IPCC_THREAD_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_OT_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + + return; +} + +void HW_IPCC_CLI_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL); + + return; +} + +void HW_IPCC_THREAD_SendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_THREAD_CliSendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_OT_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + + HW_IPCC_OT_CmdEvtNot(); + + return; +} + +static void HW_IPCC_THREAD_NotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_THREAD_EvtNot(); + + return; +} + +static void HW_IPCC_THREAD_CliNotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_THREAD_CliEvtNot(); + + return; +} + +__weak void HW_IPCC_OT_CmdEvtNot(void){}; +__weak void HW_IPCC_CLI_CmdEvtNot(void){}; +__weak void HW_IPCC_THREAD_EvtNot(void){}; + +#endif /* THREAD_WB */ + +/****************************************************************************** + * LLD TESTS + ******************************************************************************/ +#ifdef LLD_TESTS_WB +void HW_IPCC_LLDTESTS_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + return; +} + +void HW_IPCC_LLDTESTS_SendCliCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL); + return; +} + +static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + HW_IPCC_LLDTESTS_ReceiveCliRsp(); + return; +} + +void HW_IPCC_LLDTESTS_SendCliRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + return; +} + +static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + HW_IPCC_LLDTESTS_ReceiveM0Cmd(); + return; +} + +void HW_IPCC_LLDTESTS_SendM0CmdAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + return; +} +__weak void HW_IPCC_LLDTESTS_ReceiveCliRsp(void){}; +__weak void HW_IPCC_LLDTESTS_ReceiveM0Cmd(void){}; +#endif /* LLD_TESTS_WB */ + +/****************************************************************************** + * LLD BLE + ******************************************************************************/ +#ifdef LLD_BLE_WB +void HW_IPCC_LLD_BLE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL); + return; +} + +void HW_IPCC_LLD_BLE_SendCliCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CLI_CMD_CHANNEL); + return; +} + +/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void ) +{ + LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL ); + HW_IPCC_LLD_BLE_ReceiveCliRsp(); + return; +}*/ + +void HW_IPCC_LLD_BLE_SendCliRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL); + return; +} + +static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(void) +{ + // LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL ); + HW_IPCC_LLD_BLE_ReceiveM0Cmd(); + return; +} + +void HW_IPCC_LLD_BLE_SendM0CmdAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL); + // LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL ); + return; +} +__weak void HW_IPCC_LLD_BLE_ReceiveCliRsp(void){}; +__weak void HW_IPCC_LLD_BLE_ReceiveM0Cmd(void){}; + +/* Transparent Mode */ +void HW_IPCC_LLD_BLE_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CMD_CHANNEL); + return; +} + +static void HW_IPCC_LLD_BLE_ReceiveRspHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + HW_IPCC_LLD_BLE_ReceiveRsp(); + return; +} + +void HW_IPCC_LLD_BLE_SendRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + return; +} + +#endif /* LLD_BLE_WB */ + +/****************************************************************************** + * ZIGBEE + ******************************************************************************/ +#ifdef ZIGBEE_WB +void HW_IPCC_ZIGBEE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4RequestToM0(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4AckToM0Notify(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_ZIGBEE_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + + HW_IPCC_ZIGBEE_RecvAppliAckFromM0(); + + return; +} + +static void HW_IPCC_ZIGBEE_StackNotifEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + + HW_IPCC_ZIGBEE_RecvM0NotifyToM4(); + + return; +} + +static void HW_IPCC_ZIGBEE_StackM0RequestHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + HW_IPCC_ZIGBEE_RecvM0RequestToM4(); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4AckToM0Request(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + return; +} + +__weak void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void){}; +__weak void HW_IPCC_ZIGBEE_RecvM0NotifyToM4(void){}; +__weak void HW_IPCC_ZIGBEE_RecvM0RequestToM4(void){}; +#endif /* ZIGBEE_WB */ + +/****************************************************************************** + * MEMORY MANAGER + ******************************************************************************/ +void HW_IPCC_MM_SendFreeBuf(void (*cb)(void)) +{ + if (LL_C1_IPCC_IsActiveFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) + { + FreeBufCb = cb; + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + } + else + { + cb(); + + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + } + + return; +} + +static void HW_IPCC_MM_FreeBufHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + + FreeBufCb(); + + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + + return; +} + +/****************************************************************************** + * TRACES + ******************************************************************************/ +void HW_IPCC_TRACES_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_TRACES_CHANNEL); + + return; +} + +static void HW_IPCC_TRACES_EvtHandler(void) +{ + HW_IPCC_TRACES_EvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_TRACES_CHANNEL); + + return; +} + +__weak void HW_IPCC_TRACES_EvtNot(void){}; diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp b/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp new file mode 100644 index 00000000000000..4d828c6cd4ffee --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp @@ -0,0 +1,583 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : app_entry.c + * Description : Entry application source file for STM32WPAN Middleware. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_entry.h" +#include "app_ble.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "hw_conf.h" +#include "main.h" +#include "shci.h" +#include "shci_tl.h" +#include "ssd1315.h" +#include "stm32_lcd.h" +#include "stm32_lpm.h" +#include "stm32wb5mm_dk_lcd.h" +#include "stm_logging.h" + +#include "AppTask.h" +/* Private includes -----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +/* POOL_SIZE = 2(TL_PacketHeader_t) + 258 (3(TL_EVT_HDR_SIZE) + 255(Payload size)) */ +#define POOL_SIZE (CFG_TLBLE_EVT_QUEUE_LENGTH * 4 * DIVC((sizeof(TL_PacketHeader_t) + TL_BLE_EVENT_FRAME_SIZE), 4)) +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macros ------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ + +extern RTC_HandleTypeDef hrtc; /**< RTC handler declaration */ +#ifdef __cplusplus +extern "C" { +#endif + +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t BleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; +uint8_t g_ot_notification_allowed = 0U; +/* Global variables ----------------------------------------------------------*/ + +/* Global function prototypes -----------------------------------------------*/ +#if (CFG_DEBUG_TRACE != 0) +size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize); +#endif + +/* USER CODE BEGIN GFP */ +osSemaphoreId_t SemShciId; +osSemaphoreId_t SemShciUserEvtProcessId; +osThreadId_t OsShciUserEvtProcessId; +osThreadId_t OsPushButtonProcessId; + +const osThreadAttr_t ShciUserEvtProcess_attr = { .name = CFG_SHCI_USER_EVT_PROCESS_NAME, + .attr_bits = CFG_SHCI_USER_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_SHCI_USER_EVT_PROCESS_CB_MEM, + .cb_size = CFG_SHCI_USER_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_SHCI_USER_EVT_PROCESS_STACK_MEM, + .stack_size = CFG_SHCI_USER_EVT_PROCESS_STACK_SIZE, + .priority = CFG_SHCI_USER_EVT_PROCESS_PRIORITY }; + +const osThreadAttr_t PushButtonProcess_attr = { .name = CFG_PUSH_BUTTON_EVT_PROCESS_NAME, + .attr_bits = CFG_PUSH_BUTTON_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_PUSH_BUTTON_EVT_PROCESS_CB_MEM, + .cb_size = CFG_PUSH_BUTTON_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_PUSH_BUTTON_EVT_PROCESS_STACK_MEM, + .stack_size = CFG_PUSH_BUTTON_EVT_PROCESS_STACK_SIZE, + .priority = CFG_PUSH_BUTTON_EVT_PROCESS_PRIORITY }; + +/* USER CODE END GFP */ + +/* Private functions prototypes-----------------------------------------------*/ +static void SystemPower_Config(void); +static void Init_Debug(void); +static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status); +static void APPE_SysUserEvtRx(void * pPayload); +static void APPE_SysEvtReadyProcessing(void); +static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode); +static void appe_Tl_Init(void); +/* USER CODE BEGIN PFP */ +static void Led_Init(void); +static void Button_Init(void); +#if (CFG_HW_EXTPA_ENABLED == 1) +static void ExtPA_Init(void); +#endif +static void ShciUserEvtProcess(void * argument); +static void PushButtonEvtProcess(void * argument); +/* USER CODE END PFP */ + +static void displayConcurrentMode(void); + +// Callback function to handle pushbutton to apptask +PushButtonCallback PbCb = NULL; + +void APP_ENTRY_PBSetReceiveCallback(PushButtonCallback aCallback) +{ + PbCb = aCallback; +} + +/* Functions Definition ------------------------------------------------------*/ +void APPE_Init(void) +{ + /* Configure the system Power Mode */ + SystemPower_Config(); + + /* Initialize the TimerServer */ + HW_TS_Init(hw_ts_InitMode_Full, &hrtc); + + /* USER CODE BEGIN APPE_Init_1 */ + /* initialize debugger module if supported and debug trace if activated */ + Init_Debug(); + + /* Display Dynamic concurrent mode (BLE and Thread) */ + displayConcurrentMode(); + + /** + * The Standby mode should not be entered before the initialization is over + * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + + /** init freertos semaphore */ + SemShciId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + SemShciUserEvtProcessId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + OsShciUserEvtProcessId = osThreadNew(ShciUserEvtProcess, NULL, &ShciUserEvtProcess_attr); + OsPushButtonProcessId = osThreadNew(PushButtonEvtProcess, NULL, &PushButtonProcess_attr); + + Led_Init(); + Button_Init(); + + /* USER CODE END APPE_Init_1 */ + /* Initialize all transport layers and start CPU2 which will send back a ready event to CPU1 */ + appe_Tl_Init(); + + BSP_LCD_Init(0, LCD_ORIENTATION_LANDSCAPE); + /* Set LCD Foreground Layer */ + UTIL_LCD_SetFuncDriver(&LCD_Driver); /* SetFunc before setting device */ + UTIL_LCD_SetDevice(0); /* SetDevice after funcDriver is set */ + BSP_LCD_Clear(0, SSD1315_COLOR_BLACK); + BSP_LCD_DisplayOn(0); + BSP_LCD_Refresh(0); + UTIL_LCD_SetFont(&Font12); + /* Set the LCD Text Color */ + UTIL_LCD_SetTextColor(SSD1315_COLOR_WHITE); + UTIL_LCD_SetBackColor(SSD1315_COLOR_BLACK); + BSP_LCD_Clear(0, SSD1315_COLOR_BLACK); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, 0, (uint8_t *) "Matter LightingApp", CENTER_MODE); + BSP_LCD_Refresh(0); + + /** + * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready ) + * received on the system channel before starting the Stack + * This system event is received with APPE_SysUserEvtRx() + */ + /* USER CODE BEGIN APPE_Init_2 */ +#if (CFG_HW_EXTPA_ENABLED == 1) + ExtPA_Init(); +#endif + + /* USER CODE END APPE_Init_2 */ + return; +} + +static void displayConcurrentMode() +{ + APP_DBG("Matter Over Thread Lighting-App starting..."); +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Init_Debug(void) +{ +#if (CFG_DEBUGGER_SUPPORTED == 1) + /** + * Keep debugger enabled while in any low power mode + */ + HAL_DBGMCU_EnableDBGSleepMode(); + + /* Enable debugger EXTI lines */ + LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48); + LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48); + +#else + /* Disable debugger EXTI lines */ + LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); + LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); + + GPIO_InitTypeDef gpio_config = { 0 }; + + gpio_config.Pull = GPIO_NOPULL; + gpio_config.Mode = GPIO_MODE_ANALOG; + + gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13; + __HAL_RCC_GPIOA_CLK_ENABLE(); + HAL_GPIO_Init(GPIOA, &gpio_config); + __HAL_RCC_GPIOA_CLK_DISABLE(); + + gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3; + __HAL_RCC_GPIOB_CLK_ENABLE(); + HAL_GPIO_Init(GPIOB, &gpio_config); + __HAL_RCC_GPIOB_CLK_DISABLE(); + + /** + * Do not keep debugger enabled while in any low power mode + */ + HAL_DBGMCU_DisableDBGSleepMode(); + HAL_DBGMCU_DisableDBGStopMode(); + HAL_DBGMCU_DisableDBGStandbyMode(); +#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */ + +#if (CFG_DEBUG_TRACE != 0) + DbgTraceInit(); +#endif + + return; +} + +/** + * @brief Configure the system for power optimization + * + * @note This API configures the system to be ready for low power mode + * + * @param None + * @retval None + */ +static void SystemPower_Config(void) +{ + // Before going to stop or standby modes, do the settings so that system clock and IP80215.4 clock + // start on HSI automatically + LL_RCC_HSI_EnableAutoFromStop(); + + /** + * Select HSI as system clock source after Wake Up from Stop mode + */ + LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI); + + /* Initialize low power manager */ + UTIL_LPM_Init(); + + /* Disable low power mode until INIT is complete */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + + /* Enable RAM1 (because OT instance.o is located here for Concurrent Mode */ + LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1); + LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_SRAM1); + + return; +} + +static void appe_Tl_Init(void) +{ + TL_MM_Config_t tl_mm_config; + SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf; + + /**< Reference table initialization */ + TL_Init(); + + /**< System channel initialization */ + SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t *) &SystemCmdBuffer; + SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot; + shci_init(APPE_SysUserEvtRx, (void *) &SHci_Tl_Init_Conf); + + /**< Memory Manager channel initialization */ + tl_mm_config.p_BleSpareEvtBuffer = BleSpareEvtBuffer; + tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer; + tl_mm_config.p_AsynchEvtPool = EvtPool; + tl_mm_config.AsynchEvtPoolSize = POOL_SIZE; + TL_MM_Init(&tl_mm_config); + + TL_Enable(); + + return; +} + +static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status) +{ + UNUSED(status); + return; +} + +/** + * The type of the payload for a system user event is tSHCI_UserEvtRxParam + * When the system event is both : + * - a ready event (subevtcode = SHCI_SUB_EVT_CODE_READY) + * - reported by the FUS (sysevt_ready_rsp == FUS_FW_RUNNING) + * The buffer shall not be released + * ( eg ((tSHCI_UserEvtRxParam*)pPayload)->status shall be set to SHCI_TL_UserEventFlow_Disable ) + * When the status is not filled, the buffer is released by default + */ +static void APPE_SysUserEvtRx(void * pPayload) +{ + TL_AsynchEvt_t * p_sys_event; + p_sys_event = (TL_AsynchEvt_t *) (((tSHCI_UserEvtRxParam *) pPayload)->pckt->evtserial.evt.payload); + + switch (p_sys_event->subevtcode) + { + case SHCI_SUB_EVT_CODE_READY: + APPE_SysEvtReadyProcessing(); + break; + + case SHCI_SUB_EVT_ERROR_NOTIF: + APPE_SysEvtError((SCHI_SystemErrCode_t)(p_sys_event->payload[0])); + break; + + default: + break; + } + return; +} + +/** + * @brief Notify a system error coming from the M0 firmware + * @param ErrorCode : errorCode detected by the M0 firmware + * + * @retval None + */ +static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode) +{ + switch (ErrorCode) + { + case ERR_THREAD_LLD_FATAL_ERROR: + APP_DBG("** ERR_THREAD : LLD_FATAL_ERROR \n"); + break; + + case ERR_THREAD_UNKNOWN_CMD: + APP_DBG("** ERR_THREAD : UNKNOWN_CMD \n"); + break; + + default: + APP_DBG("** ERR_THREAD : ErroCode=%d \n", ErrorCode); + break; + } + return; +} + +static void APPE_SysEvtReadyProcessing(void) +{ + /* Traces channel initialization */ + TL_TRACES_Init(); + + /* In the Context of Dynamic Concurrent mode, the Init and start of each stack must be split and executed + * in the following order : + * APP_BLE_Init : BLE Stack Init until it's ready to start ADV + * APP_THREAD_Init_Dyn_1() : Thread Stack Init until it's ready to be configured (default channel, PID, etc...) + */ + APP_DBG("1- Initialisation of BLE Stack..."); + APP_BLE_Init_Dyn_1(); + APP_DBG("2- Initialisation of OpenThread Stack. FW info :"); + APP_THREAD_Init(); + APP_BLE_Init_Dyn_2(); + + APP_DBG("Start init matter"); + GetAppTask().StartAppTask(); + +#if (CFG_LPM_SUPPORTED == 1) + /* Thread stack is initialized, low power mode can be enabled */ + UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE); + UTIL_LPM_SetStopMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE); +#endif + + return; +} + +static void Led_Init(void) +{ +#if (CFG_LED_SUPPORTED == 1U) + /** + * Leds Initialization + */ + +#endif + + return; +} + +static void Button_Init(void) +{ + +#if (CFG_BUTTON_SUPPORTED == 1U) + /** + * Button Initialization + */ + + BSP_PB_Init(BUTTON_USER1, BUTTON_MODE_EXTI); +#endif + + return; +} + +#if (CFG_HW_EXTPA_ENABLED == 1) +static void ExtPA_Init(void) +{ + GPIO_InitTypeDef GPIO_InitStruct; + + // configure the GPIO PB0 in AF6 to be used as RF_TX_MOD_EXT_PA + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF6_RF_DTB0; + GPIO_InitStruct.Pin = GPIO_EXT_PA_TX_PIN; + HAL_GPIO_Init(GPIO_EXT_PA_TX_PORT, &GPIO_InitStruct); + + // configure the GPIO which will be managed by M0 stack to enable Ext PA + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Pin = GPIO_EXT_PA_EN_PIN; + HAL_GPIO_Init(GPIO_EXT_PA_EN_PORT, &GPIO_InitStruct); + + // Indicate to M0 which GPIO must be managed + SHCI_C2_ExtpaConfig((uint32_t) GPIO_EXT_PA_EN_PORT, GPIO_EXT_PA_EN_PIN, EXT_PA_ENABLED_HIGH, EXT_PA_ENABLED); +} +#endif /* CFG_HW_EXTPA_ENABLED */ + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +static void PushButtonEvtProcess(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_1 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_1 */ + osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + Push_Button_st Message; + Message.Pushed_Button = BUTTON_USER1; + Message.State = 1; + PbCb(&Message); // call matter callback to handle push button + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_2 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_2 */ + } +} + +static void ShciUserEvtProcess(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_1 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_1 */ + // osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + osSemaphoreAcquire(SemShciUserEvtProcessId, osWaitForever); + shci_user_evt_proc(); + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_2 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_2 */ + } +} + +void shci_notify_asynch_evt(void * pdata) +{ + UNUSED(pdata); + osSemaphoreRelease(SemShciUserEvtProcessId); + return; +} + +void shci_cmd_resp_release(uint32_t flag) +{ + UNUSED(flag); + osSemaphoreRelease(SemShciId); + return; +} + +void shci_cmd_resp_wait(uint32_t timeout) +{ + UNUSED(timeout); + osSemaphoreAcquire(SemShciId, osWaitForever); + return; +} + +/* Received trace buffer from M0 */ +void TL_TRACES_EvtReceived(TL_EvtPacket_t * hcievt) +{ +#if (CFG_DEBUG_TRACE != 0) + /* Call write/print function using DMA from dbg_trace */ + /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes), + - (-2) to size to remove Sub Evt Code */ + DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *) (hcievt->evtserial.evt.payload))->payload, + hcievt->evtserial.evt.plen - 2U); +#endif /* CFG_DEBUG_TRACE */ + /* Release buffer */ + TL_MM_EvtDone(hcievt); +} +/** + * @brief Initialization of the trace mechanism + * @param None + * @retval None + */ +#if (CFG_DEBUG_TRACE != 0) +void DbgOutputInit(void) +{ +#if (CFG_HW_USART1_ENABLED == 1) + HW_UART_Init(CFG_DEBUG_TRACE_UART); +#endif + return; +} + +/** + * @brief Management of the traces + * @param p_data : data + * @param size : size + * @param call-back : + * @retval None + */ +void DbgOutputTraces(uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb); + + return; +} +#endif + +/** + * @brief This function manage the Push button action + * @param GPIO_Pin : GPIO pin which has been activated + * @retval None + */ +void BSP_PB_Callback(Button_TypeDef Button) +{ + switch (Button) + { + case BUTTON_USER1: + APP_DBG("BUTTON 1 PUSHED !"); + osThreadFlagsSet(OsPushButtonProcessId, 1); + break; + + case BUTTON_USER2: + APP_DBG("BUTTON 2 PUSHED !"); + /* Set "Switch Protocol" Task */ + break; + + default: + break; + } + + return; +} +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c new file mode 100644 index 00000000000000..db25dccdf97cf0 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c @@ -0,0 +1,76 @@ + +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : entropy_hardware_poll.c + * Description : This file provides code for the entropy collector. + * author :MCD Application Team + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +#include "main.h" +#include "stm32wbxx_hal.h" +#include "stm32wbxx_ll_hsem.h" +#include + +int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen); + +int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t random_number = 0; + /** + * Static random Address + * The two upper bits shall be set to 1 + * The lowest 32bits is read from the UDN to differentiate between devices + * The RNG may be used to provide a random number on each power on + */ + /* Get RNG semaphore */ + while (LL_HSEM_1StepLock(HSEM, 0)) + ; + + /* Enable RNG */ + __HAL_RNG_ENABLE(&hrng); + + /* Enable HSI48 oscillator */ + LL_RCC_HSI48_Enable(); + /* Wait until HSI48 is ready */ + while (!LL_RCC_HSI48_IsReady()) + ; + + if (HAL_RNG_GenerateRandomNumber(&hrng, &random_number) != HAL_OK) + { + } + + /* Disable HSI48 oscillator */ + LL_RCC_HSI48_Disable(); + + /* Disable RNG */ + __HAL_RNG_DISABLE(&hrng); + + /* Release RNG semaphore */ + LL_HSEM_ReleaseLock(HSEM, 0, 0); + ((void) data); + *olen = 0; + + if ((len < sizeof(uint32_t)) || (HAL_OK != status)) + { + return 0; + } + + memcpy(output, &random_number, sizeof(uint32_t)); + *olen = sizeof(uint32_t); + + return 0; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c new file mode 100644 index 00000000000000..fcf4534a327003 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c @@ -0,0 +1,322 @@ +/** + ****************************************************************************** + * @file : flash_driver.c + * @author : MCD Application Team + * @brief : Dual core Flash driver + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "flash_driver.h" +#include "app_common.h" +#include "main.h" +#include "shci.h" +#include "utilities_conf.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef enum +{ + SEM_LOCK_SUCCESSFUL, + SEM_LOCK_BUSY, +} SemStatus_t; + +typedef enum +{ + FLASH_ERASE, + FLASH_WRITE, +} FlashOperationType_t; + +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static SingleFlashOperationStatus_t ProcessSingleFlashOperation(FlashOperationType_t FlashOperationType, + uint32_t SectorNumberOrDestAddress, uint64_t Data); +/* Public functions ----------------------------------------------------------*/ +uint32_t FD_EraseSectors(uint32_t FirstSector, uint32_t NbrOfSectors) +{ + uint32_t loop_flash; + uint32_t return_value; + SingleFlashOperationStatus_t single_flash_operation_status; + + single_flash_operation_status = SINGLE_FLASH_OPERATION_DONE; + + /** + * Take the semaphore to take ownership of the Flash IP + */ + while (LL_HSEM_1StepLock(HSEM, CFG_HW_FLASH_SEMID)) + ; + + HAL_FLASH_Unlock(); + + /** + * Notify the CPU2 that some flash erase activity may be executed + * On reception of this command, the CPU2 enables the BLE timing protection versus flash erase processing + * The Erase flash activity will be executed only when the BLE RF is idle for at least 25ms + * The CPU2 will prevent all flash activity (write or erase) in all cases when the BL RF Idle is shorter than 25ms. + */ + SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON); + + for (loop_flash = 0; (loop_flash < NbrOfSectors) && (single_flash_operation_status == SINGLE_FLASH_OPERATION_DONE); + loop_flash++) + { + single_flash_operation_status = FD_EraseSingleSector(FirstSector + loop_flash); + } + + if (single_flash_operation_status != SINGLE_FLASH_OPERATION_DONE) + { + return_value = NbrOfSectors - loop_flash + 1; + } + else + { + /** + * Notify the CPU2 there will be no request anymore to erase the flash + * On reception of this command, the CPU2 will disables the BLE timing protection versus flash erase processing + * The protection is active until next end of radio event. + */ + SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF); + + HAL_FLASH_Lock(); + + /** + * Release the ownership of the Flash IP + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_FLASH_SEMID, 0); + + return_value = 0; + } + + return return_value; +} + +uint32_t FD_WriteData(uint32_t DestAddress, uint64_t * pSrcBuffer, uint32_t NbrOfData) +{ + uint32_t loop_flash; + uint32_t return_value; + SingleFlashOperationStatus_t single_flash_operation_status; + + single_flash_operation_status = SINGLE_FLASH_OPERATION_DONE; + + /** + * Take the semaphore to take ownership of the Flash IP + */ + while (LL_HSEM_1StepLock(HSEM, CFG_HW_FLASH_SEMID)) + ; + + HAL_FLASH_Unlock(); + + for (loop_flash = 0; (loop_flash < NbrOfData) && (single_flash_operation_status == SINGLE_FLASH_OPERATION_DONE); loop_flash++) + { + single_flash_operation_status = FD_WriteSingleData(DestAddress + (8 * loop_flash), *(pSrcBuffer + loop_flash)); + } + + if (single_flash_operation_status != SINGLE_FLASH_OPERATION_DONE) + { + return_value = NbrOfData - loop_flash + 1; + } + else + { + HAL_FLASH_Lock(); + + /** + * Release the ownership of the Flash IP + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_FLASH_SEMID, 0); + + return_value = 0; + } + + return return_value; +} + +SingleFlashOperationStatus_t FD_EraseSingleSector(uint32_t SectorNumber) +{ + SingleFlashOperationStatus_t return_value; + + /* The last parameter is unused in that case and set to 0 */ + return_value = ProcessSingleFlashOperation(FLASH_ERASE, SectorNumber, 0); + + return return_value; +} + +SingleFlashOperationStatus_t FD_WriteSingleData(uint32_t DestAddress, uint64_t Data) +{ + SingleFlashOperationStatus_t return_value; + + return_value = ProcessSingleFlashOperation(FLASH_WRITE, DestAddress, Data); + + return return_value; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static SingleFlashOperationStatus_t ProcessSingleFlashOperation(FlashOperationType_t FlashOperationType, + uint32_t SectorNumberOrDestAddress, uint64_t Data) +{ + SemStatus_t cpu1_sem_status; + SemStatus_t cpu2_sem_status; + WaitedSemStatus_t waited_sem_status; + SingleFlashOperationStatus_t return_status; + + uint32_t page_error; + FLASH_EraseInitTypeDef p_erase_init; + + waited_sem_status = WAITED_SEM_FREE; + + p_erase_init.TypeErase = FLASH_TYPEERASE_PAGES; + p_erase_init.NbPages = 1; + p_erase_init.Page = SectorNumberOrDestAddress; + + do + { + /** + * When the PESD bit mechanism is used by CPU2 to protect its timing, the PESD bit should be polled here. + * If the PESD is set, the CPU1 will be stalled when reading literals from an ISR that may occur after + * the flash processing has been requested but suspended due to the PESD bit. + * + * Note: This code is required only when the PESD mechanism is used to protect the CPU2 timing. + * However, keeping that code make it compatible with the two mechanisms. + */ + while (LL_FLASH_IsActiveFlag_OperationSuspended()) + ; + + UTILS_ENTER_CRITICAL_SECTION(); + + /** + * Depending on the application implementation, in case a multitasking is possible with an OS, + * it should be checked here if another task in the application disallowed flash processing to protect + * some latency in critical code execution + * When flash processing is ongoing, the CPU cannot access the flash anymore. + * Trying to access the flash during that time stalls the CPU. + * The only way for CPU1 to disallow flash processing is to take CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID. + */ + cpu1_sem_status = (SemStatus_t) LL_HSEM_GetStatus(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID); + if (cpu1_sem_status == SEM_LOCK_SUCCESSFUL) + { + /** + * Check now if the CPU2 disallows flash processing to protect its timing. + * If the semaphore is locked, the CPU2 does not allow flash processing + * + * Note: By default, the CPU2 uses the PESD mechanism to protect its timing, + * therefore, it is useless to get/release the semaphore. + * + * However, keeping that code make it compatible with the two mechanisms. + * The protection by semaphore is enabled on CPU2 side with the command SHCI_C2_SetFlashActivityControl() + * + */ + cpu2_sem_status = (SemStatus_t) LL_HSEM_1StepLock(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID); + if (cpu2_sem_status == SEM_LOCK_SUCCESSFUL) + { + /** + * When CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID is taken, it is allowed to only erase one sector or + * write one single 64bits data + * When either several sectors need to be erased or several 64bits data need to be written, + * the application shall first exit from the critical section and try again. + */ + if (FlashOperationType == FLASH_ERASE) + { + HAL_FLASHEx_Erase(&p_erase_init, &page_error); + } + else + { + HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, SectorNumberOrDestAddress, Data); + } + /** + * Release the semaphore to give the opportunity to CPU2 to protect its timing versus the next flash operation + * by taking this semaphore. + * Note that the CPU2 is polling on this semaphore so CPU1 shall release it as fast as possible. + * This is why this code is protected by a critical section. + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID, 0); + } + } + + UTILS_EXIT_CRITICAL_SECTION(); + + if (cpu1_sem_status != SEM_LOCK_SUCCESSFUL) + { + /** + * To avoid looping in ProcessSingleFlashOperation(), FD_WaitForSemAvailable() should implement a mechanism to + * continue only when CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID is free + */ + waited_sem_status = FD_WaitForSemAvailable(WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU1); + } + else if (cpu2_sem_status != SEM_LOCK_SUCCESSFUL) + { + /** + * To avoid looping in ProcessSingleFlashOperation(), FD_WaitForSemAvailable() should implement a mechanism to + * continue only when CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID is free + */ + waited_sem_status = FD_WaitForSemAvailable(WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU2); + } + } while (((cpu2_sem_status != SEM_LOCK_SUCCESSFUL) || (cpu1_sem_status != SEM_LOCK_SUCCESSFUL)) && + (waited_sem_status != WAITED_SEM_BUSY)); + + /** + * In most BLE application, the flash should not be blocked by the CPU2 longer than FLASH_TIMEOUT_VALUE (1000ms) + * However, it could be that for some marginal application, this time is longer. + * In that case either HAL_FLASHEx_Erase() or HAL_FLASH_Program() will exit with FLASH_TIMEOUT_VALUE value. + * This is not a failing case and there is no other way than waiting the operation to be completed. + * If for any reason this test is never passed, this means there is a failure in the system and there is no other + * way to recover than applying a device reset. + * + * Note: This code is required only when the PESD mechanism is used to protect the CPU2 timing. + * However, keeping that code make it compatible with the two mechanisms. + */ + while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_CFGBSY)) + ; + + if (waited_sem_status != WAITED_SEM_BUSY) + { + /** + * The flash processing has been done. It has not been checked whether it has been successful or not. + * The only commitment is that it is possible to request a new flash processing + */ + return_status = SINGLE_FLASH_OPERATION_DONE; + } + else + { + /** + * The flash processing has not been executed due to timing protection from either the CPU1 or the CPU2. + * This status is reported up to the user that should retry after checking that each CPU do not + * protect its timing anymore. + */ + return_status = SINGLE_FLASH_OPERATION_NOT_EXECUTED; + } + + return return_status; +} + +/************************************************************* + * + * WEAK FUNCTIONS + * + *************************************************************/ +__WEAK WaitedSemStatus_t FD_WaitForSemAvailable(WaitedSemId_t WaitedSemId) +{ + /** + * The timing protection is enabled by either CPU1 or CPU2. It should be decided here if the driver shall + * keep trying to erase/write the flash until successful or if it shall exit and report to the user that the action + * has not been executed. + * WAITED_SEM_BUSY returns to the user + * WAITED_SEM_FREE keep looping in the driver until the action is executed. This will result in the current stack looping + * until this is done. In a bare metal implementation, only the code within interrupt handler can be executed. With an OS, + * only task with higher priority can be processed + * + */ + return WAITED_SEM_BUSY; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c new file mode 100644 index 00000000000000..d1e0f613b70b4b --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c @@ -0,0 +1,357 @@ +/** + ****************************************************************************** + * @file flash_wb.c + * @author MCD Application Team + * @brief Middleware between keymanager and flahs_driver , + * to manage key needed for Matter + ****************************************************************************** + * @attention + * + * Copyright (c) 2023 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "flash_wb.h" +#include "flash_driver.h" + +#include +#include +#include + +/* Private defines -----------------------------------------------------------*/ +#define MATTER_KEY_NAME_MAX_LENGTH (15 * 2) // ADD Max key name string size is 30 "keyType...;KeyName..." +// ^ STM32STORE_MAX_KEY_SIZE +#define NVM_OFFSET_KEY 512 +#define NVM_END_FLASH +#define NVM_BLOCK_SIZE NVM_OFFSET_KEY +#define FLASH_START 0x08000000 +#define DEFAULT_VALUE 0xFF +#define NB_SECTOR 3 +#define NVM_MATTER_ADDR_INIT_SECURE 0x08082000 +#define NVM_MATTER_ADDR_INIT_SECURE_PTR ((void * const) NVM_MATTER_ADDR_INIT_SECURE) +#define SECTOR_SIZE_SECURE 4096 * 2 +#define NVM_MATTER_ADDR_INIT_NO_SECURE NVM_MATTER_ADDR_INIT_SECURE + SECTOR_SIZE_SECURE +#define NVM_MATTER_ADDR_INIT_NOSECURE_PTR ((void * const) NVM_MATTER_ADDR_INIT_NO_SECURE) +#define SECTOR_SIZE_NO_SECURE 4096 +#define NVM_SIZE_FLASH (SECTOR_SIZE_SECURE + SECTOR_SIZE_NO_SECURE) +#define NVM_MAX_KEY NVM_SIZE_FLASH / NVM_OFFSET_KEY + +typedef struct +{ + NVM_Sector id_sector; + uint8_t * ram_ptr; + size_t sector_size; + +} NVM_Sector_Struct; + +/* Private macros ------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ +uint8_t ram_nvm[SECTOR_SIZE_SECURE + SECTOR_SIZE_NO_SECURE] = { 0 }; + +const NVM_Sector_Struct sector_no_secure = { .id_sector = SECTOR_NO_SECURE, + .ram_ptr = ram_nvm + SECTOR_SIZE_SECURE, + .sector_size = SECTOR_SIZE_NO_SECURE }; + +//*SIMULATE TO EXAMPLE* +const NVM_Sector_Struct sector_secure = { .id_sector = SECTOR_SECURE, .ram_ptr = ram_nvm, .sector_size = SECTOR_SIZE_SECURE }; + +uint8_t CheckSanity = 0; +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ + +static uint8_t flash_get(uint8_t * KeyValue, uint8_t * KeyAddr, size_t KeySize, size_t * read_by_size); +static uint8_t flash_update(const NVM_Sector_Struct select_sector, uint8_t * KeyName, uint8_t * KeyValue, size_t KeySize); +static NVM_StatusTypeDef flash_replace(const NVM_Sector_Struct select_sector, uint8_t * PtKeyfind, uint8_t * KeyName, + uint8_t * KeyValue, size_t KeySize); +static NVM_StatusTypeDef flash_write(uint8_t * PtKeyFree, uint8_t * key, uint8_t * value, size_t value_size); +static uint8_t * SearchKey(uint8_t * PtPage, uint8_t * KeyName); +static NVM_StatusTypeDef delete_key(const NVM_Sector_Struct select_sector, uint8_t * PtkeyFind); + +/* Public functions ----------------------------------------------------------*/ + +void NM_Init(void) +{ + // Copy Nvm flash to ram, it used one time for boot + // copy no secure nvm to no secure ram + memcpy(sector_no_secure.ram_ptr, NVM_MATTER_ADDR_INIT_NOSECURE_PTR, sector_no_secure.sector_size); + + // copy secure nvm to secure ram *SIMULATE TO EXAMPLE* + memcpy(sector_secure.ram_ptr, NVM_MATTER_ADDR_INIT_SECURE_PTR, sector_secure.sector_size); +} + +NVM_StatusTypeDef NM_Check_Validity(void) +{ + NVM_StatusTypeDef err = NVM_OK; + if (CheckSanity != 0) + { + err = NVM_FLASH_CORRUPTION; + } + return err; +} + +NVM_StatusTypeDef NM_Dump(void) +{ + NVM_StatusTypeDef err = NVM_DELETE_FAILED; + + err = FD_EraseSectors((NVM_MATTER_ADDR_INIT_SECURE - FLASH_START) / (NVM_SIZE_FLASH / NB_SECTOR), NB_SECTOR); + if (err == 0) + { + err = FD_WriteData(NVM_MATTER_ADDR_INIT_SECURE, (uint64_t *) ram_nvm, (uint32_t)(NVM_SIZE_FLASH / sizeof(uint64_t))); + if (err != 0) + { + err = NVM_WRITE_FAILED; + } + else + { + if (memcmp(ram_nvm, (void *) NVM_MATTER_ADDR_INIT_SECURE, (size_t) NVM_SIZE_FLASH)) + { + err = NVM_WRITE_FAILED; + } + else + { + err = NVM_OK; + } + } + } + return err; +} + +NVM_StatusTypeDef NM_GetKeyValue(void * KeyValue, const char * KeyName, uint32_t KeySize, size_t * read_by_size, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + + uint8_t * key_search = SearchKey(select_nvm.ram_ptr, (uint8_t *) KeyName); + if (key_search != NULL) + { + // copy Keyname's value in KeyValue and copy the size of KeyValue in read_by_size + return flash_get(KeyValue, key_search, KeySize, read_by_size); + } + return NVM_KEY_NOT_FOUND; +} + +NVM_StatusTypeDef NM_SetKeyValue(char * KeyValue, char * KeyName, uint32_t KeySize, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + void * Ptkey = NULL; + + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + + if (KeySize > NVM_BLOCK_SIZE) + { + return NVM_BLOCK_SIZE_OVERFLOW; + } + // call function to search the pointer of key if it exist else return null + Ptkey = SearchKey(select_nvm.ram_ptr, (uint8_t *) KeyName); + + if (Ptkey == NULL) + { + return flash_update(select_nvm, (uint8_t *) KeyName, (uint8_t *) KeyValue, KeySize); + } + else + { + if (!flash_replace(select_nvm, Ptkey, (uint8_t *) KeyName, (uint8_t *) KeyValue, KeySize)) + { + return NVM_OK; + } + } + return NVM_WRITE_FAILED; +} + +uint8_t NM_DeleteKey(const char * Keyname, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + uint8_t * Ptkey = SearchKey(select_nvm.ram_ptr, (uint8_t *) Keyname); + if (Ptkey != NULL) + { + return delete_key(select_nvm, Ptkey); + } + return NVM_KEY_NOT_FOUND; +} + +void NM_ResetFactory(void) +{ + while (1) + { + FD_EraseSectors((NVM_MATTER_ADDR_INIT_SECURE - FLASH_START) / (NVM_SIZE_FLASH / NB_SECTOR), NB_SECTOR); + NVIC_SystemReset(); + } +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +static uint8_t * SearchKey(uint8_t * PtPage, uint8_t * KeyName) +{ + + uint8_t * i = PtPage; + size_t read_by_size = 0; + + while ((i >= PtPage) || (i < (PtPage + NVM_SIZE_FLASH))) + { + if (*i != DEFAULT_VALUE) + { + if (strcmp((char *) KeyName, (char *) i) == 0) + { + return i; + } + read_by_size = *(size_t *) ((uint8_t *) i + MATTER_KEY_NAME_MAX_LENGTH); + i += read_by_size + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + // Flash is corrupted + if ((i < PtPage) || (i > (PtPage + NVM_SIZE_FLASH))) + { + NM_ResetFactory(); + } + } + else + { + return NULL; + } + } + return NULL; +} + +static uint8_t flash_get(uint8_t * KeyValue, uint8_t * KeyAddr, size_t KeySize, size_t * read_by_size) +{ + *read_by_size = *(size_t *) ((uint8_t *) KeyAddr + MATTER_KEY_NAME_MAX_LENGTH); + if (KeySize >= *read_by_size) + { + memcpy(KeyValue, KeyAddr + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_t), *read_by_size); + return NVM_OK; + } + else + { + return NVM_BUFFER_TOO_SMALL; + } +} + +static NVM_StatusTypeDef flash_update(const NVM_Sector_Struct select_sector, uint8_t * KeyName, uint8_t * KeyValue, size_t KeySize) +{ + + uint8_t * i = select_sector.ram_ptr; + size_t read_by_size = 0; + while (i < (select_sector.ram_ptr + select_sector.sector_size)) + { + if (*i == DEFAULT_VALUE) + { + return flash_write(i, KeyName, KeyValue, KeySize); + } + read_by_size = *(size_t *) ((uint8_t *) i + MATTER_KEY_NAME_MAX_LENGTH); + if (read_by_size > NVM_BLOCK_SIZE) + { + return NVM_ERROR_BLOCK_ALIGN; + } + i += read_by_size + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + } + return NVM_SIZE_FULL; +} + +static NVM_StatusTypeDef flash_replace(const NVM_Sector_Struct select_sector, uint8_t * PtKeyfind, uint8_t * KeyName, + uint8_t * KeyValue, size_t KeySize) +{ + + NVM_StatusTypeDef err = NVM_OK; + if ((PtKeyfind != NULL) && (KeyName != NULL) && (KeyValue != NULL)) + { + err = delete_key(select_sector, PtKeyfind); + if (err != NVM_OK) + return err; + + err = flash_update(select_sector, KeyName, KeyValue, KeySize); + if (err != NVM_OK) + return err; + return err; + } + return NVM_WRITE_FAILED; +} + +static NVM_StatusTypeDef delete_key(const NVM_Sector_Struct select_sector, uint8_t * PtkeyFind) +{ + uint8_t * PtKeyNext = NULL; + uint8_t * PtKeyCpy = NULL; + size_t size_key = 0; + + if (PtkeyFind != NULL) + { + size_key = *(size_t *) ((uint8_t *) PtkeyFind + MATTER_KEY_NAME_MAX_LENGTH); + PtKeyNext = PtkeyFind + size_key + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_key); + PtKeyCpy = PtkeyFind; + while ((*PtKeyNext != 0xFF) && (PtKeyNext < (ram_nvm + NVM_SIZE_FLASH))) + { + size_key = *(size_t *) ((uint8_t *) PtKeyNext + MATTER_KEY_NAME_MAX_LENGTH); + memcpy(PtKeyCpy, PtKeyNext, size_key + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH); + PtKeyCpy += size_key + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + PtKeyNext += size_key + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_key); + } + memset(PtKeyCpy, DEFAULT_VALUE, (ram_nvm + NVM_SIZE_FLASH - PtKeyCpy)); + return NVM_OK; + } + return NVM_DELETE_FAILED; +} + +static NVM_StatusTypeDef flash_write(uint8_t * PtKeyFree, uint8_t * key, uint8_t * value, size_t value_size) +{ + + if ((PtKeyFree != NULL) && (key != NULL) && (value != NULL)) + { + + memset(PtKeyFree, DEFAULT_VALUE, value_size); + memset(PtKeyFree, 0x00, MATTER_KEY_NAME_MAX_LENGTH); + memcpy(PtKeyFree, key, strlen((char *) key)); + memcpy(PtKeyFree + MATTER_KEY_NAME_MAX_LENGTH, &value_size, sizeof(size_t)); + memcpy(PtKeyFree + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_t), value, value_size); + return NVM_OK; + } + return NVM_WRITE_FAILED; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c new file mode 100644 index 00000000000000..ab2043c9b9139f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c @@ -0,0 +1,322 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : freertos_port.c + * Description : Custom porting of FreeRTOS functionalities + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" + +#include "FreeRTOS.h" +#include "stm32_lpm.h" +#include "task.h" +#include + +/* Private typedef -----------------------------------------------------------*/ +typedef struct +{ + uint32_t LpTimeLeftOnEntry; + uint8_t LpTimerFreeRTOS_Id; +} LpTimerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#ifndef configSYSTICK_CLOCK_HZ +#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ +/* Ensure the SysTick is clocked at the same frequency as the core. */ +#define portNVIC_SYSTICK_CLK_BIT (1UL << 2UL) +#else +/* The way the SysTick is clocked is not modified in case it is not the same + as the core. */ +#define portNVIC_SYSTICK_CLK_BIT (0) +#endif + +#define CPU_CLOCK_KHZ (configCPU_CLOCK_HZ / 1000) + +/* Constants required to manipulate the core. Registers first... */ +#define portNVIC_SYSTICK_CTRL_REG (*((volatile uint32_t *) 0xe000e010)) +#define portNVIC_SYSTICK_LOAD_REG (*((volatile uint32_t *) 0xe000e014)) +#define portNVIC_SYSTICK_CURRENT_VALUE_REG (*((volatile uint32_t *) 0xe000e018)) +#define portNVIC_SYSTICK_INT_BIT (1UL << 1UL) +#define portNVIC_SYSTICK_ENABLE_BIT (1UL << 0UL) +#define portNVIC_SYSTICK_COUNT_FLAG_BIT (1UL << 16UL) + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* + * The number of SysTick increments that make up one tick period. + */ +#if (CFG_LPM_SUPPORTED != 0) +static uint32_t ulTimerCountsForOneTick; + +static LpTimerContext_t LpTimerContext; +#endif +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerInit(void); +static void LpTimerCb(void); +static void LpTimerStart(uint32_t time_to_sleep); +static void LpEnter(void); +static uint32_t LpGetElapsedTime(void); +void vPortSetupTimerInterrupt(void); +#endif + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Implement the tickless feature + * + * + * @param: xExpectedIdleTime is given in number of FreeRTOS Ticks + * @retval: None + */ +void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) +{ + /* If low power is not used, do not stop the SysTick and continue execution */ +#if (CFG_LPM_SUPPORTED != 0) + /** + * Although this is not documented as such, when xExpectedIdleTime = 0xFFFFFFFF = (~0), + * it likely means the system may enter low power for ever ( from a FreeRTOS point of view ). + * Otherwise, for a FreeRTOS tick set to 1ms, that would mean it is requested to wakeup in 8 years from now. + * When the system may enter low power mode for ever, FreeRTOS is not really interested to maintain a + * systick count and when the system exits from low power mode, there is no need to update the count with + * the time spent in low power mode + */ + uint32_t ulCompleteTickPeriods; + + /* Stop the SysTick to avoid the interrupt to occur while in the critical section. + * Otherwise, this will prevent the device to enter low power mode + * At this time, an update of the systick will not be considered + * + */ + portNVIC_SYSTICK_CTRL_REG &= ~portNVIC_SYSTICK_ENABLE_BIT; + + /* Enter a critical section but don't use the taskENTER_CRITICAL() + method as that will mask interrupts that should exit sleep mode. */ + __disable_irq(); + __DSB(); + __ISB(); + + /* If a context switch is pending or a task is waiting for the scheduler + to be unsuspended then abandon the low power entry. */ + if (eTaskConfirmSleepModeStatus() == eAbortSleep) + { + /* Restart SysTick. */ + portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT; + + /* Re-enable interrupts - see comments above __disable_interrupt() + call above. */ + __enable_irq(); + } + else + { + if (xExpectedIdleTime != (~0)) + { + /* Remove one tick to wake up before the event occurs */ + xExpectedIdleTime--; + /* Start the low power timer */ + LpTimerStart(xExpectedIdleTime); + } + + /* Enter low power mode */ + LpEnter(); + + if (xExpectedIdleTime != (~0)) + { + /** + * Get the number of FreeRTOS ticks that has been suppressed + * In the current implementation, this shall be kept in critical section + * so that the timer server return the correct elapsed time + */ + ulCompleteTickPeriods = LpGetElapsedTime(); + vTaskStepTick(ulCompleteTickPeriods); + } + + /* Restart SysTick */ + portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL; + portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT; + portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL; + + /* Exit with interrUpts enabled. */ + __enable_irq(); + } +#endif +} + +/* + * Setup the systick timer to generate the tick interrupts at the required + * frequency and initialize a low power timer + * The current implementation is kept as close as possible to the default tickless + * mode provided. + * The systick is still used when there is no need to go in low power mode. + * When the system needs to enter low power mode, the tick is suppressed and a low power timer + * is used over that time + * Note that in sleep mode, the system clock is still running and the default tickless implementation + * using systick could have been kept. + * However, as at that time, it is not yet known whereas the low power mode that will be used is stop mode or + * sleep mode, it is easier and simpler to go with a low power timer as soon as the tick need to be + * suppressed. + */ +#if (CFG_LPM_SUPPORTED != 0) +void vPortSetupTimerInterrupt(void) +{ + LpTimerInit(); + + /* Calculate the constants required to configure the tick interrupt. */ + ulTimerCountsForOneTick = (configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ); + + /* Stop and clear the SysTick. */ + portNVIC_SYSTICK_CTRL_REG = 0UL; + portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL; + + /* Configure SysTick to interrupt at the requested rate. */ + portNVIC_SYSTICK_LOAD_REG = (configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ) - 1UL; + portNVIC_SYSTICK_CTRL_REG = (portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT); +} +#endif + +/** + * @brief The current implementation uses the hw_timerserver to provide a low power timer + * This may be replaced by another low power timer. + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerInit(void) +{ + (void) HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(LpTimerContext.LpTimerFreeRTOS_Id), hw_ts_SingleShot, LpTimerCb); + + return; +} +#endif + +/** + * @brief Low power timer callback + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerCb(void) +{ + /** + * Nothing to be done + */ + + return; +} +#endif + +/** + * @brief Request to start a low power timer ( running is stop mode ) + * + * @param time_to_sleep : Number of FreeRTOS ticks + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerStart(uint32_t time_to_sleep) +{ + uint64_t time; + + /* Converts the number of FreeRTOS ticks into hw timer tick */ + if (time_to_sleep > (ULLONG_MAX / 1e12)) /* Prevent overflow in else statement */ + { + time = 0xFFFF0000; /* Maximum value equal to 24 days */ + } + else + { + /* The result always fits in uint32_t and is always less than 0xFFFF0000 */ + time = time_to_sleep * 1000000000000ULL; + time = (uint64_t)(time / (CFG_TS_TICK_VAL_PS * configTICK_RATE_HZ)); + } + + HW_TS_Start(LpTimerContext.LpTimerFreeRTOS_Id, (uint32_t) time); + + /** + * There might be other timers already running in the timer server that may elapse + * before this one. + * Store how long before the next event so that on wakeup, it will be possible to calculate + * how long the tick has been suppressed + */ + LpTimerContext.LpTimeLeftOnEntry = HW_TS_RTC_ReadLeftTicksToCount(); + + return; +} +#endif + +/** + * @brief Enter low power mode + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpEnter(void) +{ +#if (CFG_LPM_SUPPORTED == 1) + UTIL_LPM_EnterLowPower(); +#endif + return; +} +#endif + +/** + * @brief Read how long the tick has been suppressed + * + * @param None + * @retval The number of tick rate (FreeRTOS tick) + */ +#if (CFG_LPM_SUPPORTED != 0) +static uint32_t LpGetElapsedTime(void) +{ + uint64_t val_ticks, time_ps; + uint32_t LpTimeLeftOnExit; + + LpTimeLeftOnExit = HW_TS_RTC_ReadLeftTicksToCount(); + /* This cannot overflow. Max result is ~ 1.6e13 */ + time_ps = (uint64_t)((CFG_TS_TICK_VAL_PS) * (uint64_t)(LpTimerContext.LpTimeLeftOnEntry - LpTimeLeftOnExit)); + + /* time_ps can be less than 1 RTOS tick in following situations + * a) MCU didn't go to STOP2 due to wake-up unrelated to Timer Server or woke up from STOP2 very shortly after. + * Advancing RTOS clock by 1 FreeRTOS tick doesn't hurt in this case. + * b) vPortSuppressTicksAndSleep(xExpectedIdleTime) was called with xExpectedIdleTime = 2 which is minimum value defined by + * configEXPECTED_IDLE_TIME_BEFORE_SLEEP. The xExpectedIdleTime is decremented by one RTOS tick to wake-up in advance. Ex: RTOS + * tick is 1ms, the timer Server wakes the MCU in ~977 us. RTOS clock should be advanced by 1 ms. + * */ + if (time_ps <= (1e12 / configTICK_RATE_HZ)) /* time_ps < RTOS tick */ + { + val_ticks = 1; + } + else + { + /* Convert pS time into OS ticks */ + val_ticks = time_ps * configTICK_RATE_HZ; /* This cannot overflow. Max result is ~ 1.6e16 */ + val_ticks = (uint64_t)(val_ticks / (1e12)); /* The result always fits in uint32_t */ + } + + /** + * The system may have been out from another reason than the timer + * Stop the timer after the elapsed time is calculated other wise, HW_TS_RTC_ReadLeftTicksToCount() + * may return 0xFFFF ( TIMER LIST EMPTY ) + * It does not hurt stopping a timer that exists but is not running. + */ + HW_TS_Stop(LpTimerContext.LpTimerFreeRTOS_Id); + + return (uint32_t) val_ticks; +} +#endif diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c new file mode 100644 index 00000000000000..7409e7f8910319 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c @@ -0,0 +1,899 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file hw_timerserver.c + * @author MCD Application Team + * @brief Hardware timerserver source file for STM32WPAN Middleware. + ****************************************************************************** + * @attention + * + * Copyright (c) 2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "hw_conf.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef enum +{ + TimerID_Free, + TimerID_Created, + TimerID_Running +} TimerIDStatus_t; + +typedef enum +{ + SSR_Read_Requested, + SSR_Read_Not_Requested +} RequestReadSSR_t; + +typedef enum +{ + WakeupTimerValue_Overpassed, + WakeupTimerValue_LargeEnough +} WakeupTimerLimitation_Status_t; + +typedef struct +{ + HW_TS_pTimerCb_t pTimerCallBack; + uint32_t CounterInit; + uint32_t CountLeft; + TimerIDStatus_t TimerIDStatus; + HW_TS_Mode_t TimerMode; + uint32_t TimerProcessID; + uint8_t PreviousID; + uint8_t NextID; +} TimerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF +#define TIMER_LIST_EMPTY 0xFFFF + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/** + * START of Section TIMERSERVER_CONTEXT + */ + +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER]; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation; + +/** + * END of Section TIMERSERVER_CONTEXT + */ + +static RTC_HandleTypeDef * phrtc; /**< RTC handle */ +static uint8_t WakeupTimerDivider; +static uint8_t AsynchPrescalerUserConfig; +static uint16_t SynchPrescalerUserConfig; +static volatile uint16_t MaxWakeupTimerSetup; + +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static void RestartWakeupCounter(uint16_t Value); +static uint16_t ReturnTimeElapsed(void); +static void RescheduleTimerList(void); +static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR); +static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID); +static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID); +static uint16_t linkTimer(uint8_t TimerID); +static uint32_t ReadRtcSsrValue(void); + +__weak void HW_TS_RTC_CountUpdated_AppNot(void); + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Read the RTC_SSR value + * As described in the reference manual, the RTC_SSR shall be read twice to ensure + * reliability of the value + * @param None + * @retval SSR value read + */ +static uint32_t ReadRtcSsrValue(void) +{ + uint32_t first_read; + uint32_t second_read; + + first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + + second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + + while (first_read != second_read) + { + first_read = second_read; + + second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + } + + return second_read; +} + +/** + * @brief Insert a Timer in the list after the Timer ID specified + * @param TimerID: The ID of the Timer + * @param RefTimerID: The ID of the Timer to be linked after + * @retval None + */ +static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID) +{ + uint8_t next_id; + + next_id = aTimerContext[RefTimerID].NextID; + + if (next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[next_id].PreviousID = TimerID; + } + aTimerContext[TimerID].NextID = next_id; + aTimerContext[TimerID].PreviousID = RefTimerID; + aTimerContext[RefTimerID].NextID = TimerID; + + return; +} + +/** + * @brief Insert a Timer in the list before the ID specified + * @param TimerID: The ID of the Timer + * @param RefTimerID: The ID of the Timer to be linked before + * @retval None + */ +static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID) +{ + uint8_t previous_id; + + if (RefTimerID != CurrentRunningTimerID) + { + previous_id = aTimerContext[RefTimerID].PreviousID; + + aTimerContext[previous_id].NextID = TimerID; + aTimerContext[TimerID].NextID = RefTimerID; + aTimerContext[TimerID].PreviousID = previous_id; + aTimerContext[RefTimerID].PreviousID = TimerID; + } + else + { + aTimerContext[TimerID].NextID = RefTimerID; + aTimerContext[RefTimerID].PreviousID = TimerID; + } + + return; +} + +/** + * @brief Insert a Timer in the list + * @param TimerID: The ID of the Timer + * @retval None + */ +static uint16_t linkTimer(uint8_t TimerID) +{ + uint32_t time_left; + uint16_t time_elapsed; + uint8_t timer_id_lookup; + uint8_t next_id; + + if (CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + /** + * No timer in the list + */ + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = TimerID; + aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; + + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + time_elapsed = 0; + } + else + { + time_elapsed = ReturnTimeElapsed(); + + /** + * update count of the timer to be linked + */ + aTimerContext[TimerID].CountLeft += time_elapsed; + time_left = aTimerContext[TimerID].CountLeft; + + /** + * Search for index where the new timer shall be linked + */ + if (aTimerContext[CurrentRunningTimerID].CountLeft <= time_left) + { + /** + * Search for the ID after the first one + */ + timer_id_lookup = CurrentRunningTimerID; + next_id = aTimerContext[timer_id_lookup].NextID; + while ((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left)) + { + timer_id_lookup = aTimerContext[timer_id_lookup].NextID; + next_id = aTimerContext[timer_id_lookup].NextID; + } + + /** + * Link after the ID + */ + LinkTimerAfter(TimerID, timer_id_lookup); + } + else + { + /** + * Link before the first ID + */ + LinkTimerBefore(TimerID, CurrentRunningTimerID); + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = TimerID; + } + } + + return time_elapsed; +} + +/** + * @brief Remove a Timer from the list + * @param TimerID: The ID of the Timer + * @param RequestReadSSR: Request to read the SSR register or not + * @retval None + */ +static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR) +{ + uint8_t previous_id; + uint8_t next_id; + + if (TimerID == CurrentRunningTimerID) + { + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = aTimerContext[TimerID].NextID; + } + else + { + previous_id = aTimerContext[TimerID].PreviousID; + next_id = aTimerContext[TimerID].NextID; + + aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID; + if (next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID; + } + } + + /** + * Timer is out of the list + */ + aTimerContext[TimerID].TimerIDStatus = TimerID_Created; + + if ((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested)) + { + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + } + + return; +} + +/** + * @brief Return the number of ticks counted by the wakeuptimer since it has been started + * @note The API is reading the SSR register to get how many ticks have been counted + * since the time the timer has been started + * @param None + * @retval Time expired in Ticks + */ +static uint16_t ReturnTimeElapsed(void) +{ + uint32_t return_value; + uint32_t wrap_counter; + + if (SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE) + { + return_value = ReadRtcSsrValue(); /**< Read SSR register first */ + + if (SSRValueOnLastSetup >= return_value) + { + return_value = SSRValueOnLastSetup - return_value; + } + else + { + wrap_counter = SynchPrescalerUserConfig - return_value; + return_value = SSRValueOnLastSetup + wrap_counter; + } + + /** + * At this stage, ReturnValue holds the number of ticks counted by SSR + * Need to translate in number of ticks counted by the Wakeuptimer + */ + return_value = return_value * AsynchPrescalerUserConfig; + return_value = return_value >> WakeupTimerDivider; + } + else + { + return_value = 0; + } + + return (uint16_t) return_value; +} + +/** + * @brief Set the wakeup counter + * @note The API is writing the counter value so that the value is decreased by one to cope with the fact + * the interrupt is generated with 1 extra clock cycle (See RefManuel) + * It assumes all condition are met to be allowed to write the wakeup counter + * @param Value: Value to be written in the counter + * @retval None + */ +static void RestartWakeupCounter(uint16_t Value) +{ + /** + * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF + * FLAG when the new value will have to be written + * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); + */ + + if (Value == 0) + { + SSRValueOnLastSetup = ReadRtcSsrValue(); + + /** + * Simulate that the Timer expired + */ + HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); + } + else + { + if ((Value > 1) || (WakeupTimerDivider != 1)) + { + Value -= 1; + } + + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + + MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value); + + /** + * Update the value here after the WUTWF polling that may take some time + */ + SSRValueOnLastSetup = ReadRtcSsrValue(); + + __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */ + + HW_TS_RTC_CountUpdated_AppNot(); + } + + return; +} + +/** + * @brief Reschedule the list of timer + * @note 1) Update the count left for each timer in the list + * 2) Setup the wakeuptimer + * @param None + * @retval None + */ +static void RescheduleTimerList(void) +{ + uint8_t localTimerID; + uint32_t timecountleft; + uint16_t wakeup_timer_value; + uint16_t time_elapsed; + + /** + * The wakeuptimer is disabled now to reduce the time to poll the WUTWF + * FLAG when the new value will have to be written + */ + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + /** + * Wait for the flag to be back to 0 when the wakeup timer is enabled + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET) + ; + } + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + + localTimerID = CurrentRunningTimerID; + + /** + * Calculate what will be the value to write in the wakeuptimer + */ + timecountleft = aTimerContext[localTimerID].CountLeft; + + /** + * Read how much has been counted + */ + time_elapsed = ReturnTimeElapsed(); + + if (timecountleft < time_elapsed) + { + /** + * There is no tick left to count + */ + wakeup_timer_value = 0; + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + } + else + { + if (timecountleft > (time_elapsed + MaxWakeupTimerSetup)) + { + /** + * The number of tick left is greater than the Wakeuptimer maximum value + */ + wakeup_timer_value = MaxWakeupTimerSetup; + + WakeupTimerLimitation = WakeupTimerValue_Overpassed; + } + else + { + wakeup_timer_value = timecountleft - time_elapsed; + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + } + } + + /** + * update ticks left to be counted for each timer + */ + while (localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + if (aTimerContext[localTimerID].CountLeft < time_elapsed) + { + aTimerContext[localTimerID].CountLeft = 0; + } + else + { + aTimerContext[localTimerID].CountLeft -= time_elapsed; + } + localTimerID = aTimerContext[localTimerID].NextID; + } + + /** + * Write next count + */ + RestartWakeupCounter(wakeup_timer_value); + + return; +} + +/* Public functions ----------------------------------------------------------*/ + +/** + * For all public interface except that may need write access to the RTC, the RTC + * shall be unlock at the beginning and locked at the output + * In order to ease maintainability, the unlock is done at the top and the lock at then end + * in case some new implementation is coming in the future + */ + +void HW_TS_RTC_Wakeup_Handler(void) +{ + HW_TS_pTimerCb_t ptimer_callback; + uint32_t timer_process_id; + uint8_t local_current_running_timer_id; +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + /** + * Disable the Wakeup Timer + * This may speed up a bit the processing to wait the timer to be disabled + * The timer is still counting 2 RTCCLK + */ + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); + + local_current_running_timer_id = CurrentRunningTimerID; + + if (aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running) + { + ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack; + timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID; + + /** + * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted + * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick + * to be left whereas the count is over + * A more secure implementation has been done with a flag to state whereas the full count has been written + * in the wakeuptimer or not + */ + if (WakeupTimerLimitation != WakeupTimerValue_Overpassed) + { + if (aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated) + { + UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested); +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit); + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + } + else + { +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + HW_TS_Stop(local_current_running_timer_id); + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + } + + HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback); + } + else + { + RescheduleTimerList(); +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + } + } + else + { + /** + * We should never end up in this case + * However, if due to any bug in the timer server this is the case, the mistake may not impact the user. + * We could just clean the interrupt flag and get out from this unexpected interrupt + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + return; +} + +void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef * hrtc) +{ + uint8_t loop; + uint32_t localmaxwakeuptimersetup; + + /** + * Get RTC handler + */ + phrtc = hrtc; + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + SET_BIT(RTC->CR, RTC_CR_BYPSHAD); + + /** + * Readout the user config + */ + WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL)))); + + AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t) POSITION_VAL(RTC_PRER_PREDIV_A)) + 1; + + SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1; + + /** + * Margin is taken to avoid wrong calculation when the wrap around is there and some + * application interrupts may have delayed the reading + */ + localmaxwakeuptimersetup = + ((((SynchPrescalerUserConfig - 1) * AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider); + + if (localmaxwakeuptimersetup >= 0xFFFF) + { + MaxWakeupTimerSetup = 0xFFFF; + } + else + { + MaxWakeupTimerSetup = (uint16_t) localmaxwakeuptimersetup; + } + + /** + * Configure EXTI module + */ + LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); + LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); + + if (TimerInitMode == hw_ts_InitMode_Full) + { + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + + /** + * Initialize the timer server + */ + for (loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++) + { + aTimerContext[loop].TimerIDStatus = TimerID_Free; + } + + CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */ + + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */ + } + else + { + if (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET) + { + /** + * Simulate that the Timer expired + */ + HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); + } + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, + CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */ + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + + return; +} + +HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t * pTimerId, HW_TS_Mode_t TimerMode, + HW_TS_pTimerCb_t pftimeout_handler) +{ + HW_TS_ReturnStatus_t localreturnstatus; + uint8_t loop = 0; +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + while ((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free)) + { + loop++; + } + + if (loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[loop].TimerIDStatus = TimerID_Created; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + aTimerContext[loop].TimerProcessID = TimerProcessID; + aTimerContext[loop].TimerMode = TimerMode; + aTimerContext[loop].pTimerCallBack = pftimeout_handler; + *pTimerId = loop; + + localreturnstatus = hw_ts_Successful; + } + else + { +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + localreturnstatus = hw_ts_Failed; + } + + return (localreturnstatus); +} + +void HW_TS_Delete(uint8_t timer_id) +{ + HW_TS_Stop(timer_id); + + aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */ + + return; +} + +void HW_TS_Stop(uint8_t timer_id) +{ + uint8_t localcurrentrunningtimerid; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */ + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + if (aTimerContext[timer_id].TimerIDStatus == TimerID_Running) + { + UnlinkTimer(timer_id, SSR_Read_Requested); + localcurrentrunningtimerid = CurrentRunningTimerID; + + if (localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + /** + * List is empty + */ + + /** + * Disable the timer + */ + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + /** + * Wait for the flag to be back to 0 when the wakeup timer is enabled + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET) + ; + } + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + } + else if (PreviousRunningTimerID != localcurrentrunningtimerid) + { + RescheduleTimerList(); + } + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + return; +} + +void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks) +{ + uint16_t time_elapsed; + uint8_t localcurrentrunningtimerid; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + + if (aTimerContext[timer_id].TimerIDStatus == TimerID_Running) + { + HW_TS_Stop(timer_id); + } + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */ + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + aTimerContext[timer_id].TimerIDStatus = TimerID_Running; + + aTimerContext[timer_id].CountLeft = timeout_ticks; + aTimerContext[timer_id].CounterInit = timeout_ticks; + + time_elapsed = linkTimer(timer_id); + + localcurrentrunningtimerid = CurrentRunningTimerID; + + if (PreviousRunningTimerID != localcurrentrunningtimerid) + { + RescheduleTimerList(); + } + else + { + aTimerContext[timer_id].CountLeft -= time_elapsed; + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + return; +} + +uint16_t HW_TS_RTC_ReadLeftTicksToCount(void) +{ + uint32_t primask_bit; + uint16_t return_value, auro_reload_value, elapsed_time_value; + + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ + + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT)); + + elapsed_time_value = ReturnTimeElapsed(); + + if (auro_reload_value > elapsed_time_value) + { + return_value = auro_reload_value - elapsed_time_value; + } + else + { + return_value = 0; + } + } + else + { + return_value = TIMER_LIST_EMPTY; + } + + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ + + return (return_value); +} + +__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack) +{ + pTimerCallBack(); + + return; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c new file mode 100644 index 00000000000000..f647dc4f87993f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c @@ -0,0 +1,469 @@ +/** + ****************************************************************************** + * @file hw_uart.c + * @author MCD Application Team + * @brief hardware access + ****************************************************************************** + * @attention + * + * Copyright (c) 2018(-2021) STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "hw_conf.h" + +/* Macros --------------------------------------------------------------------*/ +#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + (__HANDLE__).Instance = (__USART_BASE__); \ + (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \ + (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \ + (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \ + (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \ + (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \ + (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \ + (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \ + (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \ + HAL_UART_Init(&(__HANDLE__)); \ + } while (0) + +#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + HW_##__HANDLE__##RxCb = cb; \ + (__HANDLE__).Instance = (__USART_BASE__); \ + HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \ + } while (0) + +#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + HW_##__HANDLE__##TxCb = cb; \ + (__HANDLE__).Instance = (__USART_BASE__); \ + HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \ + } while (0) + +#define HW_UART_TX(__HANDLE__, __USART_BASE__) \ + do \ + { \ + (__HANDLE__).Instance = (__USART_BASE__); \ + hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \ + } while (0) + +#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + /* Enable GPIO clock */ \ + CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \ + \ + /* Enable USART clock */ \ + __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \ + \ + CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \ + \ + CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \ + \ + HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, \ + CFG_HW_##__USART_BASE__##_SUBPRIORITY); \ + HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \ + } while (0) + +#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + /* Configure the DMA handler for Transmission process */ \ + /* Enable DMA clock */ \ + CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \ + /* Enable DMA MUX clock */ \ + CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \ + \ + HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \ + HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \ + HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \ + HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \ + HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \ + HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \ + HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \ + HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \ + HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \ + \ + HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \ + \ + /* Associate the initialized DMA handle to the UART handle */ \ + __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \ + \ + /* NVIC configuration for DMA transfer complete interrupt */ \ + HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, \ + CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \ + HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \ + } while (0) + +/* Variables ------------------------------------------------------------------*/ +#if (CFG_HW_USART1_ENABLED == 1) +UART_HandleTypeDef huart1 = { 0 }; +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) +DMA_HandleTypeDef HW_hdma_huart1_tx = { 0 }; +#endif +void (*HW_huart1RxCb)(void); +void (*HW_huart1TxCb)(void); +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) +UART_HandleTypeDef lpuart1 = { 0 }; +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) +DMA_HandleTypeDef HW_hdma_lpuart1_tx = { 0 }; +#endif +void (*HW_lpuart1RxCb)(void); +void (*HW_lpuart1TxCb)(void); +#endif + +void HW_UART_Init(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_INIT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_INIT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_RX_IT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_RX_IT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_TX_IT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_TX_IT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, uint32_t timeout) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + hw_status_t hw_status = hw_uart_ok; + + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_TX(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_TX(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + switch (hal_status) + { + case HAL_OK: + hw_status = hw_uart_ok; + break; + + case HAL_ERROR: + hw_status = hw_uart_error; + break; + + case HAL_BUSY: + hw_status = hw_uart_busy; + break; + + case HAL_TIMEOUT: + hw_status = hw_uart_to; + break; + + default: + break; + } + + return hw_status; +} + +hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + hw_status_t hw_status = hw_uart_ok; + + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_huart1TxCb = cb; + huart1.Instance = USART1; + hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size); + break; +#endif + +#if (CFG_HW_USART2_ENABLED == 1) + case hw_uart2: + HW_huart2TxCb = cb; + huart2.Instance = USART2; + hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_lpuart1TxCb = cb; + lpuart1.Instance = LPUART1; + hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size); + break; +#endif + + default: + break; + } + + switch (hal_status) + { + case HAL_OK: + hw_status = hw_uart_ok; + break; + + case HAL_ERROR: + hw_status = hw_uart_error; + break; + + case HAL_BUSY: + hw_status = hw_uart_busy; + break; + + case HAL_TIMEOUT: + hw_status = hw_uart_to; + break; + + default: + break; + } + + return hw_status; +} + +void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HAL_UART_IRQHandler(&huart1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HAL_UART_IRQHandler(&lpuart1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) + case hw_uart1: + HAL_DMA_IRQHandler(huart1.hdmatx); + break; +#endif + +#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1) + case hw_uart2: + HAL_DMA_IRQHandler(huart2.hdmatx); + break; +#endif + +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) + case hw_lpuart1: + HAL_DMA_IRQHandler(lpuart1.hdmatx); + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_MspInit(UART_HandleTypeDef * huart) +{ + GPIO_InitTypeDef GPIO_InitStruct = { 0 }; + + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + HW_UART_MSP_UART_INIT(huart1, USART1); +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) + HW_UART_MSP_TX_DMA_INIT(huart1, USART1); +#endif + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + HW_UART_MSP_UART_INIT(lpuart1, LPUART1); +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) + HW_UART_MSP_TX_DMA_INIT(lpuart1, LPUART1); +#endif + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) +{ + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + if (HW_huart1RxCb) + { + HW_huart1RxCb(); + } + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + if (HW_lpuart1RxCb) + { + HW_lpuart1RxCb(); + } + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_TxCpltCallback(UART_HandleTypeDef * huart) +{ + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + if (HW_huart1TxCb) + { + HW_huart1TxCb(); + } + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + if (HW_lpuart1TxCb) + { + HW_lpuart1TxCb(); + } + break; +#endif + + default: + break; + } + + return; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp b/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp new file mode 100644 index 00000000000000..a48e8b88dc6101 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp @@ -0,0 +1,439 @@ +/** + ****************************************************************************** + * @file : app_main.cpp + * @author : MCD Application Team + * @brief : Main program body + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### IMPORTANT NOTE ##### + ============================================================================== + + This application requests having the stm32wb5x_BLE_Thread_ForMatter_fw.bin binary + flashed on the Wireless Coprocessor. + If it is not the case, you need to use STM32CubeProgrammer to load the appropriate + binary. + + All available binaries are located under following directory: + /Projects/STM32_Copro_Wireless_Binaries + + Refer to UM2237 to learn how to use/install STM32CubeProgrammer. + Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the + detailed procedure to change the Wireless Coprocessor binary. + + @endverbatim + ****************************************************************************** + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "AppTask.h" +#include "STM32FreeRtosHooks.h" +#include "app_common.h" +#include "app_entry.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "flash_wb.h" +#include "stm32_lpm.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Global variables ---------------------------------------------------------*/ + +RTC_HandleTypeDef hrtc = { 0 }; /**< RTC handler declaration */ +RNG_HandleTypeDef hrng; +IPCC_HandleTypeDef hipcc; + +void Error_Handler(void); +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static void Reset_BackupDomain(void); +static void Init_RTC(void); +static void Reset_Device(void); +static void Reset_IPCC(void); +static void Init_Exti(void); +static void MX_GPIO_Init(void); +static void MX_RNG_Init(void); +static void MX_IPCC_Init(void); +static void PeriphCommonClock_Config(void); +static void SystemClock_Config(void); +/* USER CODE BEGIN PFP */ + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Main program + * @param None + * @retval None + */ +int main(void) +{ + /* STM32WBxx HAL library initialization: + - Configure the Flash prefetch + - Systick timer is configured by default as source of time base, but user + can eventually implement his proper time base source (a general purpose + timer for example or other time source), keeping in mind that Time base + duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and + handled in milliseconds basis. + - Set NVIC Group Priority to 4 + - Low Level Initialization + */ + /* USER CODE END 1 */ + /** + * The OPTVERR flag is wrongly set at power on + * It shall be cleared before using any HAL_FLASH_xxx() api + */ + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR); + + /** + * Reset some configurations so that the system behave in the same way + * when either out of nReset or Power On + */ + Reset_Device(); + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + PeriphCommonClock_Config(); + /* USER CODE BEGIN SysInit */ + /* Set default off value for each leds */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + Init_Exti(); + MX_RNG_Init(); + Init_RTC(); + osKernelInitialize(); + MX_GPIO_Init(); + /* IPCC initialisation */ + MX_IPCC_Init(); + NM_Init(); + freertos_mbedtls_init(); + + APPE_Init(); + GetAppTask().InitMatter(); + osKernelStart(); + while (1) + { + } +} + +static void MX_RNG_Init(void) +{ + + /* USER CODE BEGIN RNG_Init 0 */ + + /* USER CODE END RNG_Init 0 */ + + /* USER CODE BEGIN RNG_Init 1 */ + + /* USER CODE END RNG_Init 1 */ + hrng.Instance = RNG; + hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; + if (HAL_RNG_Init(&hrng) != HAL_OK) + { + } + /* USER CODE BEGIN RNG_Init 2 */ + + /* USER CODE END RNG_Init 2 */ +} + +/** + * @brief IPCC Initialization Function + * @param None + * @retval None + */ +static void MX_IPCC_Init(void) +{ + + /* USER CODE BEGIN IPCC_Init 0 */ + + /* USER CODE END IPCC_Init 0 */ + + /* USER CODE BEGIN IPCC_Init 1 */ + + /* USER CODE END IPCC_Init 1 */ + hipcc.Instance = IPCC; + if (HAL_IPCC_Init(&hipcc) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN IPCC_Init 2 */ + + /* USER CODE END IPCC_Init 2 */ +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Init_Exti(void) +{ + /**< Disable all wakeup interrupt on CPU1 except LPUART(25), IPCC(36), HSEM(38) */ + LL_EXTI_DisableIT_0_31((~0) & (~(LL_EXTI_LINE_25))); + LL_EXTI_DisableIT_32_63((~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38))); + + return; +} + +static void Reset_Device(void) +{ +#if (CFG_HW_RESET_BY_FW == 1) + Reset_BackupDomain(); + + Reset_IPCC(); +#endif + + return; +} + +static void Reset_IPCC(void) +{ + LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | LL_IPCC_CHANNEL_5 | + LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_ClearFlag_CHx(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | LL_IPCC_CHANNEL_5 | + LL_IPCC_CHANNEL_6); + + LL_C1_IPCC_DisableTransmitChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_DisableTransmitChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C1_IPCC_DisableReceiveChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_DisableReceiveChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + return; +} + +static void Reset_BackupDomain(void) +{ + if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE)) + { + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_BACKUPRESET_FORCE(); + __HAL_RCC_BACKUPRESET_RELEASE(); + } + + return; +} + +static void Init_RTC(void) +{ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSI as RTC Input */ + + __HAL_RCC_RTC_ENABLE(); /**< Enable RTC */ + + hrtc.Instance = RTC; /**< Define instance */ + + /** + * Set the Asynchronous prescaler + */ + hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER; + hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER; + HAL_RTC_Init(&hrtc); + + /* Disable RTC registers write protection */ + LL_RTC_DisableWriteProtection(RTC); + + LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER); + + /* Enable RTC registers write protection */ + LL_RTC_EnableWriteProtection(RTC); + + return; +} + +/** + * @brief Configure the system clock + * + * @note This API configures + * - The system clock source + * - The AHBCLK, APBCLK dividers + * - The flash latency + * - The PLL settings (when required) + * + * @param None + * @retval None + */ +static void PeriphCommonClock_Config(void) +{ + + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS; + PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI; + PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1; + + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + Error_Handler(); + } +} + +static void SystemClock_Config(void) +{ + /** + * Write twice the value to flush the APB-AHB bridge to ensure the bit is written + */ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + HAL_PWR_EnableBkUpAccess(); + /** + * Select LSE clock + */ + LL_RCC_LSE_Enable(); + while (!LL_RCC_LSE_IsReady()) + ; + /** + * Select wakeup source of BLE RF + */ + LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); + + RCC_OscInitTypeDef RCC_OscInitStruct = { 0 }; + RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 }; + + /** Configure the main internal regulator output voltage + */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1; + RCC_OscInitStruct.PLL.PLLN = 16; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV4; + RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4 | RCC_CLOCKTYPE_HCLK2 | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV2; + RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) + { + Error_Handler(); + } + + return; +} + +static void MX_GPIO_Init(void) +{ + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); +} + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +/** + * @brief Period elapsed callback in non blocking mode + * @note This function is called when TIM17 interrupt took place, inside + * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment + * a global variable "uwTick" used as application time base. + * @param htim : TIM handle + * @retval None + */ +void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef * htim) +{ + /* USER CODE BEGIN Callback 0 */ + + /* USER CODE END Callback 0 */ + if (htim->Instance == TIM17) + { + HAL_IncTick(); + } + /* USER CODE BEGIN Callback 1 */ + + /* USER CODE END Callback 1 */ +} + +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + while (1) + { + HAL_Delay(100); + } + /* USER CODE END Error_Handler_Debug */ +} + +void RTOS_AppConfigureTimerForRuntimeStats() {} + +uint32_t RTOS_AppGetRuntimeCounterValueFromISR() + +{ + + return HAL_GetTick(); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c new file mode 100644 index 00000000000000..ee2d71467514b5 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c @@ -0,0 +1,49 @@ +/** + ****************************************************************************** + * @file otp.c + * @author MCD Application Team + * @brief OTP manager + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "utilities_common.h" + +#include "otp.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Functions Definition ------------------------------------------------------*/ + +uint8_t * OTP_Read(uint8_t id) +{ + uint8_t * p_id; + + p_id = (uint8_t *) (CFG_OTP_END_ADDRESS - 7); + + while (((*(p_id + 7)) != id) && (p_id != (uint8_t *) CFG_OTP_BASE_ADDRESS)) + { + p_id -= 8; + } + + if ((*(p_id + 7)) != id) + { + p_id = 0; + } + + return p_id; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c new file mode 100644 index 00000000000000..93c75f71f6aa40 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c @@ -0,0 +1,349 @@ +/* USER CODE BEGIN Header */ +/** + *************************************************************************************** + * File Name : stm32_lpm_if.c + * Description : Low layer function to enter/exit low power modes (stop, sleep). + *************************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32_lpm_if.h" +#include "app_conf.h" +#include "stm32_lpm.h" +/* USER CODE BEGIN include */ + +/* USER CODE END include */ + +/* Exported variables --------------------------------------------------------*/ +const struct UTIL_LPM_Driver_s UTIL_PowerDriver = { + PWR_EnterSleepMode, PWR_ExitSleepMode, + + PWR_EnterStopMode, PWR_ExitStopMode, + + PWR_EnterOffMode, PWR_ExitOffMode, +}; + +/* Private function prototypes -----------------------------------------------*/ +static void Switch_On_HSI(void); +static void EnterLowPower(void); +static void ExitLowPower(void); +/* USER CODE BEGIN Private_Function_Prototypes */ + +/* USER CODE END Private_Function_Prototypes */ +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN Private_Typedef */ + +/* USER CODE END Private_Typedef */ +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Private_Define */ + +/* USER CODE END Private_Define */ +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Private_Macro */ + +/* USER CODE END Private_Macro */ +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN Private_Variables */ + +/* USER CODE END Private_Variables */ + +/* Functions Definition ------------------------------------------------------*/ +/** + * @brief Enters Low Power Off Mode + * @param none + * @retval none + */ +void PWR_EnterOffMode(void) +{ + /* USER CODE BEGIN PWR_EnterOffMode_1 */ + + /* USER CODE END PWR_EnterOffMode_1 */ + /** + * The systick should be disabled for the same reason than when the device enters stop mode because + * at this time, the device may enter either OffMode or StopMode. + */ + HAL_SuspendTick(); + + EnterLowPower(); + + /************************************************************************************ + * ENTER OFF MODE + ***********************************************************************************/ + /* + * There is no risk to clear all the WUF here because in the current implementation, this API is called + * in critical section. If an interrupt occurs while in that critical section before that point, + * the flag is set and will be cleared here but the system will not enter Off Mode + * because an interrupt is pending in the NVIC. The ISR will be executed when moving out + * of this critical section + */ + LL_PWR_ClearFlag_WU(); + + LL_PWR_SetPowerMode(LL_PWR_MODE_STANDBY); + + LL_LPM_EnableDeepSleep(); /**< Set SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + + /* USER CODE BEGIN PWR_EnterOffMode_2 */ + + /* USER CODE END PWR_EnterOffMode_2 */ + return; +} + +/** + * @brief Exits Low Power Off Mode + * @param none + * @retval none + */ +void PWR_ExitOffMode(void) +{ + /* USER CODE BEGIN PWR_ExitOffMode_1 */ + + /* USER CODE END PWR_ExitOffMode_1 */ + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitOffMode_2 */ + + /* USER CODE END PWR_ExitOffMode_2 */ + return; +} + +/** + * @brief Enters Low Power Stop Mode + * @note ARM exists the function when waking up + * @param none + * @retval none + */ +void PWR_EnterStopMode(void) +{ + /* USER CODE BEGIN PWR_EnterStopMode_1 */ + + /* USER CODE END PWR_EnterStopMode_1 */ + /** + * When HAL_DBGMCU_EnableDBGStopMode() is called to keep the debugger active in Stop Mode, + * the systick shall be disabled otherwise the cpu may crash when moving out from stop mode + * + * When in production, the HAL_DBGMCU_EnableDBGStopMode() is not called so that the device can reach best power consumption + * However, the systick should be disabled anyway to avoid the case when it is about to expire at the same time the device + * enters stop mode ( this will abort the Stop Mode entry ). + */ + HAL_SuspendTick(); + + /** + * This function is called from CRITICAL SECTION + */ + EnterLowPower(); + + /************************************************************************************ + * ENTER STOP MODE + ***********************************************************************************/ + LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2); + + LL_LPM_EnableDeepSleep(); /**< Set SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + + /* USER CODE BEGIN PWR_EnterStopMode_2 */ + + /* USER CODE END PWR_EnterStopMode_2 */ + return; +} + +/** + * @brief Exits Low Power Stop Mode + * @note Enable the pll at 32MHz + * @param none + * @retval none + */ +void PWR_ExitStopMode(void) +{ + /* USER CODE BEGIN PWR_ExitStopMode_1 */ + + /* USER CODE END PWR_ExitStopMode_1 */ + /** + * This function is called from CRITICAL SECTION + */ + ExitLowPower(); + + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitStopMode_2 */ + + /* USER CODE END PWR_ExitStopMode_2 */ + return; +} + +/** + * @brief Enters Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_EnterSleepMode(void) +{ + /* USER CODE BEGIN PWR_EnterSleepMode_1 */ + + /* USER CODE END PWR_EnterSleepMode_1 */ + + HAL_SuspendTick(); + + /************************************************************************************ + * ENTER SLEEP MODE + ***********************************************************************************/ + LL_LPM_EnableSleep(); /**< Clear SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + /* USER CODE BEGIN PWR_EnterSleepMode_2 */ + + /* USER CODE END PWR_EnterSleepMode_2 */ + return; +} + +/** + * @brief Exits Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_ExitSleepMode(void) +{ + /* USER CODE BEGIN PWR_ExitSleepMode_1 */ + + /* USER CODE END PWR_ExitSleepMode_1 */ + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitSleepMode_2 */ + + /* USER CODE END PWR_ExitSleepMode_2 */ + return; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +/** + * @brief Setup the system to enter either stop or off mode + * @param none + * @retval none + */ +static void EnterLowPower(void) +{ + /** + * This function is called from CRITICAL SECTION + */ + + while (LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID)) + ; + + if (!LL_HSEM_1StepLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID)) + { + if (LL_PWR_IsActiveFlag_C2DS() || LL_PWR_IsActiveFlag_C2SB()) + { + /* Release ENTRY_STOP_MODE semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0); + + Switch_On_HSI(); + } + } + else + { + Switch_On_HSI(); + } + + /* Release RCC semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, 0); + + return; +} + +/** + * @brief Restore the system to exit stop mode + * @param none + * @retval none + */ +static void ExitLowPower(void) +{ + /* Release ENTRY_STOP_MODE semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0); + + while (LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID)) + ; + + if (LL_RCC_GetSysClkSource() == LL_RCC_SYS_CLKSOURCE_STATUS_HSI) + { + /* Restore the clock configuration of the application in this user section */ + /* USER CODE BEGIN ExitLowPower_1 */ + LL_RCC_HSE_Enable(); + __HAL_FLASH_SET_LATENCY(FLASH_LATENCY_1); + while (!LL_RCC_HSE_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSE) + ; + /* USER CODE END ExitLowPower_1 */ + } + else + { + /* If the application is not running on HSE restore the clock configuration in this user section */ + /* USER CODE BEGIN ExitLowPower_2 */ + + /* USER CODE END ExitLowPower_2 */ + } + + /* Release RCC semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, 0); + + return; +} + +/** + * @brief Switch the system clock on HSI + * @param none + * @retval none + */ +static void Switch_On_HSI(void) +{ + LL_RCC_HSI_Enable(); + while (!LL_RCC_HSI_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI); + LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI) + ; + return; +} + +/* USER CODE BEGIN Private_Functions */ + +/* USER CODE END Private_Functions */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c new file mode 100644 index 00000000000000..b5fa5b234e778f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c @@ -0,0 +1,385 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm32wbxx_hal_msp.c + * Description : This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ +#include "app_conf.h" +/* USER CODE END Includes */ +extern DMA_HandleTypeDef hdma_lpuart1_tx; +extern DMA_HandleTypeDef hdma_quadspi; +extern DMA_HandleTypeDef hdma_usart1_tx; + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + while (1) + { + HAL_Delay(100); + } + /* USER CODE END Error_Handler_Debug */ +} +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* PVD_PVM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PVD_PVM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(PVD_PVM_IRQn); + /* FLASH_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(FLASH_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(FLASH_IRQn); + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* C2SEV_PWR_C2H_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn); + /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + /* FPU_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(FPU_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(FPU_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + /* USER CODE END MspInit 1 */ +} + +/** + * @brief IPCC MSP Initialization + * This function configures the hardware resources used in this example + * @param hipcc: IPCC handle pointer + * @retval None + */ +void HAL_IPCC_MspInit(IPCC_HandleTypeDef * hipcc) +{ + if (hipcc->Instance == IPCC) + { + /* USER CODE BEGIN IPCC_MspInit 0 */ + + /* USER CODE END IPCC_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_IPCC_CLK_ENABLE(); + /* IPCC interrupt Init */ + HAL_NVIC_SetPriority(IPCC_C1_RX_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_SetPriority(IPCC_C1_TX_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn); + /* USER CODE BEGIN IPCC_MspInit 1 */ + + /* USER CODE END IPCC_MspInit 1 */ + } +} + +/** + * @brief IPCC MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hipcc: IPCC handle pointer + * @retval None + */ +void HAL_IPCC_MspDeInit(IPCC_HandleTypeDef * hipcc) +{ + if (hipcc->Instance == IPCC) + { + /* USER CODE BEGIN IPCC_MspDeInit 0 */ + + /* USER CODE END IPCC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_IPCC_CLK_DISABLE(); + + /* IPCC interrupt DeInit */ + HAL_NVIC_DisableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_DisableIRQ(IPCC_C1_TX_IRQn); + /* USER CODE BEGIN IPCC_MspDeInit 1 */ + + /* USER CODE END IPCC_MspDeInit 1 */ + } +} + +/** + * @brief RTC MSP Initialization + * This function configures the hardware resources used in this example + * @param hrtc: RTC handle pointer + * @retval None + */ +void HAL_RTC_MspInit(RTC_HandleTypeDef * hrtc) +{ + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + if (hrtc->Instance == RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */ + + /* USER CODE END RTC_MspInit 0 */ + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + // Error_Handler(); + } + + /* Peripheral clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER); + /* USER CODE END RTC_MspInit 1 */ + } +} + +/** + * @brief RTC MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hrtc: RTC handle pointer + * @retval None + */ +void HAL_RTC_MspDeInit(RTC_HandleTypeDef * hrtc) +{ + if (hrtc->Instance == RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt DeInit */ + HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ +/** + * @brief RNG MSP Initialization + * This function configures the hardware resources used in this example + * @param hrng: RNG handle pointer + * @retval None + */ +void HAL_RNG_MspInit(RNG_HandleTypeDef * hrng) +{ + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + if (hrng->Instance == RNG) + { + /* USER CODE BEGIN RNG_MspInit 0 */ + + /* USER CODE END RNG_MspInit 0 */ + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RNG; + PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_HSI48; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + } + + /* Peripheral clock enable */ + __HAL_RCC_RNG_CLK_ENABLE(); + /* USER CODE BEGIN RNG_MspInit 1 */ + + /* USER CODE END RNG_MspInit 1 */ + } +} + +/** + * @brief RNG MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hrng: RNG handle pointer + * @retval None + */ +void HAL_RNG_MspDeInit(RNG_HandleTypeDef * hrng) +{ + if (hrng->Instance == RNG) + { + /* USER CODE BEGIN RNG_MspDeInit 0 */ + + /* USER CODE END RNG_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RNG_CLK_DISABLE(); + /* USER CODE BEGIN RNG_MspDeInit 1 */ + + /* USER CODE END RNG_MspDeInit 1 */ + } +} + +/** + * @brief QSPI MSP Initialization + * This function configures the hardware resources used in this example + * @param hqspi: QSPI handle pointer + * @retval None + */ +void HAL_QSPI_MspInit(QSPI_HandleTypeDef * hqspi) +{ + GPIO_InitTypeDef GPIO_InitStruct = { 0 }; + if (hqspi->Instance == QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspInit 0 */ + + /* USER CODE END QUADSPI_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_QSPI_CLK_ENABLE(); + + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**QUADSPI GPIO Configuration + PB9 ------> QUADSPI_BK1_IO0 + PA3 ------> QUADSPI_CLK + PD7 ------> QUADSPI_BK1_IO3 + PD3 ------> QUADSPI_BK1_NCS + PD5 ------> QUADSPI_BK1_IO1 + PD6 ------> QUADSPI_BK1_IO2 + */ + GPIO_InitStruct.Pin = GPIO_PIN_9; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_7 | GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_6; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + /* USER CODE BEGIN QUADSPI_MspInit 1 */ + + /* USER CODE END QUADSPI_MspInit 1 */ + } +} + +/** + * @brief QSPI MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hqspi: QSPI handle pointer + * @retval None + */ +void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef * hqspi) +{ + if (hqspi->Instance == QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspDeInit 0 */ + + /* USER CODE END QUADSPI_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_QSPI_CLK_DISABLE(); + + /**QUADSPI GPIO Configuration + PB9 ------> QUADSPI_BK1_IO0 + PA3 ------> QUADSPI_CLK + PD7 ------> QUADSPI_BK1_IO3 + PD3 ------> QUADSPI_BK1_NCS + PD5 ------> QUADSPI_BK1_IO1 + PD6 ------> QUADSPI_BK1_IO2 + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_9); + + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_3); + + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_7 | GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_6); + + /* QUADSPI DMA DeInit */ + HAL_DMA_DeInit(hqspi->hdma); + + /* QUADSPI interrupt DeInit */ + HAL_NVIC_DisableIRQ(QUADSPI_IRQn); + /* USER CODE BEGIN QUADSPI_MspDeInit 1 */ + + /* USER CODE END QUADSPI_MspDeInit 1 */ + } +} +/* USER CODE END 1 */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c new file mode 100644 index 00000000000000..c2f795f4dd0c43 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c @@ -0,0 +1,149 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_timebase_tim.c + * @author MCD Application Team + * @brief HAL time base based on the hardware TIM. + * + * This file overrides the native HAL time base functions (defined as weak) + * the TIM time base: + * + Initializes the TIM peripheral to generate a Period elapsed Event each 1ms + * + HAL_IncTick is called inside HAL_TIM_PeriodElapsedCallback ie each 1ms + * + ****************************************************************************** + * @attention + * + * Copyright (c) STMicroelectronics +(-2021) STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + This file must be copied to the application folder and modified as follows: + (#) Rename it to 'stm32wbxx_hal_timebase_tim.c' + (#) Add this file and the TIM HAL driver files to your project and make sure + HAL_TIM_MODULE_ENABLED is defined in stm32wbxx_hal_conf.h + + [..] + (@) The application needs to ensure that the time base is always set to 1 millisecond + to have correct HAL operation. + + @endverbatim + ****************************************************************************** + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" +#include "stm32wbxx_hal_tim.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +TIM_HandleTypeDef htim17; +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** + * @brief This function configures the TIM17 as a time base source. + * The time source is configured to have 1ms time base with a dedicated + * Tick interrupt priority. + * @note This function is called automatically at the beginning of program after + * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). + * @param TickPriority: Tick interrupt priority. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) +{ + RCC_ClkInitTypeDef clkconfig; + uint32_t uwTimclock = 0; + uint32_t uwPrescalerValue = 0; + uint32_t pFLatency; + /*Configure the TIM17 IRQ priority */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, TickPriority, 0); + + /* Enable the TIM17 global Interrupt */ + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + + /* Enable TIM17 clock */ + __HAL_RCC_TIM17_CLK_ENABLE(); + + /* Get clock configuration */ + HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); + + /* Compute TIM17 clock */ + uwTimclock = HAL_RCC_GetPCLK2Freq(); + /* Compute the prescaler value to have TIM17 counter clock equal to 1MHz */ + uwPrescalerValue = (uint32_t)((uwTimclock / 1000000U) - 1U); + + /* Initialize TIM17 */ + htim17.Instance = TIM17; + + /* Initialize TIMx peripheral as follow: + + Period = [(TIM17CLK/1000) - 1]. to have a (1/1000) s time base. + + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock. + + ClockDivision = 0 + + Counter direction = Up + */ + htim17.Init.Period = (1000000U / 1000U) - 1U; + htim17.Init.Prescaler = uwPrescalerValue; + htim17.Init.ClockDivision = 0; + htim17.Init.CounterMode = TIM_COUNTERMODE_UP; + + if (HAL_TIM_Base_Init(&htim17) == HAL_OK) + { + /* Start the TIM time Base generation in interrupt mode */ + return HAL_TIM_Base_Start_IT(&htim17); + } + + return HAL_ERROR; +} + +/** + * @brief Suspend Tick increment. + * @note Disable the tick increment by disabling TIM17 update interrupt. + * @param None + * @retval None + */ +void HAL_SuspendTick(void) +{ + /* Disable TIM17 update Interrupt */ + __HAL_TIM_DISABLE_IT(&htim17, TIM_IT_UPDATE); +} + +/** + * @brief Resume Tick increment. + * @note Enable the tick increment by Enabling TIM17 update interrupt. + * @param None + * @retval None + */ +void HAL_ResumeTick(void) +{ + /* Enable TIM17 Update interrupt */ + __HAL_TIM_ENABLE_IT(&htim17, TIM_IT_UPDATE); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c new file mode 100644 index 00000000000000..aa13c0fb6ada54 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c @@ -0,0 +1,193 @@ +/** + ****************************************************************************** + * @file stm32wbxx_it.c + * @author MCD Application Team + * @brief Main Interrupt Service Routines. + * This file provides template for all exceptions handler and + * peripherals interrupt service routine. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_it.h" +#include "app_common.h" + +/* CONCURRENT MODE BLE/THREAD */ +/* External variables -----------------------------------------------------------*/ +extern uint8_t ThreadEnable; +extern TIM_HandleTypeDef htim17; + +/* /THREAD */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/******************************************************************************/ +/* Cortex-M4 Processor Exceptions Handlers */ +/******************************************************************************/ + +/** + * @brief This function handles NMI exception. + * @param None + * @retval None + */ +void NMI_Handler(void) {} + +/** + * @brief This function handles Hard Fault exception. + * @param None + * @retval None + */ +void HardFault_Handler(void) +{ + /* Go to infinite loop when Hard Fault exception occurs */ + while (1) + { + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} +/** + * @brief This function handles SVCall exception. + * @param None + * @retval None + */ +/*void SVC_Handler(void) +{ +}*/ + +/** + * @brief This function handles Debug Monitor exception. + * @param None + * @retval None + */ +void DebugMon_Handler(void) {} + +/** + * @brief This function handles PendSVC exception. + * @param None + * @retval None + */ +/*void PendSV_Handler(void) +{ +}*/ + +/** + * @brief This function handles SysTick Handler. + * @param None + * @retval None + */ +/*void SysTick_Handler(void) +{ + HAL_IncTick(); +}*/ + +void IPCC_C1_TX_IRQHandler(void) +{ + HW_IPCC_Tx_Handler(); + + return; +} + +void IPCC_C1_RX_IRQHandler(void) +{ + HW_IPCC_Rx_Handler(); + return; +} + +/** + * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. + */ +void TIM1_TRG_COM_TIM17_IRQHandler(void) +{ + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ + + HAL_TIM_IRQHandler(&htim17); + + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ +} + +/** + * @brief This function handles External line + * interrupt request. + * @param None + * @retval None + */ + +void EXTI15_10_IRQHandler(void) +{ + BSP_PB_IRQHandler(BUTTON_USER1); +} + +#if (CFG_HW_USART1_ENABLED == 1) +void USART1_IRQHandler(void) +{ + HW_UART_Interrupt_Handler(hw_uart1); +} +#endif + +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) +void CFG_HW_USART1_DMA_TX_IRQHandler(void) +{ + HW_UART_DMA_Interrupt_Handler(hw_uart1); +} +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) +void LPUART1_IRQHandler(void) +{ + HW_UART_Interrupt_Handler(hw_lpuart1); +} +#endif + +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) +void CFG_HW_LPUART1_DMA_TX_IRQHandler(void) +{ + HW_UART_DMA_Interrupt_Handler(hw_lpuart1); +} +#endif + +/******************************************************************************/ +/* STM32L0xx Peripherals Interrupt Handlers */ +/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ +/* available peripheral interrupt handler's name please refer to the startup */ +/* file (startup_stm32l0xx.s). */ +/******************************************************************************/ +/** + * @brief This function handles RTC Auto wake-up interrupt request. + * @param None + * @retval None + */ +void RTC_WKUP_IRQHandler(void) +{ + HW_TS_RTC_Wakeup_Handler(); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c new file mode 100644 index 00000000000000..910a401c70eef5 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c @@ -0,0 +1,207 @@ + +/** + ****************************************************************************** + * @file stm_logging.c + * @author MCD Application Team + * @brief This file contains all the defines and functions used for logging + * on Application examples. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** + * @file + * This file implements logging functions to used in Application examples. + * + */ + +#include +#include +#include +#include +#include +#include + +#include "app_conf.h" +#include "stm_logging.h" + +#define LOG_PARSE_BUFFER_SIZE 256U + +#define LOG_TIMESTAMP_ENABLE 0 +#define LOG_REGION_ENABLE 1U +#define LOG_RTT_COLOR_ENABLE 1U + +#if (LOG_RTT_COLOR_ENABLE == 1U) +#define RTT_COLOR_CODE_DEFAULT "\x1b[0m" +#define RTT_COLOR_CODE_RED "\x1b[0;91m" +#define RTT_COLOR_CODE_GREEN "\x1b[0;92m" +#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m" +#define RTT_COLOR_CODE_CYAN "\x1b[0;96m" + +#else /* LOG_RTT_COLOR_ENABLE == 1 */ +#define RTT_COLOR_CODE_DEFAULT "" +#define RTT_COLOR_CODE_RED "" +#define RTT_COLOR_CODE_GREEN "" +#define RTT_COLOR_CODE_YELLOW "" +#define RTT_COLOR_CODE_CYAN "" +#endif /* LOG_RTT_COLOR_ENABLE == 1 */ + +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for outputting code region string. + * + * @param[inout] aLogString Pointer to log buffer. + * @param[in] aMaxSize Maximum size of log buffer. + * @param[in] otLogRegion The region ID. + * + * @returns String with a log level color value. + */ +static inline uint16_t logRegion(char * aLogString, uint16_t aMaxSize, appliLogRegion_t aLogRegion) +{ + char logRegionString[30U]; + + switch (aLogRegion) + { + case APPLI_LOG_REGION_GENERAL: + strcpy(logRegionString, "[M4 APPLICATION]"); + break; + case APPLI_LOG_REGION_OPENTHREAD_API: + strcpy(logRegionString, "[M4 OPENTHREAD API]"); + break; + case APPLI_LOG_REGION_OT_API_LINK: + strcpy(logRegionString, "[M4 LINK API]"); + break; + case APPLI_LOG_REGION_OT_API_INSTANCE: + strcpy(logRegionString, "[M4 INSTANCE API]"); + break; + case APPLI_LOG_REGION_OT_API_MESSAGE: + strcpy(logRegionString, "[M4 MESSAGE API]"); + break; + default: + strcpy(logRegionString, "[M4]"); + break; + } + + return snprintf(aLogString, aMaxSize, "%s ", logRegionString); +} +#endif /* CFG_DEBUG_TRACE */ + +#if (LOG_RTT_COLOR_ENABLE == 1U) +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for getting color of a given level log. + * + * @param[in] aLogLevel The log level. + * + * @returns String with a log level color value. + */ +static inline const char * levelToString(appliLogLevel_t aLogLevel) +{ + switch (aLogLevel) + { + case LOG_LEVEL_CRIT: + return RTT_COLOR_CODE_RED; + + case LOG_LEVEL_WARN: + return RTT_COLOR_CODE_YELLOW; + + case LOG_LEVEL_INFO: + return RTT_COLOR_CODE_GREEN; + + case LOG_LEVEL_DEBG: + default: + return RTT_COLOR_CODE_DEFAULT; + } +} +#endif /* CFG_DEBUG_TRACE */ + +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for printing log level. + * + * @param[inout] aLogString Pointer to log buffer. + * @param[in] aMaxSize Maximum size of log buffer. + * @param[in] aLogLevel Log level. + * + * @returns Number of bytes successfully written to the log buffer. + */ +static inline uint16_t logLevel(char * aLogString, uint16_t aMaxSize, appliLogLevel_t aLogLevel) +{ + return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel)); +} +#endif /* CFG_DEBUG_TRACE */ +#endif /* LOG_RTT_COLOR_ENABLE */ + +#if (LOG_TIMESTAMP_ENABLE == 1U) +/** + * Function for printing actual timestamp. + * + * @param[inout] aLogString Pointer to the log buffer. + * @param[in] aMaxSize Maximum size of the log buffer. + * + * @returns Number of bytes successfully written to the log buffer. + */ +static inline uint16_t logTimestamp(char * aLogString, uint16_t aMaxSize) +{ + return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT, otPlatAlarmMilliGetNow()); +} +#endif /* LOG_TIMESTAMP_ENABLE */ + +/** + * Function for printing application log + * + * @param[in] aLogLevel Log level. + * @param[in] aLogRegion The region ID. + * @param[in] aFormat User string format. + * + * @returns Number of bytes successfully written to the log buffer. + */ +void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char * aFormat, ...) +{ +#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */ + uint16_t length = 0; + char logString[LOG_PARSE_BUFFER_SIZE + 1U]; + +#if (LOG_TIMESTAMP_ENABLE == 1U) + length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE); +#endif + +#if (LOG_RTT_COLOR_ENABLE == 1U) + /* Add level information */ + length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aLogLevel); +#endif + +#if (LOG_REGION_ENABLE == 1U) + /* Add Region information */ + length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aLogRegion); +#endif + + /* Parse user string */ + va_list paramList; + va_start(paramList, aFormat); + length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aFormat, paramList); + logString[length++] = '\r'; + logString[length++] = '\n'; + logString[length++] = 0; + va_end(paramList); + + if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL) + { + printf("%s", logString); + } + else + { + /* Print nothing */ + } +#endif /* CFG_DEBUG_TRACE */ +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c new file mode 100644 index 00000000000000..5e62d7dc9c33ff --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c @@ -0,0 +1,156 @@ +/** + ****************************************************************************** + * @file syscalls.c + * @author Auto-generated by STM32CubeIDE + * @brief STM32CubeIDE Minimal System calls file + * + * For more information about which c-functions + * need which of these lowlevel functions + * please consult the Newlib libc-manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Variables */ +//#undef errno +extern int errno; +extern int __io_putchar(int ch) __attribute__((weak)); +extern int __io_getchar(void) __attribute__((weak)); + +register char * stack_ptr asm("sp"); + +char * __env[1] = { 0 }; +char ** environ = __env; + +/* Functions */ +void initialise_monitor_handles() {} + +int _getpid(void) +{ + return 1; +} + +int _kill(int pid, int sig) +{ + errno = EINVAL; + return -1; +} + +void _exit(int status) +{ + _kill(status, -1); + while (1) + { + } /* Make sure we hang here */ +} + +__attribute__((weak)) int _read(int file, char * ptr, int len) +{ + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + *ptr++ = __io_getchar(); + } + + return len; +} + +__attribute__((weak)) int _write(int file, char * ptr, int len) +{ + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + __io_putchar(*ptr++); + } + return len; +} + +int _close(int file) +{ + return -1; +} + +int _fstat(int file, struct stat * st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +int _isatty(int file) +{ + return 1; +} + +int _lseek(int file, int ptr, int dir) +{ + return 0; +} + +int _open(char * path, int flags, ...) +{ + /* Pretend like we always fail */ + return -1; +} + +int _wait(int * status) +{ + errno = ECHILD; + return -1; +} + +int _unlink(char * name) +{ + errno = ENOENT; + return -1; +} + +int _times(struct tms * buf) +{ + return -1; +} + +int _stat(char * file, struct stat * st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +int _link(char * old, char * new) +{ + errno = EMLINK; + return -1; +} + +int _fork(void) +{ + errno = EAGAIN; + return -1; +} + +int _execve(char * name, char ** argv, char ** env) +{ + errno = ENOMEM; + return -1; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c new file mode 100644 index 00000000000000..7231d53efafcb2 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c @@ -0,0 +1,57 @@ +/** + ****************************************************************************** + * @file sysmem.c + * @author Auto-generated by STM32CubeIDE + * @brief STM32CubeIDE Minimal System Memory calls file + * + * For more information about which c-functions + * need which of these lowlevel functions + * please consult the Newlib libc-manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include +#include + +/* Variables */ +extern int errno; +register char * stack_ptr asm("sp"); + +/* Functions */ + +/** + _sbrk + Increase program data space. Malloc and related functions depend on this +**/ +caddr_t _sbrk(int incr) +{ + extern char end asm("end"); + static char * heap_end; + char * prev_heap_end; + + if (heap_end == 0) + heap_end = &end; + + prev_heap_end = heap_end; + if (heap_end + incr > stack_ptr) + { + errno = ENOMEM; + return (caddr_t) -1; + } + + heap_end += incr; + + return (caddr_t) prev_heap_end; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c new file mode 100644 index 00000000000000..533cc4f0aa9671 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c @@ -0,0 +1,345 @@ +/** + ****************************************************************************** + * @file system_stm32wbxx.c + * @author MCD Application Team + * @brief CMSIS Cortex Device Peripheral Access Layer System Source File + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32wbxx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * After each device reset the MSI (4 MHz) is used as system clock source. + * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to + * configure the system clock before to branch to main program. + * + * This file configures the system clock as follows: + *============================================================================= + *----------------------------------------------------------------------------- + * System Clock source | MSI + *----------------------------------------------------------------------------- + * SYSCLK(Hz) | 4000000 + *----------------------------------------------------------------------------- + * HCLK(Hz) | 4000000 + *----------------------------------------------------------------------------- + * AHB Prescaler | 1 + *----------------------------------------------------------------------------- + * APB1 Prescaler | 1 + *----------------------------------------------------------------------------- + * APB2 Prescaler | 1 + *----------------------------------------------------------------------------- + * PLL_M | 1 + *----------------------------------------------------------------------------- + * PLL_N | 8 + *----------------------------------------------------------------------------- + * PLL_P | 7 + *----------------------------------------------------------------------------- + * PLL_Q | 2 + *----------------------------------------------------------------------------- + * PLL_R | 2 + *----------------------------------------------------------------------------- + * PLLSAI1_P | NA + *----------------------------------------------------------------------------- + * PLLSAI1_Q | NA + *----------------------------------------------------------------------------- + * PLLSAI1_R | NA + *----------------------------------------------------------------------------- + * Require 48MHz for USB OTG FS, | Disabled + * SDIO and RNG clock | + *----------------------------------------------------------------------------- + *============================================================================= + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32WBxx_system + * @{ + */ + +/** @addtogroup stm32WBxx_System_Private_Includes + * @{ + */ + +#include "app_common.h" +#include "otp.h" + +#if !defined(HSE_VALUE) +#define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined(MSI_VALUE) +#define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +#if !defined(HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +#if !defined(LSI_VALUE) +#define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/ +#endif /* LSI_VALUE */ + +#if !defined(LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Defines + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Variables + * @{ + */ +/* The SystemCoreClock variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock; then there + is no need to call the 2 first functions listed above, since SystemCoreClock + variable is updated automatically. + */ +uint32_t SystemCoreClock = 4000000UL; /*CPU1: M4 on MSI clock after startup (4MHz)*/ + +const uint32_t AHBPrescTable[16UL] = { 1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL }; + +const uint32_t APBPrescTable[8UL] = { 0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL }; + +const uint32_t MSIRangeTable[16UL] = { + 100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, 4000000UL, 8000000UL, + 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL +}; /* 0UL values are incorrect cases */ + +#if defined(STM32WB55xx) || defined(STM32WB5Mxx) || defined(STM32WB35xx) || defined(STM32WB15xx) +const uint32_t SmpsPrescalerTable[4UL][6UL] = { { 1UL, 3UL, 2UL, 2UL, 1UL, 2UL }, + { 2UL, 6UL, 4UL, 3UL, 2UL, 4UL }, + { 4UL, 12UL, 8UL, 6UL, 4UL, 8UL }, + { 4UL, 12UL, 8UL, 6UL, 4UL, 8UL } }; +#endif + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system. + * @param None + * @retval None + */ +void SystemInit(void) +{ + OTP_ID0_t * p_otp; + + /* FPU settings ------------------------------------------------------------*/ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << (10UL * 2UL)) | (3UL << (11UL * 2UL))); /* set CP10 and CP11 Full Access */ +#endif + + /** + * Read HSE_Tuning from OTP + */ + p_otp = (OTP_ID0_t *) OTP_Read(0); + if (p_otp) + { + LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning); + } + + LL_RCC_HSE_Enable(); + + /** + * Set FLASH latency to 1WS + */ + LL_FLASH_SetLatency(LL_FLASH_LATENCY_1); + while (LL_FLASH_GetLatency() != LL_FLASH_LATENCY_1) + ; + + /** + * Switch to HSE + * + */ + while (!LL_RCC_HSE_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSE) + ; + + /** + * Switch OFF MSI + */ + LL_RCC_MSI_Disable(); +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*) + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) + * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value + * 4 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value + * 32 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t tmp, msirange, pllvco, pllr, pllsource, pllm; + + /* Get MSI Range frequency--------------------------------------------------*/ + + /*MSI frequency range in Hz*/ + msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos]; + + /*SystemCoreClock=HAL_RCC_GetSysClockFreq();*/ + /* Get SYSCLK source -------------------------------------------------------*/ + switch (RCC->CFGR & RCC_CFGR_SWS) + { + case 0x00: /* MSI used as system clock source */ + SystemCoreClock = msirange; + break; + + case 0x04: /* HSI used as system clock source */ + /* HSI used as system clock source */ + SystemCoreClock = HSI_VALUE; + break; + + case 0x08: /* HSE used as system clock source */ + SystemCoreClock = HSE_VALUE; + break; + + case 0x0C: /* PLL used as system clock source */ + /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN + SYSCLK = PLL_VCO / PLLR + */ + pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); + pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL; + + if (pllsource == 0x02UL) /* HSI used as PLL clock source */ + { + pllvco = (HSI_VALUE / pllm); + } + else if (pllsource == 0x03UL) /* HSE used as PLL clock source */ + { + pllvco = (HSE_VALUE / pllm); + } + else /* MSI used as PLL clock source */ + { + pllvco = (msirange / pllm); + } + + pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos); + pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL); + + SystemCoreClock = pllvco / pllr; + break; + + default: + SystemCoreClock = msirange; + break; + } + + /* Compute HCLK clock frequency --------------------------------------------*/ + /* Get HCLK1 prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)]; + /* HCLK clock frequency */ + SystemCoreClock = SystemCoreClock / tmp; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ diff --git a/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h b/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h new file mode 100644 index 00000000000000..5423994ea0bc12 --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h @@ -0,0 +1,191 @@ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.0.1 + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +#include +extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 0 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (56) +#define configMINIMAL_STACK_SIZE ((uint16_t) 128) +#define configTOTAL_HEAP_SIZE ((size_t) 1024 * 25) +#define configMAX_TASK_NAME_LEN (32) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (2) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS +/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ +#define configPRIO_BITS __NVIC_PRIO_BITS +#else +#define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + ; \ + } +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +//#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +#define configGENERATE_RUN_TIME_STATS 1 + +#if (configGENERATE_RUN_TIME_STATS == 1) + +extern void RTOS_AppConfigureTimerForRuntimeStats(); + +extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR(); + +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats() + +#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR() + +#endif + +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/platform/stm32/config_files/STM32WB5/matter_config.h b/examples/platform/stm32/config_files/STM32WB5/matter_config.h new file mode 100644 index 00000000000000..3ab112ea03b75a --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/matter_config.h @@ -0,0 +1,139 @@ +/** + ****************************************************************************** + * @file matter_config.h + * @author MCD Application Team + * @brief config file for mbedtls + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +#pragma once + +#include +#include +#include + +//#if CHIP_HAVE_CONFIG_H +//#include +//#endif // CHIP_HAVE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Enable H Crypto and Entropy modules + */ +#define MBEDTLS_AES_C +#define MBEDTLS_ECP_C +#define MBEDTLS_ECDH_C +#define MBEDTLS_ENTROPY_C +#define MBEDTLS_SHA224_C +#define MBEDTLS_SHA256_C + +#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf + +#define MBEDTLS_AES_ROM_TABLES +#define MBEDTLS_ASN1_PARSE_C +#define MBEDTLS_ASN1_WRITE_C +#define MBEDTLS_BASE64_C +#define MBEDTLS_BIGNUM_C +#define MBEDTLS_CCM_C +#define MBEDTLS_CIPHER_C +#define MBEDTLS_CMAC_C +#define MBEDTLS_CTR_DRBG_C +#define MBEDTLS_ECDH_LEGACY_CONTEXT +#define MBEDTLS_ECDSA_C +#define MBEDTLS_ECDSA_DETERMINISTIC +#define MBEDTLS_ECJPAKE_C +#define MBEDTLS_ECP_DP_SECP256R1_ENABLED +#define MBEDTLS_ECP_NIST_OPTIM +#define MBEDTLS_ENTROPY_FORCE_SHA256 +#define MBEDTLS_ENTROPY_HARDWARE_ALT +#define MBEDTLS_ERROR_STRERROR_DUMMY +#define MBEDTLS_HAVE_ASM +#define MBEDTLS_HKDF_C +#define MBEDTLS_HMAC_DRBG_C +#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED +#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED +#define MBEDTLS_MD_C + +#define MBEDTLS_NO_PLATFORM_ENTROPY +#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + +#define MBEDTLS_OID_C +#define MBEDTLS_PEM_PARSE_C +#define MBEDTLS_PEM_WRITE_C +#define MBEDTLS_PK_C +#define MBEDTLS_PK_PARSE_C +#define MBEDTLS_PK_WRITE_C +#if CHIP_CRYPTO_MBEDTLS +#define MBEDTLS_PKCS5_C +#endif +#define MBEDTLS_PLATFORM_C +#define MBEDTLS_PLATFORM_MEMORY +#define MBEDTLS_SHA256_SMALLER +#define MBEDTLS_SSL_CLI_C +#define MBEDTLS_SSL_COOKIE_C +#define MBEDTLS_SSL_DTLS_ANTI_REPLAY +#define MBEDTLS_SSL_DTLS_HELLO_VERIFY +#define MBEDTLS_SSL_EXPORT_KEYS +#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE +#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH +#define MBEDTLS_SSL_PROTO_TLS1_2 +#define MBEDTLS_SSL_PROTO_DTLS +#define MBEDTLS_SSL_SRV_C +#define MBEDTLS_SSL_TLS_C + +#if CHIP_CRYPTO_PLATFORM +#define MBEDTLS_USE_PSA_CRYPTO +#endif + +#define MBEDTLS_X509_CREATE_C +#define MBEDTLS_X509_CSR_WRITE_C +#define MBEDTLS_X509_CRL_PARSE_C +#define MBEDTLS_X509_CRT_PARSE_C +#define MBEDTLS_X509_CSR_PARSE_C +#define MBEDTLS_X509_USE_C + +#define MBEDTLS_MPI_WINDOW_SIZE 1 /**< Maximum windows size used. */ +#define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */ +#define MBEDTLS_ECP_MAX_BITS 256 /**< Maximum bit size of groups */ +#define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */ +#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */ +#define MBEDTLS_ENTROPY_MAX_SOURCES 2 /**< Maximum number of sources supported */ + +#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define MBEDTLS_SSL_MAX_CONTENT_LEN 900 /**< Maxium fragment length in bytes */ +#else +#define MBEDTLS_SSL_MAX_CONTENT_LEN 768 /**< Maxium fragment length in bytes */ +#endif + +#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 + +#define MBEDTLS_CIPHER_MODE_WITH_PADDING + +#define MBEDTLS_THREADING_ALT +#define MBEDTLS_THREADING_C +#define MBEDTLS_MEMORY_BUFFER_ALLOC_C +#define MBEDTLS_PKCS5_C + +#define MBEDTLS_ERROR_C 1 + +//#include "check_crypto_config.h" +#include "mbedtls/check_config.h" +#include "mbedtls/config_psa.h" + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/stm32/config_files/STM32WB5/threading_alt.h b/examples/platform/stm32/config_files/STM32WB5/threading_alt.h new file mode 100644 index 00000000000000..253ddd9c0048a0 --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/threading_alt.h @@ -0,0 +1,50 @@ +/* + * FreeRTOS PKCS #11 V2.0.3 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://aws.amazon.com/freertos + * http://www.FreeRTOS.org + */ + +#ifndef __THREADING_ALT_H__ +#define __THREADING_ALT_H__ + +#include "FreeRTOS.h" +#include "semphr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + SemaphoreHandle_t mutex; + char is_valid; +} mbedtls_threading_mutex_t; + +extern void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *), + void (*mutex_free)(mbedtls_threading_mutex_t *), + int (*mutex_lock)(mbedtls_threading_mutex_t *), + int (*mutex_unlock)(mbedtls_threading_mutex_t *)); + +#ifdef __cplusplus +} +#endif +#endif /* ifndef __THREADING_ALT_H__ */ diff --git a/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld b/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld new file mode 100644 index 00000000000000..56292a5b88ac1b --- /dev/null +++ b/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld @@ -0,0 +1,198 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Author : STM32CubeIDE +** +** Abstract : Linker script for STM32WB5MMG Device +** 1024Kbytes FLASH +** 256Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed as is without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +** Copyright (c) 2020 STMicroelectronics. +** All rights reserved. +** +** This software is licensed under terms that can be found in the LICENSE file +** in the root directory of this software component. +** If no LICENSE file comes with this software, it is provided AS-IS. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20026EC4; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400 ; /* required amount of heap */ +_Min_Stack_Size = 0x1000 ; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 520K +NVM_MATTER : ORIGIN = 0x08082000, LENGTH = 0x3000 +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x26EC4 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + +_nvm_matter_init_base = LOADADDR(.nvm_matter); +_nvm_matter_init_length = SIZEOF(.nvm_matter); + + .nvm_matter : + { + . = ALIGN(4); + _nvm_matter_start = .; /* create a global symbol at nvm_matter start */ + *(.nvm_matter) /* .nvm_matter sections */ + *(.nvm_matter*) /* .nvm_matter* sections */ + . = ALIGN(4); + _nvm_matter_end = .; /* define a global symbols at end of nvm_matter */ + + } >NVM_MATTER + + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.RamFunc) /* .RamFunc sections */ + *(.RamFunc*) /* .RamFunc* sections */ + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED + + + + + + +} + + + + diff --git a/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s b/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s new file mode 100644 index 00000000000000..53c16dab9acbe4 --- /dev/null +++ b/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s @@ -0,0 +1,443 @@ +/** + ****************************************************************************** + * @file startup_stm32wb5mxx_cm4.s + * @author MCD Application Team + * @brief STM32WB5Mxx devices vector table GCC toolchain. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* start address for the .MB_MEM2 section. defined in linker script */ +.word _sMB_MEM2 +/* end address for the .MB_MEM2 section. defined in linker script */ +.word _eMB_MEM2 + +/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ +.macro INIT_BSS start, end + ldr r0, =\start + ldr r1, =\end + movs r3, #0 + bl LoopFillZerobss +.endm + +/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ +.macro INIT_DATA start, end, src + ldr r0, =\start + ldr r1, =\end + ldr r2, =\src + movs r3, #0 + bl LoopCopyDataInit +.endm + +.section .text.data_initializers +CopyDataInit: + ldr r4, [r2, r3] + str r4, [r0, r3] + adds r3, r3, #4 + +LoopCopyDataInit: + adds r4, r0, r3 + cmp r4, r1 + bcc CopyDataInit + bx lr + +FillZerobss: + str r3, [r0] + adds r0, r0, #4 + +LoopFillZerobss: + cmp r0, r1 + bcc FillZerobss + bx lr + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: +ldr r0, =_estack + mov sp, r0 /* set stack pointer */ +/* Call the clock system initialization function.*/ + bl SystemInit + +/* Copy the data segment initializers from flash to SRAM */ + INIT_DATA _sdata, _edata, _sidata + +/* Zero fill the bss segments. */ + INIT_BSS _sbss, _ebss + INIT_BSS _sMB_MEM2, _eMB_MEM2 + +/* Call static constructors */ + bl __libc_init_array +/* Call the application s entry point.*/ + bl main + +LoopForever: + b LoopForever + +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex-M4. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + .word WWDG_IRQHandler + .word PVD_PVM_IRQHandler + .word TAMP_STAMP_LSECSS_IRQHandler + .word RTC_WKUP_IRQHandler + .word FLASH_IRQHandler + .word RCC_IRQHandler + .word EXTI0_IRQHandler + .word EXTI1_IRQHandler + .word EXTI2_IRQHandler + .word EXTI3_IRQHandler + .word EXTI4_IRQHandler + .word DMA1_Channel1_IRQHandler + .word DMA1_Channel2_IRQHandler + .word DMA1_Channel3_IRQHandler + .word DMA1_Channel4_IRQHandler + .word DMA1_Channel5_IRQHandler + .word DMA1_Channel6_IRQHandler + .word DMA1_Channel7_IRQHandler + .word ADC1_IRQHandler + .word USB_HP_IRQHandler + .word USB_LP_IRQHandler + .word C2SEV_PWR_C2H_IRQHandler + .word COMP_IRQHandler + .word EXTI9_5_IRQHandler + .word TIM1_BRK_IRQHandler + .word TIM1_UP_TIM16_IRQHandler + .word TIM1_TRG_COM_TIM17_IRQHandler + .word TIM1_CC_IRQHandler + .word TIM2_IRQHandler + .word PKA_IRQHandler + .word I2C1_EV_IRQHandler + .word I2C1_ER_IRQHandler + .word I2C3_EV_IRQHandler + .word I2C3_ER_IRQHandler + .word SPI1_IRQHandler + .word SPI2_IRQHandler + .word USART1_IRQHandler + .word LPUART1_IRQHandler + .word SAI1_IRQHandler + .word TSC_IRQHandler + .word EXTI15_10_IRQHandler + .word RTC_Alarm_IRQHandler + .word CRS_IRQHandler + .word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler + .word IPCC_C1_RX_IRQHandler + .word IPCC_C1_TX_IRQHandler + .word HSEM_IRQHandler + .word LPTIM1_IRQHandler + .word LPTIM2_IRQHandler + .word LCD_IRQHandler + .word QUADSPI_IRQHandler + .word AES1_IRQHandler + .word AES2_IRQHandler + .word RNG_IRQHandler + .word FPU_IRQHandler + .word DMA2_Channel1_IRQHandler + .word DMA2_Channel2_IRQHandler + .word DMA2_Channel3_IRQHandler + .word DMA2_Channel4_IRQHandler + .word DMA2_Channel5_IRQHandler + .word DMA2_Channel6_IRQHandler + .word DMA2_Channel7_IRQHandler + .word DMAMUX1_OVR_IRQHandler + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_PVM_IRQHandler + .thumb_set PVD_PVM_IRQHandler,Default_Handler + + .weak TAMP_STAMP_LSECSS_IRQHandler + .thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Channel1_IRQHandler + .thumb_set DMA1_Channel1_IRQHandler,Default_Handler + + .weak DMA1_Channel2_IRQHandler + .thumb_set DMA1_Channel2_IRQHandler,Default_Handler + + .weak DMA1_Channel3_IRQHandler + .thumb_set DMA1_Channel3_IRQHandler,Default_Handler + + .weak DMA1_Channel4_IRQHandler + .thumb_set DMA1_Channel4_IRQHandler,Default_Handler + + .weak DMA1_Channel5_IRQHandler + .thumb_set DMA1_Channel5_IRQHandler,Default_Handler + + .weak DMA1_Channel6_IRQHandler + .thumb_set DMA1_Channel6_IRQHandler,Default_Handler + + .weak DMA1_Channel7_IRQHandler + .thumb_set DMA1_Channel7_IRQHandler,Default_Handler + + .weak ADC1_IRQHandler + .thumb_set ADC1_IRQHandler,Default_Handler + + .weak USB_HP_IRQHandler + .thumb_set USB_HP_IRQHandler,Default_Handler + + .weak USB_LP_IRQHandler + .thumb_set USB_LP_IRQHandler,Default_Handler + + .weak C2SEV_PWR_C2H_IRQHandler + .thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler + + .weak COMP_IRQHandler + .thumb_set COMP_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_IRQHandler + .thumb_set TIM1_BRK_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM16_IRQHandler + .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM17_IRQHandler + .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak PKA_IRQHandler + .thumb_set PKA_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak LPUART1_IRQHandler + .thumb_set LPUART1_IRQHandler,Default_Handler + + .weak SAI1_IRQHandler + .thumb_set SAI1_IRQHandler,Default_Handler + + .weak TSC_IRQHandler + .thumb_set TSC_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak CRS_IRQHandler + .thumb_set CRS_IRQHandler,Default_Handler + + .weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler + .thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler + + .weak IPCC_C1_RX_IRQHandler + .thumb_set IPCC_C1_RX_IRQHandler,Default_Handler + + .weak IPCC_C1_TX_IRQHandler + .thumb_set IPCC_C1_TX_IRQHandler,Default_Handler + + .weak HSEM_IRQHandler + .thumb_set HSEM_IRQHandler,Default_Handler + + .weak LPTIM1_IRQHandler + .thumb_set LPTIM1_IRQHandler,Default_Handler + + .weak LPTIM2_IRQHandler + .thumb_set LPTIM2_IRQHandler,Default_Handler + + .weak LCD_IRQHandler + .thumb_set LCD_IRQHandler,Default_Handler + + .weak QUADSPI_IRQHandler + .thumb_set QUADSPI_IRQHandler,Default_Handler + + .weak AES1_IRQHandler + .thumb_set AES1_IRQHandler,Default_Handler + + .weak AES2_IRQHandler + .thumb_set AES2_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak DMA2_Channel1_IRQHandler + .thumb_set DMA2_Channel1_IRQHandler,Default_Handler + + .weak DMA2_Channel2_IRQHandler + .thumb_set DMA2_Channel2_IRQHandler,Default_Handler + + .weak DMA2_Channel3_IRQHandler + .thumb_set DMA2_Channel3_IRQHandler,Default_Handler + + .weak DMA2_Channel4_IRQHandler + .thumb_set DMA2_Channel4_IRQHandler,Default_Handler + + .weak DMA2_Channel5_IRQHandler + .thumb_set DMA2_Channel5_IRQHandler,Default_Handler + + .weak DMA2_Channel6_IRQHandler + .thumb_set DMA2_Channel6_IRQHandler,Default_Handler + + .weak DMA2_Channel7_IRQHandler + .thumb_set DMA2_Channel7_IRQHandler,Default_Handler + + .weak DMAMUX1_OVR_IRQHandler + .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler + diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index a87d26cd165cf8..7f8f3812b95e01 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -30,6 +30,7 @@ from builders.nrf import NrfApp, NrfBoard, NrfConnectBuilder from builders.openiotsdk import OpenIotSdkApp, OpenIotSdkBuilder, OpenIotSdkCryptoBackend from builders.qpg import QpgApp, QpgBoard, QpgBuilder +from builders.stm32 import stm32App, stm32Board, stm32Builder from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder from builders.ti import TIApp, TIBoard, TIBuilder from builders.tizen import TizenApp, TizenBoard, TizenBuilder @@ -563,6 +564,22 @@ def BuildQorvoTarget(): return target +def BuildStm32Target(): + target = BuildTarget('stm32', stm32Builder) + + # board + target.AppendFixedTargets([ + TargetPart('STM32WB5MM-DK', board=stm32Board.STM32WB55XX), + ]) + + # apps + target.AppendFixedTargets([ + TargetPart('light', app=stm32App.LIGHT), + ]) + + return target + + def BuildTizenTarget(): target = BuildTarget('tizen', TizenBuilder) @@ -724,6 +741,7 @@ def BuildOpenIotSdkTargets(): BuildNrfTarget(), BuildNrfNativeTarget(), BuildQorvoTarget(), + BuildStm32Target(), BuildTizenTarget(), BuildTelinkTarget(), BuildOpenIotSdkTargets(), diff --git a/scripts/build/builders/stm32.py b/scripts/build/builders/stm32.py new file mode 100644 index 00000000000000..1613ecbbe42f39 --- /dev/null +++ b/scripts/build/builders/stm32.py @@ -0,0 +1,93 @@ +# Copyright (c) 2021 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 os +from enum import Enum, auto + +from .gn import GnBuilder + + +class stm32App(Enum): + LIGHT = auto() + + def ExampleName(self): + if self == stm32App.LIGHT: + return 'lighting-app' + else: + raise Exception('Unknown app type: %r' % self) + + def AppNamePrefix(self): + if self == stm32App.LIGHT: + return 'chip-stm32-lighting-example' + else: + raise Exception('Unknown app type: %r' % self) + + def FlashBundleName(self): + if self == stm32App.LIGHT: + return 'lighting_app.out.flashbundle.txt' + else: + raise Exception('Unknown app type: %r' % self) + + def BuildRoot(self, root): + return os.path.join(root, 'examples', self.ExampleName(), 'stm32') + + +class stm32Board(Enum): + STM32WB55XX = auto() + + def GetIC(self): + if self == stm32Board.STM32WB55XX: + return 'STM32WB5MM-DK' + else: + raise Exception('Unknown board #: %r' % self) + + +class stm32Builder(GnBuilder): + + def __init__(self, + root, + runner, + app: stm32App = stm32App.LIGHT, + board: stm32Board = stm32Board.STM32WB55XX): + super(stm32Builder, self).__init__( + root=app.BuildRoot(root), + runner=runner) + + self.board = board + self.app = app + + stm32_chip = self.board.GetIC() + self.extra_gn_options = ['stm32_ic_family="%s"' % stm32_chip] + + self.extra_gn_options.append('chip_config_network_layer_ble=true') + self.extra_gn_options.append('treat_warnings_as_errors=false') + + def GnBuildArgs(self): + + return self.extra_gn_options + + def build_outputs(self): + items = {} + for extension in ["out", "out.map", "out.hex"]: + name = '%s.%s' % (self.app.AppNamePrefix(), extension) + items[name] = os.path.join(self.output_dir, name) + + # Figure out flash bundle files and build accordingly + with open(os.path.join(self.output_dir, self.app.FlashBundleName())) as f: + for line in f.readlines(): + name = line.strip() + items['flashbundle/%s' % + name] = os.path.join(self.output_dir, name) + + return items diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 8311994a7c28b3..44ca9c3fe2480d 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -20,6 +20,7 @@ mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} +stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index 22ac0fa754bbe9..22750fd40a8bff 100755 --- a/scripts/checkout_submodules.py +++ b/scripts/checkout_submodules.py @@ -41,6 +41,7 @@ 'mbed', 'nrfconnect', 'qpg', + 'stm32', 'telink', 'tizen', 'webos', diff --git a/scripts/examples/gn_stm32_example.sh b/scripts/examples/gn_stm32_example.sh new file mode 100755 index 00000000000000..62c19cc3470de6 --- /dev/null +++ b/scripts/examples/gn_stm32_example.sh @@ -0,0 +1,198 @@ +#!/usr/bin/env bash + +# +# Copyright (c) 2023 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. +# + +# Build script for GN STM32 examples GitHub workflow. + +set -e + +echo_green() { + echo -e "\033[0;32m$*\033[0m" +} + +echo_blue() { + echo -e "\033[1;34m$*\033[0m" +} + +if [[ -z "${MATTER_ROOT}" ]]; then + echo "Using default path for Matter root" + CHIP_ROOT="$(dirname "$0")/../.." +else + echo "Using ENV path for Matter root" + CHIP_ROOT="$MATTER_ROOT" +fi + +source "$CHIP_ROOT/scripts/activate.sh" + +set -x +env +USE_WIFI=false + +#ST_THREAD_TARGET=\""../st:ot-stm32-cert"\" +USAGE="./scripts/examples/gn_stm32_example.sh []" + +if [ "$#" == "0" ]; then + echo "Build script for stm32 Matter apps + Format: + $USAGE + + + Root Location of the app e.g: examples/lighting-app/stm32/ + + + Desired location for the output files + + + Identifier of the board for which this app is built + Currently Supported : + STM32WB5MM-DK + + - optional noteworthy build options for stm32 + chip_build_libshell + Enable libshell support. (Default false) + chip_logging + Current value (Default true) + chip_openthread_ftd + Use openthread Full Thread Device, else, use Minimal Thread Device. (Default true) + stm32_sdk_root + Location for an alternate or modified stm32 SDK + enable_heap_monitoring + Monitor & log memory usage at runtime. (Default false) + enable_openthread_cli + Enables openthread cli without matter shell. (Default true) + kvs_max_entries + Set the maxium Kvs entries that can be store in NVM (Default 75) + Thresholds: 30 <= kvs_max_entries <= 255 + show_qr_code + Enables QR code on LCD for devices with an LCD + setupDiscriminator + Discriminatoor value used for BLE connexion. (Default 3840) + setupPinCode + PIN code for PASE session establishment. (Default 20202021) + enable_sleepy_device + Enable Sleepy end device. (Default false) + Must also set chip_openthread_ftd=false + use_mxchip + Build wifi example with MXCHIP extension board. (Default false) + 'import("//with_pw_rpc.gni")' + Use to build the example with pigweed RPC + OTA_periodic_query_timeout + Periodic query timeout variable for OTA in seconds + wifi_wpa3_only + Support for WPA3 only mode + Presets + --sed + enable sleepy end device, set thread mtd + For minimum consumption, disable openthread cli and qr code + --wifi + build wifi example variant for given extension board + --additional_data_advertising + enable Addition data advertissing and rotating device ID + --use_ot_lib + use the STMicroelectronics openthread library + " +elif [ "$#" -lt "2" ]; then + echo "Invalid number of arguments + Format: + $USAGE" +else + ROOT=$1 + OUTDIR=$2 + + if [ "$#" -gt "2" ]; then + STM32_BOARD=$3 + shift + fi + + shift + shift + while [ $# -gt 0 ]; do + case $1 in + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires mxchip" + exit 1 + fi + if [ "$2" = "mxchip" ]; then + optArgs+="use_mxchip=true" + else + echo "Wifi usage: --wifi mxchip" + exit 1 + fi + USE_WIFI=true + shift + shift + ;; + --sed) + optArgs+="enable_sleepy_device=true chip_openthread_ftd=false " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs+="chip_enable_wifi_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_st_thread_lib=true chip_openthread_target=$ST_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_st_thread_lib=true chip_openthread_target=$ST_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + *) + if [ "$1" =~ *"use_mxchip=true"* ]; then + USE_WIFI=true + fi + + optArgs+=$1" " + shift + ;; + esac + done + + if [ -z "$STM32_BOARD" ]; then + echo "STM32_BOARD not defined" + exit 1 + fi + + BUILD_DIR=$OUTDIR/$STM32_BOARD + echo BUILD_DIR="$BUILD_DIR" + if [ "$USE_WIFI" == true ]; then + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="stm32_board=\"$STM32_BOARD\" $optArgs" "$BUILD_DIR" + else + # thread build + # + if [ -z "$optArgs" ]; then + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="stm32_board=\"$STM32_BOARD\" treat_warnings_as_errors=false" --ide=json "$BUILD_DIR" + else + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="stm32_board=\"$STM32_BOARD\" $optArgs treat_warnings_as_errors=false" --ide=json "$BUILD_DIR" + fi + fi + ninja -v -C "$BUILD_DIR"/ + + #print stats + arm-none-eabi-size "$BUILD_DIR"/*.elf + + arm-none-eabi-objcopy -O binary "$BUILD_DIR"/*.elf """$BUILD_DIR/*.elf.bin" + + set +x + echo_green "Finished building target: ""$BUILD_DIR/*.elf" +fi diff --git a/scripts/flashing/stm32_firmware_utils.py b/scripts/flashing/stm32_firmware_utils.py new file mode 100644 index 00000000000000..2109f0347d144a --- /dev/null +++ b/scripts/flashing/stm32_firmware_utils.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 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 sys + +import firmware_utils + +STM32_OPTIONS = { + 'configuration': { + 'stm32cubeprogrammer': { + 'help': 'Path to the STM32CubeProgrammer executable', + 'default': 'STM32_Programmer_CLI', + 'argparse': { + 'metavar': 'FILE' + }, + 'verify': ['{stm32cubeprogrammer}', '-v'], + 'error': + """\ + Unable to execute STM32CubeProgrammer. + + Please ensure that this tool is installed and + available. See the STM32 example README for + installation instructions. + + """, + }, + 'device': { + 'help': 'Device family or platform to target', + 'default': 'STM32', + 'alias': ['-d'], + 'argparse': { + 'metavar': 'DEVICE' + }, + }, + 'port': { + 'help': 'Serial port of the device to flash', + 'default': None, + 'alias': ['-p'], + 'argparse': { + 'metavar': 'PORT' + }, + }, + }, +} + + +class Flasher(firmware_utils.Flasher): + """Manage STM32 flashing.""" + + def __init__(self, **options): + super().__init__(platform='STM32', module=__name__, **options) + self.define_options(STM32_OPTIONS) + + def erase(self): + """Erase the device.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--erase', 'all'], + name='Erase device') + + def verify(self, image): + """Verify image.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--verify', image], + name='Verify', + pass_message='Verified', + fail_message='Not verified', + fail_level=2) + + def flash(self, image): + """Flash image.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--write', image, '--format', 'bin', '--start-address', + '0x8000000'], + name='Flash') + + def reset(self): + """Reset the device.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--rst'], + name='Reset') + + def actions(self): + """Perform actions on the device according to self.option.""" + self.log(3, 'Options:', self.option) + + if self.option.erase: + if self.erase().err: + return self + + if self.option.application: + application = self.option.application + if self.flash(application).err: + return self + if self.option.verify_application: + if self.verify(application).err: + return self + if self.option.reset is None: + self.option.reset = True + + if self.option.reset: + if self.reset().err: + return self + + return self + + +if __name__ == '__main__': + sys.exit(Flasher().flash_command(sys.argv)) diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index d0706b47ec91cd..5c1f079cef3cf9 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -316,6 +316,11 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "CHIP_DEVICE_LAYER_TARGET_ASR=1", "CHIP_DEVICE_LAYER_TARGET=ASR", ] + } else if (chip_device_platform == "stm32") { + defines += [ + "CHIP_DEVICE_LAYER_TARGET_STM32=1", + "CHIP_DEVICE_LAYER_TARGET=stm32", + ] } if (chip_device_config_device_software_version != "") { @@ -517,6 +522,8 @@ if (chip_device_platform != "none") { _platform_target = "openiotsdk" } else if (chip_device_platform == "asr") { _platform_target = "ASR" + } else if (chip_device_platform == "stm32") { + _platform_target = "stm32" } else { assert(false, "Unknown chip_device_platform: ${chip_device_platform}") } diff --git a/src/platform/device.gni b/src/platform/device.gni index b70b576644318e..bf243f26524839 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -52,7 +52,7 @@ declare_args() { chip_device_platform == "cc13x2_26x2" || chip_device_platform == "cc13x4_26x4" || chip_device_platform == "k32w0" || chip_device_platform == "tizen" || - chip_device_platform == "webos" + chip_device_platform == "webos" || chip_device_platform == "stm32" } declare_args() { @@ -181,6 +181,8 @@ if (chip_device_platform == "cc13x2_26x2") { _chip_device_layer = "openiotsdk" } else if (chip_device_platform == "asr") { _chip_device_layer = "ASR" +} else if (chip_device_platform == "stm32") { + _chip_device_layer = "stm32" } if (chip_device_platform != "external") { @@ -250,5 +252,6 @@ assert( chip_device_platform == "bl602" || chip_device_platform == "bl702" || chip_device_platform == "bl702l" || chip_device_platform == "mt793x" || chip_device_platform == "SiWx917" || - chip_device_platform == "openiotsdk" || chip_device_platform == "asr", + chip_device_platform == "openiotsdk" || chip_device_platform == "asr" || + chip_device_platform == "stm32", "Please select a valid value for chip_device_platform") diff --git a/src/platform/stm32/BLEManagerImpl.cpp b/src/platform/stm32/BLEManagerImpl.cpp new file mode 100644 index 00000000000000..1cffd11b783487 --- /dev/null +++ b/src/platform/stm32/BLEManagerImpl.cpp @@ -0,0 +1,743 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the BLEManager singleton object + * for the stm32wb55 platforms. + */ + +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include + +#include +#include + +/**** STM32 api files for ble and led support ****/ +#include "app_ble.h" +#include "app_matter.h" +#include "ble_gap_aci.h" +#include "cmsis_os.h" + +using namespace ::chip; +using namespace ::chip::Ble; +using namespace ::chip::System; + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +namespace { + +// Advertising data content definitions +#define CHIP_ADV_DATA_TYPE_FLAGS 0x01 +#define CHIP_ADV_DATA_TYPE_UUID 0x03 +#define CHIP_ADV_DATA_FLAGS 0x06 +#define CHIP_ADV_DATA_TYPE_NAME 0x09 +#define CHIP_ADV_DATA_TYPE_SERVICE_DATA 0x16 +#define STM32_MTU 247 +#define CHIP_ADV_SHORT_UUID_LEN 2 +#define CONNECTION_CLOSE 0x13 + +// FreeeRTOS sw timer +TimerHandle_t sbleAdvTimeoutTimer; + +// Full service UUID - CHIP_BLE_SVC_ID - taken from BleUUID.h header +const uint8_t chipUUID_CHIPoBLE_Service[CHIP_ADV_SHORT_UUID_LEN] = { 0xFF, 0xF6 }; + +const ChipBleUUID chipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, + 0x9D, 0x11 } }; + +const ChipBleUUID chipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, + 0x9D, 0x12 } }; + +} // unnamed namespace + +BLEManagerImpl BLEManagerImpl::sInstance; +uint16_t gconnid = 0; + +CHIP_ERROR BLEManagerImpl::_Init() +{ + CHIP_ERROR err; + + mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; + mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); + mFlags.Set(Flags::kFastAdvertisingEnabled); + mNumGAPCons = 0; + + for (int i = 0; i < kMaxConnections; i++) + { + mSubscribedConIds[i] = BLE_CONNECTION_UNINITIALIZED; + } + + // Initialize the CHIP BleLayer. + err = BleLayer::Init(this, this, &DeviceLayer::SystemLayer()); + SuccessOrExit(err); + + // Create FreeRTOS sw timer for BLE timeouts and interval change. + sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(1), // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = ble obj context + BleAdvTimeoutHandler // timer callback handler + ); + VerifyOrExit(sbleAdvTimeoutTimer != NULL, err = CHIP_ERROR_INCORRECT_STATE); + + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + APP_MATTER_BLE_Set_Receive_Callback(HandleRXCharWrite); + APP_MATTER_BLE_Set_Connection_Callback(HandleGAPConnect); + APP_MATTER_BLE_Set_Disconnection_Callback(HandleGAPDisconnect); + APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(HandleTXCharCCCDWrite); + APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(HandleAck); + +exit: + ChipLogProgress(DeviceLayer, "BLEManagerImpl::Init() complete"); + + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + + if (val != mServiceMode) + { + mServiceMode = val; + PlatformMgr().ScheduleWork(DriveBLEState, 0); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + ChipLogDetail(DeviceLayer, "CHIPoBLE advertising set to %s", val ? "on" : "off"); + if (mFlags.Has(Flags::kAdvertisingEnabled) != val) + { + mFlags.Set(Flags::kAdvertisingEnabled, val); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode) +{ + switch (mode) + { + case BLEAdvertisingMode::kFastAdvertising: + mFlags.Set(Flags::kFastAdvertisingEnabled); + break; + case BLEAdvertisingMode::kSlowAdvertising: + mFlags.Clear(Flags::kFastAdvertisingEnabled); + break; + default: + return CHIP_ERROR_INVALID_ARGUMENT; + } + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * devName) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + + if (devName != nullptr && devName[0] != 0) + { + // TODO set device name + SuccessOrExit(err); + + mFlags.Set(Flags::kDeviceNameSet); + } + +exit: + return err; +} + +void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + switch (event->Type) + { + // Platform specific events + case DeviceEventType::kCHIPoBLESubscribe: { + ChipDeviceEvent connEstEvent; + HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + connEstEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; + PlatformMgr().PostEventOrDie(&connEstEvent); + } + break; + + case DeviceEventType::kCHIPoBLEUnsubscribe: { + HandleUnsubscribeReceived(event->CHIPoBLEUnsubscribe.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + } + break; + + case DeviceEventType::kCHIPoBLEWriteReceived: { + HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_RX, + PacketBufferHandle::Adopt(event->CHIPoBLEWriteReceived.Data)); + } + break; + + case DeviceEventType::kCHIPoBLEConnectionError: { + HandleConnectionError(event->CHIPoBLEConnectionError.ConId, event->CHIPoBLEConnectionError.Reason); + } + break; + + // Generic CHIP events + case DeviceEventType::kServiceProvisioningChange: + // Force the advertising state to be refreshed to reflect new provisioning state. + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + break; + + case DeviceEventType::kCHIPoBLEIndicateConfirm: { + HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + } + break; + + default: + break; + } +} + +bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SubscribeCharacteristic() not supported"); + return false; +} + +bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::UnsubscribeCharacteristic() not supported"); + return false; +} + +bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId) +{ + CHIP_ERROR err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + + ChipLogProgress(DeviceLayer, "Closing BLE GATT connection con %u", *(uint16_t *) conId); + // aci_gap_terminate(gconnid, CONNECTION_CLOSE); + return (err == CHIP_NO_ERROR); +} + +uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const +{ + uint16_t retVal = 0; + // TODO get MTU from stm32 api + retVal = STM32_MTU; + return retVal; +} + +bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle data) +{ + uint16_t dataLen = data->DataLength(); + + ChipLogDetail(DeviceLayer, "Sending notification for CHIPoBLE Client TX (con %u, len %u)", *(uint16_t *) conId, dataLen); + + APP_MATTER_Send_Notification(dataLen, data->Start()); + + return true; +} + +bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendWriteRequest() not supported"); + return false; +} + +bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported"); + return false; +} + +bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, + const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported"); + return false; +} + +void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) +{ + CloseConnection(conId); +} + +void BLEManagerImpl::DriveBLEState(void) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Perform any initialization actions that must occur after the CHIP task is running. + if (!mFlags.Has(Flags::kAsyncInitCompleted)) + { + mFlags.Set(Flags::kAsyncInitCompleted); + ChipLogProgress(DeviceLayer, "kAsyncInitCompleted done"); + // If CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED is enabled, + // disable CHIPoBLE advertising if the device is fully provisioned. +#if CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + if (ConfigurationMgr().IsFullyProvisioned()) + { + mFlags.Clear(Flags::kAdvertisingEnabled); + ChipLogProgress(DeviceLayer, "CHIPoBLE advertising disabled because device is fully provisioned"); + } +#endif // CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + } + + // If the application has enabled CHIPoBLE and BLE advertising... + if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled && + mFlags.Has(Flags::kAdvertisingEnabled) +#if CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION + // and no connections are active... + && (mNumGAPCons == 0) +#endif + ) + { + // Start/re-start BLE advertising if not already advertising, or if the + // advertising state of the underlying stack needs to be refreshed. + if (!mFlags.Has(Flags::kAdvertising) || mFlags.Has(Flags::kAdvertisingRefreshNeeded)) + { + mFlags.Clear(Flags::kAdvertisingRefreshNeeded); + err = StartAdvertising(); + SuccessOrExit(err); + } + } + + // Otherwise, stop advertising if currently active. + else if (mFlags.Has(Flags::kAdvertising)) + { + err = StopAdvertising(); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %s", ErrorStr(err)); + mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Disabled; + } +} + +CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) +{ + ChipBLEDeviceIdentificationInfo mDeviceIdInfo; + CHIP_ERROR err; + uint8_t index = 0; + uint8_t deviceNameLength = 0; + uint8_t deviceIdInfoLength = 0; + int ret = 0; + + char deviceName[kMaxDeviceNameLength + 1]; + uint8_t advDataBuf[kMaxAdvertisementDataSetSize]; + uint8_t scanRespDataBuf[kMaxAdvertisementDataSetSize]; + + memset(advDataBuf, 0, kMaxAdvertisementDataSetSize); + memset(scanRespDataBuf, 0, kMaxAdvertisementDataSetSize); + + err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(mDeviceIdInfo); + SuccessOrExit(err); + + if (!mFlags.Has(Flags::kDeviceNameSet)) + { + snprintf(deviceName, sizeof(deviceName), "%s%04" PRIX32, CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX, (uint32_t) 0); + deviceName[kMaxDeviceNameLength] = 0; + SuccessOrExit(err); + } + + deviceNameLength = static_cast(strlen(deviceName)); + deviceIdInfoLength = sizeof(mDeviceIdInfo); + + // Check sizes + static_assert(sizeof(mDeviceIdInfo) + CHIP_ADV_SHORT_UUID_LEN + 1 <= UINT8_MAX, "Our length won't fit in a uint8_t"); + static_assert(2 + CHIP_ADV_SHORT_UUID_LEN + sizeof(mDeviceIdInfo) + 1 <= kMaxAdvertisementDataSetSize, + "Advertisement data buffer is not big enough"); + + // Fill in advertising data + index = 0; + advDataBuf[index++] = 0x02; // length + advDataBuf[index++] = CHIP_ADV_DATA_TYPE_FLAGS; // AD type : flags + advDataBuf[index++] = CHIP_ADV_DATA_FLAGS; // AD value + + advDataBuf[index++] = static_cast(deviceIdInfoLength + CHIP_ADV_SHORT_UUID_LEN + 1); // AD length + advDataBuf[index++] = CHIP_ADV_DATA_TYPE_SERVICE_DATA; // AD type : Service Data + advDataBuf[index++] = chipUUID_CHIPoBLE_Service[1]; // AD value + advDataBuf[index++] = chipUUID_CHIPoBLE_Service[0]; + memcpy(&advDataBuf[index], (void *) &mDeviceIdInfo, deviceIdInfoLength); // AD value + + index = static_cast(index + deviceIdInfoLength); + + ChipLogError(DeviceLayer, "state return update adv: %d", ret); + // Fill in scan response data + index = 0; + scanRespDataBuf[index++] = CHIP_ADV_SHORT_UUID_LEN + 1; // AD length + scanRespDataBuf[index++] = CHIP_ADV_DATA_TYPE_UUID; // AD type : uuid + scanRespDataBuf[index++] = chipUUID_CHIPoBLE_Service[1]; // AD value + scanRespDataBuf[index++] = chipUUID_CHIPoBLE_Service[0]; + + VerifyOrExit(index + (deviceNameLength + 2) <= kMaxAdvertisementDataSetSize, err = CHIP_ERROR_BUFFER_TOO_SMALL); + + scanRespDataBuf[index++] = static_cast(deviceNameLength + 1); // length + scanRespDataBuf[index++] = CHIP_ADV_DATA_TYPE_NAME; // AD type : name + memcpy(&scanRespDataBuf[index], deviceName, deviceNameLength); // AD value + index = static_cast(index + deviceNameLength); + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::StartAdvertising(void) +{ + CHIP_ERROR err; + + // If already advertising, stop it, before changing values + if (mFlags.Has(Flags::kAdvertising)) + { + APP_BLE_Adv_Cancel(); // ST ble api + } + else + { + ChipLogProgress(DeviceLayer, "CHIPoBLE start advertising"); + } + + err = ConfigureAdvertisingData(); + SuccessOrExit(err); + + mFlags.Clear(Flags::kRestartAdvertising); + + APP_BLE_Adv_Request(APP_BLE_FAST_ADV); + // Flag updated asynchronously by BLE host callback + mFlags.Set(Flags::kAdvertising); + + if (mFlags.Has(Flags::kFastAdvertisingEnabled)) + { + StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::StopAdvertising(void) +{ + CHIP_ERROR err; + + APP_BLE_Adv_Cancel(); // ST ble api + CancelBleAdvTimeoutTimer(); + // Transition to the not Advertising state... + if (mFlags.Has(Flags::kAdvertising)) + { + mFlags.Clear(Flags::kAdvertising); + mFlags.Set(Flags::kFastAdvertisingEnabled); + + ChipLogProgress(DeviceLayer, "CHIPoBLE advertising stopped"); + + // Post a CHIPoBLEAdvertisingChange(Stopped) event. + ChipDeviceEvent advChange; + advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange; + advChange.CHIPoBLEAdvertisingChange.Result = kActivity_Stopped; + err = PlatformMgr().PostEvent(&advChange); + } + + return err; +} + +uint16_t BLEManagerImpl::_NumConnections(void) +{ + uint16_t numCons = 0; + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] != BLE_CONNECTION_UNINITIALIZED) + { + numCons++; + } + } + return numCons; +} + +void BLEManagerImpl::DriveBLEState(intptr_t arg) +{ + sInstance.DriveBLEState(); +} + +void BLEManagerImpl::bleConnect(void) +{ + CHIP_ERROR err; + ChipLogProgress(DeviceLayer, "BLE GATT connection established "); + + mNumGAPCons++; + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + ChipDeviceEvent connectEvent; + connectEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; + err = PlatformMgr().PostEvent(&connectEvent); + PlatformMgr().ScheduleWork(DriveBLEState, 0); +} + +void BLEManagerImpl::bleDisconnect(uint16_t connid) +{ + CHIP_ERROR err; + + ChipLogDetail(DeviceLayer, "BLE GATT connection closed (con %u)", connid); + ; + // Force a refresh of the advertising state. + if (mNumGAPCons > 0) + { + mNumGAPCons--; + } + + // If this was a CHIPoBLE connection, release the associated connection state record + // and post an event to deliver a connection error to the CHIPoBLE layer. + if (!BLEMgrImpl().IsSubscribed(connid)) + { + if (UnsetSubscribed(connid)) + { + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = connid; + PlatformMgr().PostEventOrDie(&event); + ChipLogDetail(DeviceLayer, "BLE unuset subscribed (con %u)", connid); + } + } + + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + ChipDeviceEvent disconnectEvent; + disconnectEvent.Type = DeviceEventType::kCHIPoBLEConnectionClosed; + err = PlatformMgr().PostEvent(&disconnectEvent); + PlatformMgr().ScheduleWork(DriveBLEState, 0); +} + +void BLEManagerImpl::HandleGAPConnect(void) +{ + + ChipLogProgress(DeviceLayer, "Gap connect"); + sInstance.bleConnect(); +} +void BLEManagerImpl::HandleGAPDisconnect(uint16_t * connid) +{ + ChipLogProgress(DeviceLayer, "Gap disconnect"); + sInstance.bleDisconnect(gconnid); +} + +void BLEManagerImpl::HandleRXCharWrite(BLE_Matter_RX * aMessage) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ChipLogProgress(DeviceLayer, "Write request received for CHIPoBLE Client RX characteristic (con %u, len %u)", aMessage->connid, + aMessage->Length); + // update connid + gconnid = aMessage->connid; + + PacketBufferHandle buf = System::PacketBufferHandle::NewWithData(aMessage->Payload, aMessage->Length, 0, 0); + VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + // Post an event to the Chip queue to deliver the data into the Chip stack. + { + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEWriteReceived; + event.CHIPoBLEWriteReceived.ConId = aMessage->connid; + event.CHIPoBLEWriteReceived.Data = std::move(buf).UnsafeRelease(); + err = PlatformMgr().PostEvent(&event); + } +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "HandleRXCharWrite() failed: %s", ErrorStr(err)); + // TODO: fail connection??? + } +} + +void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_Matter_TXCharCCCD * aMessage) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + bool notificationsEnabled; + + ChipLogProgress(DeviceLayer, "Write request received for CHIPoBLE TX characteristic CCCD (con %u, len %u)", aMessage->connid, + 0); + + // Determine if the client is enabling or disabling notifications + notificationsEnabled = (aMessage->notif != 0); + // If the client has requested to enable notifications + if (notificationsEnabled) + { + // Set subcription only the first time + if (!BLEMgrImpl().IsSubscribed(aMessage->connid)) // conid + { + // Record that notifications have been enabled for this connection. + err = BLEMgrImpl().SetSubscribed(aMessage->connid); + VerifyOrExit(err != CHIP_ERROR_NO_MEMORY, err = CHIP_NO_ERROR); + SuccessOrExit(err); + } + } + + else + { + // If notifications had previously been enabled for this connection, record that they are no longer enabled + BLEMgrImpl().UnsetSubscribed(aMessage->connid); + } + + // Post an event to the Chip queue to process either a CHIPoBLE Subscribe or Unsubscribe based on + // whether the client is enabling or disabling notifications + { + ChipDeviceEvent event; + event.Type = (notificationsEnabled) ? DeviceEventType::kCHIPoBLESubscribe : DeviceEventType::kCHIPoBLEUnsubscribe; + event.CHIPoBLESubscribe.ConId = aMessage->connid; + err = PlatformMgr().PostEvent(&event); + } + + ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", notificationsEnabled ? "subscribe" : "unsubscribe"); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "HandleTXCharCCCDWrite() failed: %s", ErrorStr(err)); + // TODO: fail connection??? + } +} + +void BLEManagerImpl::HandleAck(uint16_t * connid) +{ + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; + event.CHIPoBLEIndicateConfirm.ConId = gconnid; + PlatformMgr().PostEventOrDie(&event); +} + +CHIP_ERROR BLEManagerImpl::SetSubscribed(uint16_t conId) +{ + uint16_t freeIndex = kMaxConnections; + + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + return CHIP_NO_ERROR; + } + else if (mSubscribedConIds[i] == BLE_CONNECTION_UNINITIALIZED && i < freeIndex) + { + freeIndex = i; + } + } + + if (freeIndex < kMaxConnections) + { + mSubscribedConIds[freeIndex] = conId; + return CHIP_NO_ERROR; + } + else + { + return CHIP_ERROR_NO_MEMORY; + } +} + +bool BLEManagerImpl::UnsetSubscribed(uint16_t conId) +{ + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + mSubscribedConIds[i] = BLE_CONNECTION_UNINITIALIZED; + return true; + } + } + return false; +} + +bool BLEManagerImpl::IsSubscribed(uint16_t conId) +{ + if (conId != BLE_CONNECTION_UNINITIALIZED) + { + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + return true; + } + } + } + return false; +} + +void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) +{ + if (BLEMgrImpl().mFlags.Has(Flags::kFastAdvertisingEnabled)) + { + /* Stop advertising and defer restart for when stop confirmation is received from the stack */ + ChipLogDetail(DeviceLayer, "bleAdv Timeout : Stop advertissement"); + sInstance.StopAdvertising(); + sInstance.mFlags.Set(Flags::kRestartAdvertising); + } + else if (BLEMgrImpl().mFlags.Has(Flags::kAdvertising)) + { + // Advertisement time expired. Stop advertising + ChipLogDetail(DeviceLayer, "bleAdv Timeout : Stop advertissement"); + BLEMgr().SetAdvertisingEnabled(false); + } +} + +void BLEManagerImpl::CancelBleAdvTimeoutTimer(void) +{ + if (xTimerStop(sbleAdvTimeoutTimer, 0) == pdFAIL) + { + ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer"); + } +} + +void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) +{ + if (xTimerIsTimerActive(sbleAdvTimeoutTimer)) + { + CancelBleAdvTimeoutTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), 100) != pdPASS) + { + ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer"); + } +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/BLEManagerImpl.h b/src/platform/stm32/BLEManagerImpl.h new file mode 100644 index 00000000000000..98812500eac0b0 --- /dev/null +++ b/src/platform/stm32/BLEManagerImpl.h @@ -0,0 +1,191 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the BLEManager singleton object + * for the stm32 platforms. + */ + +#pragma once + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + +#include +#include + +#include "FreeRTOS.h" +#include "app_ble.h" +#include "app_matter.h" +#include "timers.h" + +namespace chip { +namespace DeviceLayer { +namespace Internal { +using namespace chip::Ble; + +/** + * Concrete implementation of the BLEManager singleton object for the platform. + */ +class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePlatformDelegate, private BleApplicationDelegate +{ + // Allow the BLEManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend BLEManager; + +private: + // ===== Members that implement the BLEManager internal interface. + + CHIP_ERROR _Init(void); + CHIP_ERROR _Shutdown() { return CHIP_NO_ERROR; } + CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); + CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); + bool _IsAdvertisingEnabled(void); + CHIP_ERROR _SetAdvertisingEnabled(bool val); + bool _IsAdvertising(void); + CHIP_ERROR _SetAdvertisingMode(BLEAdvertisingMode mode); + CHIP_ERROR _GetDeviceName(char * buf, size_t bufSize); + CHIP_ERROR _SetDeviceName(const char * deviceName); + uint16_t _NumConnections(void); + void _OnPlatformEvent(const ChipDeviceEvent * event); + BleLayer * _GetBleLayer(void); + + // ===== Members that implement virtual methods on BlePlatformDelegate. + + bool SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; + bool UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; + bool CloseConnection(BLE_CONNECTION_OBJECT conId) override; + uint16_t GetMTU(BLE_CONNECTION_OBJECT conId) const override; + bool SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, const ChipBleUUID * svcId, + const ChipBleUUID * charId) override; + + // ===== Members that implement virtual methods on BleApplicationDelegate. + + void NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) override; + + // ===== Members for internal use by the following friends. + + friend BLEManager & BLEMgr(void); + friend BLEManagerImpl & BLEMgrImpl(void); + + static BLEManagerImpl sInstance; + + // ===== Private members reserved for use by this class only. + + enum class Flags : uint16_t + { + kAsyncInitCompleted = 0x0001, /**< One-time asynchronous initialization actions have been performed. */ + kAdvertisingEnabled = 0x0002, /**< The application has enabled CHIPoBLE advertising. */ + kFastAdvertisingEnabled = 0x0004, /**< The application has enabled fast advertising. */ + kAdvertising = 0x0008, /**< The system is currently CHIPoBLE advertising. */ + kAdvertisingRefreshNeeded = 0x0010, /**< The advertising state/configuration state in the BLE layer needs to be updated. */ + kDeviceNameSet = 0x0020, /**< The device name has been set. */ + kRestartAdvertising = 0x0040, /**< The advertising will be restarted when stop advertising confirmation is received and this + flag is set*/ + }; + + enum + { + kMaxConnections = BLE_LAYER_NUM_BLE_ENDPOINTS, + kMaxDeviceNameLength = 20, // TODO: right-size this + kMaxAdvertisementDataSetSize = 31 + }; + + CHIPoBLEServiceMode mServiceMode; + BitFlags mFlags; + uint16_t mNumGAPCons; + uint16_t mSubscribedConIds[kMaxConnections]; + + void DriveBLEState(void); + CHIP_ERROR ConfigureAdvertisingData(void); + CHIP_ERROR StartAdvertising(void); + CHIP_ERROR StopAdvertising(void); + CHIP_ERROR SetSubscribed(uint16_t conId); + bool UnsetSubscribed(uint16_t conId); + bool IsSubscribed(uint16_t conId); + void bleConnect(void); + void bleDisconnect(uint16_t connid); + + CHIP_ERROR MapBLEError(int bleErr) const; + /* Callbacks from BLE stack*/ + static void HandleGAPConnect(void); + static void HandleGAPDisconnect(uint16_t * connid); + static void HandleRXCharWrite(BLE_Matter_RX * aMessage); + static void HandleTXCharCCCDWrite(BLE_Matter_TXCharCCCD * aMessage); + static void HandleAck(uint16_t * connid); + + static void DriveBLEState(intptr_t arg); + + /* Handlers for stack events */ + static void BleAdvTimeoutHandler(TimerHandle_t xTimer); + static void CancelBleAdvTimeoutTimer(void); + static void StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs); +}; + +/** + * Returns a reference to the public interface of the BLEManager singleton object. + * + * Internal components should use this to access features of the BLEManager object + * that are common to all platforms. + */ +inline BLEManager & BLEMgr() +{ + return BLEManagerImpl::sInstance; +} + +/** + * Returns a reference to the public interface of the BLEManager singleton object. + * + * Internal components should use this to access features of the BLEManager object + * that are specific to the stm32 platforms. + */ +inline BLEManagerImpl & BLEMgrImpl(void) +{ + return BLEManagerImpl::sInstance; +} + +inline BleLayer * BLEManagerImpl::_GetBleLayer() +{ + return this; +} + +inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) +{ + return mServiceMode; +} + +inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) +{ + return mFlags.Has(Flags::kAdvertisingEnabled); +} + +inline bool BLEManagerImpl::_IsAdvertising(void) +{ + return mFlags.Has(Flags::kAdvertising); +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip + +#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/src/platform/stm32/BUILD.gn b/src/platform/stm32/BUILD.gn new file mode 100644 index 00000000000000..38290a49e2301d --- /dev/null +++ b/src/platform/stm32/BUILD.gn @@ -0,0 +1,112 @@ +# Copyright (c) 2021 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/chip.gni") +import("//build_overrides/pigweed.gni") + +import("${chip_root}/src/platform/device.gni") + +import("${chip_root}/build/chip/buildconfig_header.gni") +import("${chip_root}/src/crypto/crypto.gni") + +import("${chip_root}/third_party/st/stm32_board.gni") + +assert(chip_device_platform == "stm32") + +if (chip_crypto == "platform") { + import("//build_overrides/mbedtls.gni") +} +if (chip_enable_openthread) { + import("//build_overrides/openthread.gni") +} + +static_library("stm32") { + if (stm32_board == "STM32WB5MM-DK") { + sources = [ + "../FreeRTOS/SystemTimeSupport.cpp", + "../SingletonConfigurationManager.cpp", + "../logging/impl/stdio/Logging.cpp", + "BLEManagerImpl.cpp", + "BLEManagerImpl.h", + "BlePlatformConfig.h", + "CHIPDevicePlatformConfig.h", + "CHIPDevicePlatformEvent.h", + "CHIPMem-Platform.cpp", + "CHIPPlatformConfig.h", + "ConfigurationManagerImpl.cpp", + "ConfigurationManagerImpl.h", + "DiagnosticDataProviderImpl.cpp", + "DiagnosticDataProviderImpl.h", + "FactoryDataProvider.cpp", + "FactoryDataProvider.h", + "InetPlatformConfig.h", + "KeyValueStoreManagerImpl.cpp", + "KeyValueStoreManagerImpl.h", + "PlatformManagerImpl.cpp", + "PlatformManagerImpl.h", + "STM32Config.cpp", + "STM32Config.h", + "STM32FreeRtosHooks.cpp", + "STM32FreeRtosHooks.h", + "SystemPlatformConfig.h", + ] + } + + deps = [ "${chip_root}/src/setup_payload" ] + public = [ "${chip_root}/src/credentials/DeviceAttestationCredsProvider.h" ] + public_deps = [ + "${chip_root}/src/crypto", + "${chip_root}/src/platform:platform_base", + ] + + if (chip_enable_openthread) { + sources += [ + "../OpenThread/DnssdImpl.cpp", + "../OpenThread/OpenThreadDnssdImpl.cpp", + "../OpenThread/OpenThreadUtils.cpp", + "ConnectivityManagerImpl.cpp", + "ConnectivityManagerImpl.h", + "ThreadStackManagerImpl.cpp", + "ThreadStackManagerImpl.h", + ] + + import("//build_overrides/stm32_sdk.gni") + import("${stm32_sdk_build_root}/stm32_sdk.gni") + public_deps += [ "${stm32_sdk_build_root}:stm32_sdk" ] + + deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] + + public_configs = [ + "${chip_root}/src/lib/address_resolve:default_address_resolve_config", + ] + } + + # Set the compiler flags + cflags = [ + "-Wno-error=unused-parameter", + "-Wno-error=unused-variable", + "-Wno-error=format=", + "-Wno-error=return-type", + ] + + # Add platform crypto implementation + if (chip_crypto == "platform") { + sources += [] + + public_deps += [ + "${chip_root}/src/crypto", + "${mbedtls_root}:mbedtls", + ] + } +} diff --git a/src/platform/stm32/BlePlatformConfig.h b/src/platform/stm32/BlePlatformConfig.h new file mode 100644 index 00000000000000..f75b55d4f85ed8 --- /dev/null +++ b/src/platform/stm32/BlePlatformConfig.h @@ -0,0 +1,38 @@ +/* + * + * 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. + */ + +/** + * @file + * Platform-specific configuration overrides for the CHIP BLE + * Layer on stm32wb platforms. + * + */ + +#pragma once + +// ==================== Platform Adaptations ==================== + +#define BLE_CONNECTION_OBJECT uint16_t +#define BLE_CONNECTION_UNINITIALIZED (0xFFFF) +#define BLE_MAX_RECEIVE_WINDOW_SIZE 5 + +#define BLE_CONFIG_ERROR_MIN 6000000 +#define BLE_CONFIG_ERROR_MAX 6000999 + +// ========== Platform-specific Configuration Overrides ========= + +/* none so far */ diff --git a/src/platform/stm32/CHIPDevicePlatformConfig.h b/src/platform/stm32/CHIPDevicePlatformConfig.h new file mode 100644 index 00000000000000..6685bd8464f37b --- /dev/null +++ b/src/platform/stm32/CHIPDevicePlatformConfig.h @@ -0,0 +1,149 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * 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. + */ + +/** + * @file + * Platform-specific configuration overrides for CHIP on + * the STM32 platform. + */ + +#pragma once + +// ==================== General Platform Adaptations ==================== + +#define CHIP_CONFIG_ABORT() abort() + +#define CHIP_CONFIG_ENABLE_TUNNELING 0 +#define CHIP_CONFIG_MAX_TUNNELS 0 +#define CHIP_CONFIG_ENABLE_SERVICE_DIRECTORY 0 + +#define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE uint16_t +#define CHIP_CONFIG_PERSISTED_STORAGE_ENC_MSG_CNTR_ID 1 +#define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2 + +#define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY 0x01 +#define CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER + +#if CHIP_ENABLE_OPENTHREAD +#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 // 0 = MTD +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 +#endif + +// ========== Platform-specific Configuration ========= + +// These are configuration options that are unique to the platform. +// These can be overridden by the application as needed. + +// ... + +// ========== Platform-specific Configuration Overrides ========= + +#define CHIP_DEVICE_CONFIG_CHIP_TASK_NAME "STM32WB TASK" +#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (8 * 1024) + +/** + * CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY + * + * The priority of the chip task. + */ +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 24 +#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (4 * 1024) + +/** + * CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY + * + * The priority of the OpenThread task. + */ +#define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 24 + +#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25 + +/** + * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE + * + * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption + */ +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 + +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0 + +// Per 5.2.5.2. Commencement Section of CHIP spec, BLE advertisement is +// disabled for Locks and Barrier Access Devices. +#define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART 0 +#define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 0 + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME + * + * The amount of time in miliseconds after which BLE advertisement should be switched from the fast + * advertising to the slow advertising, counting from the moment of advertisement commencement. + * + * Defaults to 30000 (30 seconds). + */ +#ifndef CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME 30000 +#endif +// ========== Platform-specific Cluster Overrides ========= +#define CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS 1 + +// EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT is only defined if the +// cluster is actually enabled in the ZAP config. To allow operation in setups +#define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) + +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +#define CHIP_CONFIG_ENABLE_SESSION_RESUMPTION 1 + +#define CHIP_CONFIG_MEMORY_MGMT_PLATFORM 1 +#define CHIP_CONFIG_MEMORY_MGMT_MALLOC 0 diff --git a/src/platform/stm32/CHIPDevicePlatformEvent.h b/src/platform/stm32/CHIPDevicePlatformEvent.h new file mode 100644 index 00000000000000..b77798f92a7d6c --- /dev/null +++ b/src/platform/stm32/CHIPDevicePlatformEvent.h @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2021 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 + +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace DeviceEventType { +/** + * Enumerates platform-specific event types that are visible to the application. + */ +enum PublicPlatformSpecificEventTypes +{ + /* None currently defined */ +}; + +/** + * Enumerates platform-specific event types that are internal to the chip Device Layer. + */ +enum InternalPlatformSpecificEventTypes +{ + kSTMBLEConnected = kRange_InternalPlatformSpecific, + kSTMBLEDisconnected, + kCHIPoBLECCCWriteEvent, + kCHIPoBLERXCharWriteEvent, + kCHIPoBLETXCharWriteEvent, +}; + +} // namespace DeviceEventType + +/** + * Represents platform-specific event information. + */ +struct ChipDevicePlatformEvent final +{ + // TODO - add platform specific definition extension + union + { + struct + { + uint8_t dummy; + } STMBLEConnected; + struct + { + uint8_t dummy; + } CHIPoBLECCCWriteEvent; + struct + { + uint8_t dummy; + } CHIPoBLERXCharWriteEvent; + struct + { + uint8_t dummy; + } CHIPoBLETXCharWriteEvent; + }; +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/CHIPMem-Platform.cpp b/src/platform/stm32/CHIPMem-Platform.cpp new file mode 100644 index 00000000000000..2e37bafe7cf1b8 --- /dev/null +++ b/src/platform/stm32/CHIPMem-Platform.cpp @@ -0,0 +1,239 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * 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. + */ + +/* + * + * Copyright (c) 2020-2021 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. + */ + +/** + * @file + * This file implements heap memory allocation APIs for CHIP. These functions are platform + * specific and might be C Standard Library heap functions re-direction in most of cases. + * + */ + +#include +#include + +#include "cmsis_os.h" +#include "mbedtls/platform.h" +#include "task.h" + +#include +#include +#include +#include + +#if CHIP_CONFIG_MEMORY_MGMT_PLATFORM + +extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size); +extern "C" void memMonitoringTrackFree(void * ptr, size_t size); + +#ifndef trackAlloc +#define trackAlloc(pvAddress, uiSize) memMonitoringTrackAlloc(pvAddress, uiSize) +#endif +#ifndef trackFree +#define trackFree(pvAddress, uiSize) memMonitoringTrackFree(pvAddress, uiSize) +#endif + +#define USE_FREERTOS + +using namespace std; + +// Define the new operator for C++ to use the freeRTOS memory management +// functions. +// +void * operator new(size_t size) +{ + void * p; +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + p = pvPortMalloc(size); + else + p = malloc(size); + +#else + p = malloc(size); + +#endif +#ifdef __EXCEPTIONS + if (p == 0) // did pvPortMalloc succeed? + throw std::bad_alloc(); // ANSI/ISO compliant behavior +#endif + return p; +} + +// +// Define the delete operator for C++ to use the freeRTOS memory +// functions. +// +void operator delete(void * p) +{ +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + vPortFree(p); + else + free(p); +#else + free(p); +#endif + p = NULL; +} + +void * operator new[](size_t size) +{ + void * p; +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + p = pvPortMalloc(size); + else + p = malloc(size); + +#else + p = malloc(size); + +#endif +#ifdef __EXCEPTIONS + if (p == 0) // did pvPortMalloc succeed? + throw std::bad_alloc(); // ANSI/ISO compliant behavior +#endif + return p; +} + +// +// Define the delete operator for C++ to use the freeRTOS memory +// functions. THIS IS NOT OPTIONAL! +// +void operator delete[](void * p) +{ +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + vPortFree(p); + else + free(p); +#else + free(p); +#endif + p = NULL; +} + +namespace chip { +namespace Platform { + +#define VERIFY_INITIALIZED() VerifyInitialized(__func__) + +static std::atomic_int memoryInitialized{ 0 }; + +static void VerifyInitialized(const char * func) +{ + if (!memoryInitialized) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::%s() called before chip::Platform::MemoryInit()\n", func); + abort(); + } +} + +CHIP_ERROR MemoryAllocatorInit(void * buf, size_t bufSize) +{ + if (memoryInitialized++ > 0) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::MemoryInit() called twice.\n"); + abort(); + } + + return CHIP_NO_ERROR; +} + +void MemoryAllocatorShutdown() +{ + if (--memoryInitialized < 0) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::MemoryShutdown() called twice.\n"); + abort(); + } +} + +void * MemoryAlloc(size_t size) +{ + void * ptr; + VERIFY_INITIALIZED(); + ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size); + return ptr; +} + +void * MemoryAlloc(size_t size, bool isLongTermAlloc) +{ + void * ptr; + VERIFY_INITIALIZED(); + ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size); + return ptr; +} + +void * MemoryCalloc(size_t num, size_t size) +{ + VERIFY_INITIALIZED(); + + void * ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size * num); + return ptr; +} + +void * MemoryRealloc(void * p, size_t size) +{ + VERIFY_INITIALIZED(); + + p = realloc(p, size); + return p; +} + +void MemoryFree(void * p) +{ + VERIFY_INITIALIZED(); + mbedtls_free(p); + trackFree(p, 0); +} + +bool MemoryInternalCheckPointer(const void * p, size_t min_size) +{ + return (p != nullptr); +} + +} // namespace Platform +} // namespace chip + +extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size) {} + +extern "C" void memMonitoringTrackFree(void * ptr, size_t size) {} + +#endif // CHIP_CONFIG_MEMORY_MGMT_PLATFORM diff --git a/src/platform/stm32/CHIPPlatformConfig.h b/src/platform/stm32/CHIPPlatformConfig.h new file mode 100644 index 00000000000000..4db0ba07aa7d9b --- /dev/null +++ b/src/platform/stm32/CHIPPlatformConfig.h @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * 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. + */ + +/** + * @file + * Platform-specific configuration overrides for CHIP on + * the STM32 platform. + */ + +#pragma once +#include "CHIPDevicePlatformConfig.h" +// ==================== General Configuration Overrides ==================== + +#ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS +#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 8 +#endif // CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS + +#ifndef CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS +#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 8 +#endif // CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS + +#ifndef CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD +#define CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD 50 +#endif // CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD + +#ifndef CHIP_LOG_FILTERING +#define CHIP_LOG_FILTERING 0 +#endif // CHIP_LOG_FILTERING + +#ifndef CHIP_CONFIG_MAX_PEER_NODES +#define CHIP_CONFIG_MAX_PEER_NODES 16 +#endif // CHIP_CONFIG_MAX_PEER_NODES + +#ifndef CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS +#define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1 +#endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS + +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif // CHIP_CONFIG_MAX_FABRICS + +#ifndef CHIP_CONFIG_MAX_ACTIVE_CHANNELS +#define CHIP_CONFIG_MAX_ACTIVE_CHANNELS 8 +#endif // CHIP_CONFIG_MAX_ACTIVE_CHANNELS + +#ifndef CHIP_CONFIG_MAX_CHANNEL_HANDLES +#define CHIP_CONFIG_MAX_CHANNEL_HANDLES 16 +#endif // CHIP_CONFIG_MAX_CHANNEL_HANDLES + +#ifndef CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT +#define CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT 6 +#endif // CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT +// ==================== Security Configuration Overrides ==================== + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE +#define CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE 1 +#endif + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_TASK +#define CHIP_CONFIG_FREERTOS_USE_STATIC_TASK 1 +#endif + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE +#define CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE 1 +#endif diff --git a/src/platform/stm32/ConfigurationManagerImpl.cpp b/src/platform/stm32/ConfigurationManagerImpl.cpp new file mode 100644 index 00000000000000..da8638460a78f3 --- /dev/null +++ b/src/platform/stm32/ConfigurationManagerImpl.cpp @@ -0,0 +1,168 @@ +/* + * + * 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. + */ + +/** + * @file + * Provides the implementation of the Device Layer ConfigurationManager object + * for stm32wb platforms. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include + +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING + +#include +#include + +namespace chip { +namespace DeviceLayer { + +using namespace ::chip::DeviceLayer::Internal; + +ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance() +{ + static ConfigurationManagerImpl sInstance; + return sInstance; +} + +CHIP_ERROR ConfigurationManagerImpl::Init() +{ + CHIP_ERROR err; + + // Initialize the generic implementation base class. + err = Internal::GenericConfigurationManagerImpl::Init(); + + return err; +} + +bool ConfigurationManagerImpl::CanFactoryReset() +{ + // TODO: query the application to determine if factory reset is allowed. + return true; +} + +void ConfigurationManagerImpl::InitiateFactoryReset() +{ + PlatformMgr().ScheduleWork(DoFactoryReset); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key persistedStorageKey, + uint32_t & value) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogDetail(DataManagement, "ST => ReadPersistedStorageValue"); + + err = ReadConfigValue(persistedStorageKey, value); + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + { + err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + } + SuccessOrExit(err); + +exit: + return err; +} + +CHIP_ERROR ConfigurationManagerImpl::WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key persistedStorageKey, + uint32_t value) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogDetail(DataManagement, "ST => WritePersistedStorageValue"); + err = WriteConfigValue(persistedStorageKey, value); + SuccessOrExit(err); +exit: + return err; +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, bool & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint32_t & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint64_t & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) +{ + return STM32Config::ReadConfigValueStr(key, buf, bufSize, outLen); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) +{ + return STM32Config::ReadConfigValueBin(key, buf, bufSize, outLen); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, bool val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint32_t val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint64_t val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str) +{ + return STM32Config::WriteConfigValueStr(key, str); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str, size_t strLen) +{ + return STM32Config::WriteConfigValueStr(key, str, strLen); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) +{ + return STM32Config::WriteConfigValueBin(key, data, dataLen); +} + +void ConfigurationManagerImpl::RunConfigUnitTest(void) +{ + STM32Config::RunConfigUnitTest(); +} + +void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) {} + +ConfigurationManager & ConfigurationMgrImpl() +{ + return ConfigurationManagerImpl::GetDefaultInstance(); +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConfigurationManagerImpl.h b/src/platform/stm32/ConfigurationManagerImpl.h new file mode 100644 index 00000000000000..78b885581ce151 --- /dev/null +++ b/src/platform/stm32/ConfigurationManagerImpl.h @@ -0,0 +1,89 @@ +/* + * + * 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. + */ + +/** + * @file + * Provides an implementation of the ConfigurationManager object + * for stm32wb platforms. + */ + +#pragma once +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the ConfigurationManager singleton object for the platform. + */ + +// class ConfigurationManagerImpl final : public Internal::GenericConfigurationManagerImpl, +// public Internal::STM32Config +class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImpl +{ +public: + // This returns an instance of this class. + static ConfigurationManagerImpl & GetDefaultInstance(); + +private: + // ===== Members that implement the ConfigurationManager public interface. + + CHIP_ERROR Init(void) override; + CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; + bool CanFactoryReset(void) override; + void InitiateFactoryReset(void) override; + CHIP_ERROR ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value) override; + CHIP_ERROR WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value) override; + + // NOTE: Other public interface methods are implemented by GenericConfigurationManagerImpl<>. + + // ===== Members that implement the GenericConfigurationManagerImpl protected interface. + CHIP_ERROR ReadConfigValue(Key key, bool & val) override; + CHIP_ERROR ReadConfigValue(Key key, uint32_t & val) override; + CHIP_ERROR ReadConfigValue(Key key, uint64_t & val) override; + CHIP_ERROR ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) override; + CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) override; + CHIP_ERROR WriteConfigValue(Key key, bool val) override; + CHIP_ERROR WriteConfigValue(Key key, uint32_t val) override; + CHIP_ERROR WriteConfigValue(Key key, uint64_t val) override; + CHIP_ERROR WriteConfigValueStr(Key key, const char * str) override; + CHIP_ERROR WriteConfigValueStr(Key key, const char * str, size_t strLen) override; + CHIP_ERROR WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) override; + void RunConfigUnitTest(void) override; + + // ===== Private members reserved for use by this class only. + + static void DoFactoryReset(intptr_t arg); +}; + +inline CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +/** + * Returns the platform-specific implementation of the ConfigurationManager object. + * + * Applications can use this to gain access to features of the ConfigurationManager + * that are specific to the selected platform. + */ +ConfigurationManager & ConfigurationMgrImpl(); + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConnectivityManagerImpl.cpp b/src/platform/stm32/ConnectivityManagerImpl.cpp new file mode 100644 index 00000000000000..0a3f507a999532 --- /dev/null +++ b/src/platform/stm32/ConnectivityManagerImpl.cpp @@ -0,0 +1,72 @@ +/* + * + * 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. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include + +#if INET_CONFIG_ENABLE_TCP_ENDPOINT +#include +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif + +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::TLV; +using namespace ::chip::DeviceLayer::Internal; + +namespace chip { +namespace DeviceLayer { + +ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; + +CHIP_ERROR ConnectivityManagerImpl::_Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic base classes that require it. +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + GenericConnectivityManagerImpl_Thread::_Init(); +#endif + + SuccessOrExit(err); + +exit: + return err; +} + +void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + // Forward the event to the generic base classes as needed. +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + GenericConnectivityManagerImpl_Thread::_OnPlatformEvent(event); +#endif +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConnectivityManagerImpl.h b/src/platform/stm32/ConnectivityManagerImpl.h new file mode 100644 index 00000000000000..f95110bb9c6af6 --- /dev/null +++ b/src/platform/stm32/ConnectivityManagerImpl.h @@ -0,0 +1,109 @@ +/* + * + * 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. + */ + +#pragma once + +#include +#include +#include +#if INET_CONFIG_ENABLE_TCP_ENDPOINT +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#else +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#else +#include +#endif +#include + +namespace chip { +namespace Inet { +class IPAddress; +} // namespace Inet +} // namespace chip + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the ConnectivityManager singleton object for stm32 platforms. + */ +class ConnectivityManagerImpl final : public ConnectivityManager, + public Internal::GenericConnectivityManagerImpl, + public Internal::GenericConnectivityManagerImpl_UDP, +#if INET_CONFIG_ENABLE_TCP_ENDPOINT + public Internal::GenericConnectivityManagerImpl_TCP, +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + public Internal::GenericConnectivityManagerImpl_BLE, +#else + public Internal::GenericConnectivityManagerImpl_NoBLE, +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + public Internal::GenericConnectivityManagerImpl_Thread, +#else + public Internal::GenericConnectivityManagerImpl_NoThread, +#endif + public Internal::GenericConnectivityManagerImpl_NoWiFi +{ + // Allow the ConnectivityManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class ConnectivityManager; + +private: + // ===== Members that implement the ConnectivityManager abstract interface. + + CHIP_ERROR _Init(void); + void _OnPlatformEvent(const ChipDeviceEvent * event); + + // ===== Members for internal use by the following friends. + + friend ConnectivityManager & ConnectivityMgr(void); + friend ConnectivityManagerImpl & ConnectivityMgrImpl(void); + + static ConnectivityManagerImpl sInstance; +}; + +/** + * Returns the public interface of the ConnectivityManager singleton object. + * + * Chip applications should use this to access features of the ConnectivityManager object + * that are common to all platforms. + */ +inline ConnectivityManager & ConnectivityMgr(void) +{ + return ConnectivityManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the ConnectivityManager singleton object. + * + * Chip applications can use this to gain access to features of the ConnectivityManager + * that are specific to the stm32 platform. + */ +inline ConnectivityManagerImpl & ConnectivityMgrImpl(void) +{ + return ConnectivityManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/DiagnosticDataProviderImpl.cpp b/src/platform/stm32/DiagnosticDataProviderImpl.cpp new file mode 100644 index 00000000000000..0c4a78efbc98d4 --- /dev/null +++ b/src/platform/stm32/DiagnosticDataProviderImpl.cpp @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the DiagnosticDataProvider object + * for stm32 platforms. + */ + +#include + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() +{ + static DiagnosticDataProviderImpl sInstance; + return sInstance; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeapUsed) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +DiagnosticDataProvider & GetDiagnosticDataProviderImpl() +{ + return DiagnosticDataProviderImpl::GetDefaultInstance(); +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/DiagnosticDataProviderImpl.h b/src/platform/stm32/DiagnosticDataProviderImpl.h new file mode 100644 index 00000000000000..85ac3fc206f8ae --- /dev/null +++ b/src/platform/stm32/DiagnosticDataProviderImpl.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the DiagnosticDataProvider object. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the PlatformManager singleton object for stm32 platforms. + */ + +class DiagnosticDataProviderImpl : public DiagnosticDataProvider +{ +public: + static DiagnosticDataProviderImpl & GetDefaultInstance(); + + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; + CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; + CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; +}; +/** + * Returns the platform-specific implementation of the DiagnosticDataProvider singleton object. + * + * Applications can use this to gain access to features of the DiagnosticDataProvider + * that are specific to the selected platform. + */ +DiagnosticDataProvider & GetDiagnosticDataProviderImpl(); +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/FactoryDataProvider.cpp b/src/platform/stm32/FactoryDataProvider.cpp new file mode 100644 index 00000000000000..06801c32f4076a --- /dev/null +++ b/src/platform/stm32/FactoryDataProvider.cpp @@ -0,0 +1,394 @@ +/* + * + * 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. + */ + +#include "FactoryDataProvider.h" + +#include +#include +#include +#include +#include + +namespace chip { +namespace { + +} // namespace + +namespace DeviceLayer { + +CHIP_ERROR FactoryDataProvider::Init() +{ + return CHIP_NO_ERROR; +} + +FactoryDataProvider & FactoryDataProvider::GetDefaultInstance() +{ + static FactoryDataProvider sInstance; + return sInstance; +} + +CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::SetSetupDiscriminator(uint16_t setupDiscriminator) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +// TODO: This should be moved to a method of P256Keypair +CHIP_ERROR LoadKeypairFromRaw(ByteSpan private_key, ByteSpan public_key, Crypto::P256Keypair & keypair) +{ + Crypto::P256SerializedKeypair serialized_keypair; + ReturnErrorOnFailure(serialized_keypair.SetLength(private_key.size() + public_key.size())); + memcpy(serialized_keypair.Bytes(), public_key.data(), public_key.size()); + memcpy(serialized_keypair.Bytes() + public_key.size(), private_key.data(), private_key.size()); + return keypair.Deserialize(serialized_keypair); +} + +CHIP_ERROR FactoryDataProvider::SignWithDeviceAttestationKey(const ByteSpan & messageToSign, MutableByteSpan & outSignBuffer) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + Crypto::P256ECDSASignature signature; + Crypto::P256Keypair keypair; + + const uint8_t kDevelopmentDAC_PublicKey_FFF1_8004[65] = { + 0x04, 0x50, 0x41, 0x38, 0xef, 0x31, 0xc9, 0xdd, 0x16, 0x0e, 0xb4, 0x6c, 0x6c, 0x17, 0x11, 0x4f, 0x9d, + 0x72, 0x88, 0x40, 0x80, 0x1f, 0x73, 0xbb, 0x9b, 0x5a, 0x2c, 0x51, 0x91, 0xc9, 0xb2, 0x06, 0x63, 0x01, + 0x9d, 0x94, 0x76, 0xd1, 0x93, 0x1b, 0x93, 0xff, 0x47, 0xf4, 0x32, 0x56, 0x37, 0x90, 0x35, 0xd2, 0x29, + 0x62, 0x0b, 0x7e, 0x21, 0x0e, 0x59, 0x2f, 0x26, 0x43, 0x7d, 0x2d, 0x57, 0x62, 0x05, + }; + const uint8_t kDevelopmentDAC_PrivateKey_FFF1_8004[32] = { + 0x82, 0x0a, 0x24, 0x2a, 0x03, 0x0e, 0xbc, 0xe1, 0x1f, 0x38, 0x73, 0x5a, 0xcf, 0x1a, 0x6f, 0x37, + 0xc3, 0xad, 0xa6, 0xe4, 0x32, 0xd2, 0x47, 0x0a, 0x8a, 0x41, 0x37, 0x43, 0xf8, 0x95, 0x63, 0xf3, + }; + ByteSpan kDacPrivateKey = ByteSpan(kDevelopmentDAC_PrivateKey_FFF1_8004); + ByteSpan kDacPublicKey = ByteSpan(kDevelopmentDAC_PublicKey_FFF1_8004); + + VerifyOrReturnError(IsSpanUsable(outSignBuffer), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(IsSpanUsable(messageToSign), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(outSignBuffer.size() >= signature.Capacity(), CHIP_ERROR_BUFFER_TOO_SMALL); + + // In a non-exemplary implementation, the public key is not needed here. It is used here merely because + // Crypto::P256Keypair is only (currently) constructable from raw keys if both private/public keys are present. + ReturnErrorOnFailure(LoadKeypairFromRaw(kDacPrivateKey, kDacPublicKey, keypair)); + ReturnErrorOnFailure(keypair.ECDSA_sign_msg(messageToSign.data(), messageToSign.size(), signature)); + + return CopySpanToMutableSpan(ByteSpan{ signature.ConstBytes(), signature.Length() }, outSignBuffer); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSetupDiscriminator(uint16_t & setupDiscriminator) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + setupDiscriminator = CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pIterationCount(uint32_t & iterationCount) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + constexpr uint32_t kDefaultTestVerifierIterationCount = 1000; + iterationCount = kDefaultTestVerifierIterationCount; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSetupPasscode(uint32_t & setupPasscode) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + setupPasscode = CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetVendorId(uint16_t & vendorId) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + vendorId = CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetProductId(uint16_t & productId) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + productId = CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetHardwareVersion(uint16_t & hardwareVersion) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + hardwareVersion = CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetPartNumber(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductURL(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductLabel(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductName(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetSerialNumber(char * buf, size_t bufSize) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + memcpy(buf, CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER, bufSize); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetHardwareVersionString(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pVerifier(MutableByteSpan & verifierSpan, size_t & verifierLen) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDefaultTestVerifier[97] = { + 0xb9, 0x61, 0x70, 0xaa, 0xe8, 0x03, 0x34, 0x68, 0x84, 0x72, 0x4f, 0xe9, 0xa3, 0xb2, 0x87, 0xc3, 0x03, 0x30, 0xc2, 0xa6, + 0x60, 0x37, 0x5d, 0x17, 0xbb, 0x20, 0x5a, 0x8c, 0xf1, 0xae, 0xcb, 0x35, 0x04, 0x57, 0xf8, 0xab, 0x79, 0xee, 0x25, 0x3a, + 0xb6, 0xa8, 0xe4, 0x6b, 0xb0, 0x9e, 0x54, 0x3a, 0xe4, 0x22, 0x73, 0x6d, 0xe5, 0x01, 0xe3, 0xdb, 0x37, 0xd4, 0x41, 0xfe, + 0x34, 0x49, 0x20, 0xd0, 0x95, 0x48, 0xe4, 0xc1, 0x82, 0x40, 0x63, 0x0c, 0x4f, 0xf4, 0x91, 0x3c, 0x53, 0x51, 0x38, 0x39, + 0xb7, 0xc0, 0x7f, 0xcc, 0x06, 0x27, 0xa1, 0xb8, 0x57, 0x3a, 0x14, 0x9f, 0xcd, 0x1f, 0xa4, 0x66, 0xcf, + }; + + verifierLen = sizeof(kDefaultTestVerifier); + if (verifierSpan.size() < verifierLen) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + memcpy(verifierSpan.data(), &kDefaultTestVerifier[0], verifierLen); + verifierSpan.reduce_size(verifierLen); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetCertificationDeclaration(MutableByteSpan & outBufferSpan) +{ + +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + //-> format_version = 1 + //-> vendor_id = 0xFFF1 + //-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, + // 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, + // 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, + // 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, + // 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, + // 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, + // 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] + //-> device_type_id = 0x0016 + //-> certificate_id = "CSA00000SWC00000-00" + //-> security_level = 0 + //-> security_information = 0 + //-> version_number = 1 + //-> certification_type = 0 + //-> dac_origin_vendor_id is not present + //-> dac_origin_product_id is not present + static const uint8_t kCdForAllExamples[539] = { + 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, + 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, + 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, + 0x04, 0x82, 0x01, 0x5d, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x05, 0x01, 0x80, + 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, 0x07, 0x80, 0x05, 0x08, + 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, 0x80, 0x05, 0x0e, 0x80, 0x05, + 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, + 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, + 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, + 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, + 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, + 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, + 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, + 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, + 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, + 0x4b, 0x80, 0x05, 0x4c, 0x80, 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, + 0x05, 0x52, 0x80, 0x05, 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, + 0x80, 0x05, 0x59, 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, + 0x5f, 0x80, 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, + 0x13, 0x43, 0x53, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x53, 0x57, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2d, 0x30, 0x30, + 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x24, 0x07, 0x01, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, + 0x80, 0x14, 0xfe, 0x34, 0x3f, 0x95, 0x99, 0x47, 0x76, 0x3b, 0x61, 0xee, 0x45, 0x39, 0x13, 0x13, 0x38, 0x49, 0x4f, 0xe6, + 0x7d, 0x8e, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x4a, 0x12, 0xf8, 0xd4, 0x2f, 0x90, 0x23, + 0x5c, 0x05, 0xa7, 0x71, 0x21, 0xcb, 0xeb, 0xae, 0x15, 0xd5, 0x90, 0x14, 0x65, 0x58, 0xe9, 0xc9, 0xb4, 0x7a, 0x1a, 0x38, + 0xf7, 0xa3, 0x6a, 0x7d, 0xc5, 0x02, 0x20, 0x20, 0xa4, 0x74, 0x28, 0x97, 0xc3, 0x0a, 0xed, 0xa0, 0xa5, 0x6b, 0x36, 0xe1, + 0x4e, 0xbb, 0xc8, 0x5b, 0xbd, 0xb7, 0x44, 0x93, 0xf9, 0x93, 0x58, 0x1e, 0xb0, 0x44, 0x4e, 0xd6, 0xca, 0x94, 0x0b + }; + + return CopySpanToMutableSpan(ByteSpan{ kCdForAllExamples }, outBufferSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetFirmwareInformation(MutableByteSpan & firmwareInformationSpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetDeviceAttestationCert(MutableByteSpan & attestationCertSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDevelopmentDAC_Cert_FFF1_8004[493] = { + 0x30, 0x82, 0x01, 0xe9, 0x30, 0x82, 0x01, 0x8e, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1e, 0x06, 0x7f, 0x3b, 0xfe, + 0xcd, 0xd8, 0x13, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3d, 0x31, 0x25, 0x30, + 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x50, + 0x41, 0x49, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, 0x31, 0x14, 0x30, 0x12, + 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x20, + 0x17, 0x0d, 0x32, 0x32, 0x30, 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, + 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x53, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, + 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x44, 0x41, 0x43, 0x20, + 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x2f, 0x30, 0x78, 0x38, 0x30, 0x30, 0x34, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, + 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x31, 0x14, 0x30, 0x12, 0x06, + 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x02, 0x0c, 0x04, 0x38, 0x30, 0x30, 0x34, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x03, 0x42, 0x00, 0x04, 0x50, 0x41, 0x38, 0xef, 0x31, 0xc9, 0xdd, 0x16, 0x0e, 0xb4, 0x6c, 0x6c, 0x17, 0x11, 0x4f, 0x9d, + 0x72, 0x88, 0x40, 0x80, 0x1f, 0x73, 0xbb, 0x9b, 0x5a, 0x2c, 0x51, 0x91, 0xc9, 0xb2, 0x06, 0x63, 0x01, 0x9d, 0x94, 0x76, + 0xd1, 0x93, 0x1b, 0x93, 0xff, 0x47, 0xf4, 0x32, 0x56, 0x37, 0x90, 0x35, 0xd2, 0x29, 0x62, 0x0b, 0x7e, 0x21, 0x0e, 0x59, + 0x2f, 0x26, 0x43, 0x7d, 0x2d, 0x57, 0x62, 0x05, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, + 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, + 0x07, 0x80, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa0, 0xa7, 0x1c, 0x2a, 0x5f, 0x74, 0x45, + 0x20, 0x5b, 0x12, 0xa6, 0x28, 0xca, 0xb7, 0x16, 0x45, 0xba, 0x2d, 0x5e, 0x72, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, 0x62, 0xd1, + 0x6c, 0x19, 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, + 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xe7, 0x79, 0xeb, 0x8b, 0xbb, 0xd8, 0xba, 0x28, 0x68, 0xd3, 0x7b, 0xfc, 0x3a, 0x0e, + 0x33, 0x87, 0x03, 0xdb, 0xe4, 0x5c, 0x54, 0x09, 0x8c, 0x8a, 0xe4, 0xa3, 0x84, 0x4e, 0xf5, 0xc8, 0x2b, 0x5b, 0x02, 0x21, + 0x00, 0x90, 0xe7, 0x6b, 0x2b, 0x83, 0x73, 0x92, 0xab, 0x29, 0x40, 0x39, 0x10, 0x40, 0xf6, 0x4d, 0xc7, 0x8c, 0x53, 0x01, + 0xac, 0x9d, 0x08, 0x66, 0x4f, 0xf6, 0xd0, 0x10, 0x4a, 0xfe, 0x98, 0xfc, 0x80, + }; + + return CopySpanToMutableSpan(ByteSpan(kDevelopmentDAC_Cert_FFF1_8004), attestationCertSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetProductAttestationIntermediateCert(MutableByteSpan & intermediateCertSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDevelopmentPAI_Cert_FFF1[463] = { + 0x30, 0x82, 0x01, 0xcb, 0x30, 0x82, 0x01, 0x71, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x56, 0xad, 0x82, 0x22, 0xad, + 0x94, 0x5b, 0x64, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, + 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, + 0x50, 0x41, 0x41, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, + 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, + 0x3d, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, + 0x65, 0x76, 0x20, 0x50, 0x41, 0x49, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, + 0x46, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x41, 0x9a, 0x93, 0x15, 0xc2, 0x17, 0x3e, 0x0c, 0x8c, 0x87, 0x6d, + 0x03, 0xcc, 0xfc, 0x94, 0x48, 0x52, 0x64, 0x7f, 0x7f, 0xec, 0x5e, 0x50, 0x82, 0xf4, 0x05, 0x99, 0x28, 0xec, 0xa8, 0x94, + 0xc5, 0x94, 0x15, 0x13, 0x09, 0xac, 0x63, 0x1e, 0x4c, 0xb0, 0x33, 0x92, 0xaf, 0x68, 0x4b, 0x0b, 0xaf, 0xb7, 0xe6, 0x5b, + 0x3b, 0x81, 0x62, 0xc2, 0xf5, 0x2b, 0xf9, 0x31, 0xb8, 0xe7, 0x7a, 0xaa, 0x82, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, + 0x04, 0x16, 0x04, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, 0x62, 0xd1, 0x6c, 0x19, + 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x6a, 0xfd, 0x22, + 0x77, 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x0a, 0x06, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xb2, 0xef, 0x27, + 0xf4, 0x9a, 0xe9, 0xb5, 0x0f, 0xb9, 0x1e, 0xea, 0xc9, 0x4c, 0x4d, 0x0b, 0xdb, 0xb8, 0xd7, 0x92, 0x9c, 0x6c, 0xb8, 0x8f, + 0xac, 0xe5, 0x29, 0x36, 0x8d, 0x12, 0x05, 0x4c, 0x0c, 0x02, 0x20, 0x65, 0x5d, 0xc9, 0x2b, 0x86, 0xbd, 0x90, 0x98, 0x82, + 0xa6, 0xc6, 0x21, 0x77, 0xb8, 0x25, 0xd7, 0xd0, 0x5e, 0xdb, 0xe7, 0xc2, 0x2f, 0x9f, 0xea, 0x71, 0x22, 0x0e, 0x7e, 0xa7, + 0x03, 0xf8, 0x91, + }; + + return CopySpanToMutableSpan(ByteSpan(kDevelopmentPAI_Cert_FFF1), intermediateCertSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pSalt(MutableByteSpan & saltSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDefaultTestVerifierSalt[16] = { + 0x53, 0x50, 0x41, 0x4b, 0x45, 0x32, 0x50, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x53, 0x61, 0x6c, 0x74, + }; + + size_t saltLen = sizeof(kDefaultTestVerifierSalt); + if (saltSpan.size() < saltLen) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + memcpy(saltSpan.data(), &kDefaultTestVerifierSalt[0], saltLen); + saltSpan.reduce_size(saltLen); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetEnableKey(MutableByteSpan & enableKeySpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/FactoryDataProvider.h b/src/platform/stm32/FactoryDataProvider.h new file mode 100644 index 00000000000000..2882b989e8902d --- /dev/null +++ b/src/platform/stm32/FactoryDataProvider.h @@ -0,0 +1,69 @@ +/* + * + * 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. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentialsProvider, + public CommissionableDataProvider, + public DeviceInstanceInfoProvider +{ +public: + CHIP_ERROR Init(); + static FactoryDataProvider & GetDefaultInstance(); + // ===== Members functions that implement the DeviceAttestationCredentialsProvider + CHIP_ERROR GetCertificationDeclaration(MutableByteSpan & outBuffer) override; + CHIP_ERROR GetFirmwareInformation(MutableByteSpan & out_firmware_info_buffer) override; + CHIP_ERROR GetDeviceAttestationCert(MutableByteSpan & outBuffer) override; + CHIP_ERROR GetProductAttestationIntermediateCert(MutableByteSpan & outBuffer) override; + CHIP_ERROR SignWithDeviceAttestationKey(const ByteSpan & messageToSign, MutableByteSpan & outSignBuffer) override; + + // ===== Members functions that implement the CommissionableDataProvider + CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) override; + CHIP_ERROR SetSetupDiscriminator(uint16_t setupDiscriminator) override; + CHIP_ERROR GetSpake2pIterationCount(uint32_t & iterationCount) override; + CHIP_ERROR GetSpake2pSalt(MutableByteSpan & saltBuf) override; + CHIP_ERROR GetSpake2pVerifier(MutableByteSpan & verifierBuf, size_t & verifierLen) override; + CHIP_ERROR GetSetupPasscode(uint32_t & setupPasscode) override; + CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override; + + // ===== Members functions that implement the DeviceInstanceInfoProvider + CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override; + CHIP_ERROR GetVendorId(uint16_t & vendorId) override; + CHIP_ERROR GetProductName(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductId(uint16_t & productId) override; + CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override; + CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) override; + CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVersion) override; + CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; + CHIP_ERROR GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) override; + + // ===== Members functions that are platform-specific + CHIP_ERROR GetEnableKey(MutableByteSpan & enableKey); +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/InetPlatformConfig.h b/src/platform/stm32/InetPlatformConfig.h new file mode 100644 index 00000000000000..44e4719c99ed95 --- /dev/null +++ b/src/platform/stm32/InetPlatformConfig.h @@ -0,0 +1,41 @@ +/* + * + * 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. + */ + +/** + * @file + * Platform-specific configuration overrides for the Inet + * Layer on stm32 platforms. + * + */ + +#pragma once + +// ==================== Platform Adaptations ==================== + +#ifndef INET_CONFIG_ENABLE_IPV4 +#error Inet IPv4 configuration should be configured at build generation time +#endif + +// ========== Platform-specific Configuration Overrides ========= + +#ifndef INET_CONFIG_NUM_TCP_ENDPOINTS +#define INET_CONFIG_NUM_TCP_ENDPOINTS 4 +#endif // INET_CONFIG_NUM_TCP_ENDPOINTS + +#ifndef INET_CONFIG_NUM_UDP_ENDPOINTS +#define INET_CONFIG_NUM_UDP_ENDPOINTS 4 +#endif // INET_CONFIG_NUM_UDP_ENDPOINTS diff --git a/src/platform/stm32/KeyValueStoreManagerImpl.cpp b/src/platform/stm32/KeyValueStoreManagerImpl.cpp new file mode 100644 index 00000000000000..b68ea2c1c9adc9 --- /dev/null +++ b/src/platform/stm32/KeyValueStoreManagerImpl.cpp @@ -0,0 +1,121 @@ +/* + * + * Copyright (c) 2021 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 "flash_wb.h" +#include +#include +#include +#include +#include + +#define MATTER_KEY_NAME_MAX_LENGTH (15 * 2) // ADD Max key name string size is 30 "keyType...;KeyName..." +namespace chip { +namespace DeviceLayer { +namespace PersistedStorage { +/** Singleton instance of the KeyValueStoreManager implementation object. + */ +KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; + +CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, + size_t offset) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if ((key != NULL) && (value != NULL) && (read_bytes_size != NULL)) + { + return this->_PrintError(NM_GetKeyValue(value, key, (uint32_t) value_size, read_bytes_size, SECTOR_SECURE)); + } + else + { + err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + } + return err; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) +{ + + ChipLogDetail(DataManagement, "DELETE=> %s", key); + if (key != NULL) + { + return this->_PrintError(NM_DeleteKey(key, SECTOR_SECURE)); + } + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) +{ + + if ((value_size != 0) && (key != NULL) && (value != NULL)) + { + + return this->_PrintError(NM_SetKeyValue((char *) value, (char *) key, (uint32_t) value_size, SECTOR_SECURE)); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_PrintError(NVM_StatusTypeDef err) +{ + switch (err) + { + case NVM_OK: + ChipLogDetail(DataManagement, "NVM_OK"); + return CHIP_NO_ERROR; + + case NVM_KEY_NOT_FOUND: + ChipLogDetail(DataManagement, "CHIP_ERROR_PERSISTED_STORAGE_NOT_FOUND"); + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + + case NVM_WRITE_FAILED: + ChipLogDetail(DataManagement, "NVM_WRITE_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_READ_FAILED: + ChipLogDetail(DataManagement, "NVM_READ_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_DELETE_FAILED: + ChipLogDetail(DataManagement, "NVM_DELETE_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_SIZE_FULL: + ChipLogDetail(DataManagement, "NVM_SIZE_FULL"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_BLOCK_SIZE_OVERFLOW: + ChipLogDetail(DataManagement, "NVM_BLOCK_SIZE_OVERFLOW"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_ERROR_BLOCK_ALIGN: + ChipLogDetail(DataManagement, "NVM_ERROR_BLOCK_ALIGN"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_BUFFER_TOO_SMALL: + ChipLogDetail(DataManagement, "NVM_BUFFER_TOO_SMALL"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + default: + ChipLogDetail(DataManagement, "NVM_UNKNOWN_ERROR "); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } +} + +} // namespace PersistedStorage +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/KeyValueStoreManagerImpl.h b/src/platform/stm32/KeyValueStoreManagerImpl.h new file mode 100644 index 00000000000000..335ffb2b907df9 --- /dev/null +++ b/src/platform/stm32/KeyValueStoreManagerImpl.h @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2021 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. + */ + +#ifndef MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ +#define MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ + +#pragma once + +#include + +#include "flash_wb.h" +#include "stm_logging.h" + +namespace chip { +namespace DeviceLayer { +namespace PersistedStorage { + +class KeyValueStoreManagerImpl : public KeyValueStoreManager +{ + // Allow the KeyValueStoreManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class KeyValueStoreManager; + +public: + CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, size_t offset); + + CHIP_ERROR _Delete(const char * key); + + CHIP_ERROR _Put(const char * key, const void * value, size_t value_size); + + CHIP_ERROR _PrintError(NVM_StatusTypeDef err); + +private: + // ===== Members for internal use by the following friends. + friend KeyValueStoreManager & KeyValueStoreMgr(); + friend KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(); + + static KeyValueStoreManagerImpl sInstance; +}; + +/** + * Returns the public interface of the KeyValueStoreManager singleton object. + * + * Chip applications should use this to access features of the KeyValueStoreManager object + * that are common to all platforms. + */ +inline KeyValueStoreManager & KeyValueStoreMgr(void) +{ + return KeyValueStoreManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the KeyValueStoreManager singleton object. + * + * Chip applications can use this to gain access to features of the KeyValueStoreManager + * that are specific to the STM32 platform. + */ +inline KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(void) +{ + return KeyValueStoreManagerImpl::sInstance; +} + +} // namespace PersistedStorage +} // namespace DeviceLayer +} // namespace chip + +#endif /* MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ */ diff --git a/src/platform/stm32/PlatformManagerImpl.cpp b/src/platform/stm32/PlatformManagerImpl.cpp new file mode 100644 index 00000000000000..60148b07f6e4ca --- /dev/null +++ b/src/platform/stm32/PlatformManagerImpl.cpp @@ -0,0 +1,116 @@ +/* + * + * Copyright (c) 2021 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. + */ + +/** + * @file + * Provides an implementation of the PlatformManager object + * for the stm32 platform. + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +PlatformManagerImpl PlatformManagerImpl::sInstance; +extern "C" int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen); + +CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) +{ + System::Clock::InitClock_RealTime(); + chip::Crypto::add_entropy_source(mbedtls_hardware_poll, NULL, 16); + ReturnErrorOnFailure(Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack()); + return CHIP_NO_ERROR; +} + +void PlatformManagerImpl::_RunEventLoop(void) +{ + Internal::GenericPlatformManagerImpl_FreeRTOS::_RunEventLoop(); +} + +void PlatformManagerImpl::_Shutdown() +{ + uint64_t upTime = 0; + + if (GetDiagnosticDataProvider().GetUpTime(upTime) == CHIP_NO_ERROR) + { + uint32_t totalOperationalHours = 0; + + if (ConfigurationMgr().GetTotalOperationalHours(totalOperationalHours) == CHIP_NO_ERROR) + { + ConfigurationMgr().StoreTotalOperationalHours(totalOperationalHours + static_cast(upTime / 3600)); + } + else + { + ChipLogError(DeviceLayer, "Failed to get total operational hours of the Node"); + } + } + else + { + ChipLogError(DeviceLayer, "Failed to get current uptime since the Node’s last reboot"); + } + + Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapFree(uint64_t & currentHeapFree) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapUsed(uint64_t & currentHeapUsed) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetRebootCount(uint16_t & rebootCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetUpTime(uint64_t & upTime) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetBootReasons(uint8_t & bootReasons) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/PlatformManagerImpl.h b/src/platform/stm32/PlatformManagerImpl.h new file mode 100644 index 00000000000000..8de9bfa4a24f48 --- /dev/null +++ b/src/platform/stm32/PlatformManagerImpl.h @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * 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. + */ + +/** + * @file + * Provides an implementation of the PlatformManager object + * for the stm32 platforms. + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the PlatformManager singleton object for the stm32 platform. + */ +class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS +{ + // Allow the PlatformManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend PlatformManager; + + // Allow the generic implementation base class to call helper methods on + // this class. +#ifndef DOXYGEN_SHOULD_SKIP_THIS + friend Internal::GenericPlatformManagerImpl_FreeRTOS; +#endif + +public: + // ===== Platform-specific members that may be accessed directly by the application. + + CHIP_ERROR InitLwIPCoreLock(void); + // static void HandleESPSystemEvent(void * arg, esp_event_base_t eventBase, int32_t eventId, void * eventData); + +private: + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR _InitChipStack(void); + void _RunEventLoop(void); + void _Shutdown(); + CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); + CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); + CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + + CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); + CHIP_ERROR _GetUpTime(uint64_t & upTime); + CHIP_ERROR _GetTotalOperationalHours(uint32_t & totalOperationalHours); + CHIP_ERROR _GetBootReasons(uint8_t & bootReasons); + // ===== Members for internal use by the following friends. + + friend PlatformManager & PlatformMgr(void); + friend PlatformManagerImpl & PlatformMgrImpl(void); + + uint64_t mStartTimeMilliseconds = 0; + + static PlatformManagerImpl sInstance; +}; + +/** + * Returns the public interface of the PlatformManager singleton object. + * + * Chip applications should use this to access features of the PlatformManager object + * that are common to all platforms. + */ +inline PlatformManager & PlatformMgr(void) +{ + return PlatformManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the PlatformManager singleton object. + * + * Chip applications can use this to gain access to features of the PlatformManager + * that are specific to the stm32 platform. + */ +inline PlatformManagerImpl & PlatformMgrImpl(void) +{ + return PlatformManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32Config.cpp b/src/platform/stm32/STM32Config.cpp new file mode 100644 index 00000000000000..cf1a6bdc652e19 --- /dev/null +++ b/src/platform/stm32/STM32Config.cpp @@ -0,0 +1,105 @@ +/* + * + * Copyright (c) 2021 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 "flash_wb.h" +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +CHIP_ERROR STM32Config::Init() +{ + return CHIP_NO_ERROR; +} + +template +CHIP_ERROR STM32Config::ReadConfigValue(Key key, T & val) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_GetKeyValue((void *) &val, (char *) buffer_key, sizeof(val), read_by_size, SECTOR_NO_SECURE); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR STM32Config::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) +{ + + return ReadConfigValueBin(key, reinterpret_cast(buf), bufSize, outLen); +} + +CHIP_ERROR STM32Config::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, bool & val); +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, uint32_t & val); +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, uint64_t & val); + +CHIP_ERROR STM32Config::WriteConfigValue(Key key, uint32_t val) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_SetKeyValue((char *) &val, (char *) buffer_key, sizeof(val), SECTOR_NO_SECURE); + return CHIP_NO_ERROR; +} + +CHIP_ERROR STM32Config::WriteConfigValueStr(Key key, const char * str) +{ + return WriteConfigValueStr(key, str, (str != NULL) ? strlen(str) : 0); +} + +CHIP_ERROR STM32Config::WriteConfigValueStr(Key key, const char * str, size_t strLen) +{ + return WriteConfigValueBin(key, reinterpret_cast(str), strLen); +} + +CHIP_ERROR STM32Config::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_SetKeyValue((char *) data, (char *) buffer_key, dataLen, SECTOR_NO_SECURE); + return CHIP_NO_ERROR; +} + +bool STM32Config::ConfigValueExists(Key key) +{ + return false; +} + +CHIP_ERROR STM32Config::FactoryResetConfig(void) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +void STM32Config::RunConfigUnitTest(void) {} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32Config.h b/src/platform/stm32/STM32Config.h new file mode 100644 index 00000000000000..98ddb844616342 --- /dev/null +++ b/src/platform/stm32/STM32Config.h @@ -0,0 +1,93 @@ +/* + * + * 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. + */ + +/** + * @file + * Utilities for accessing persisted device configuration on + * on STM32 platforms. + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +/* Base for the category calculation when determining the key IDs */ + +class STM32Config +{ +public: + using Key = uint32_t; + + // Key definitions for well-known keys. + // Factory config keys + static constexpr Key kConfigKey_SerialNum = 0; + static constexpr Key kConfigKey_MfrDeviceId = 1; + static constexpr Key kConfigKey_MfrDeviceCert = 2; + static constexpr Key kConfigKey_MfrDevicePrivateKey = 3; + static constexpr Key kConfigKey_ManufacturingDate = 4; + static constexpr Key kConfigKey_SetupPinCode = 5; + static constexpr Key kConfigKey_MfrDeviceICACerts = 6; + static constexpr Key kConfigKey_SetupDiscriminator = 7; + static constexpr Key kConfigKey_Spake2pIterationCount = 8; + static constexpr Key kConfigKey_Spake2pSalt = 9; + static constexpr Key kConfigKey_Spake2pVerifier = 10; + // CHIP Config Keys + static constexpr Key kConfigKey_FabricId = 8; + static constexpr Key kConfigKey_ServiceConfig = 9; + static constexpr Key kConfigKey_PairedAccountId = 10; + static constexpr Key kConfigKey_ServiceId = 11; + static constexpr Key kConfigKey_FabricSecret = 12; + static constexpr Key kConfigKey_LastUsedEpochKeyId = 13; + static constexpr Key kConfigKey_FailSafeArmed = 14; + static constexpr Key kConfigKey_GroupKey = 15; + static constexpr Key kConfigKey_HardwareVersion = 16; + static constexpr Key kConfigKey_RegulatoryLocation = 17; + static constexpr Key kConfigKey_CountryCode = 18; + static constexpr Key kConfigKey_HourFormat = 20; + static constexpr Key kConfigKey_CalendarType = 21; + static constexpr Key kConfigKey_Breadcrumb = 22; + static constexpr Key kConfigKey_UniqueId = 23; + static constexpr Key kConfigKey_ProductRevision = 24; + // Set key id limits for each group. + static constexpr Key kConfigKey_Base = kConfigKey_SerialNum; + static constexpr Key kConfigKey_Max = kConfigKey_UniqueId; + + static CHIP_ERROR Init(); + // Config value accessors. + template + // Config value accessors. + static CHIP_ERROR ReadConfigValue(Key key, T & val); + // Configuration methods used by the GenericConfigurationManagerImpl<> template. + static CHIP_ERROR ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen); + static CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen); + static CHIP_ERROR WriteConfigValue(Key key, uint32_t val); + static CHIP_ERROR WriteConfigValueStr(Key key, const char * str); + static CHIP_ERROR WriteConfigValueStr(Key key, const char * str, size_t strLen); + static CHIP_ERROR WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen); + static CHIP_ERROR ClearConfigValue(Key key); + static bool ConfigValueExists(Key key); + static CHIP_ERROR FactoryResetConfig(void); + static void RunConfigUnitTest(void); +}; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32FreeRtosHooks.cpp b/src/platform/stm32/STM32FreeRtosHooks.cpp new file mode 100644 index 00000000000000..cdf1909e8c4393 --- /dev/null +++ b/src/platform/stm32/STM32FreeRtosHooks.cpp @@ -0,0 +1,120 @@ +/* + * + * Copyright (c) 2021 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 "STM32FreeRtosHooks.h" +#include "FreeRTOS.h" +#include "mbedtls/memory_buffer_alloc.h" + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#define MBEDTLS_HEAP_SIZE 15000 +#include "mbedtls/pk.h" +#include "mbedtls/platform.h" +#include "mbedtls/sha1.h" +#include "mbedtls/sha256.h" +#include "mbedtls/x509_crt.h" + +#include "mbedtls/threading.h" +#include "threading_alt.h" + +#include + +static uint8_t mdedtls_heap[MBEDTLS_HEAP_SIZE]; + +static void freertos_mbedtls_heap_init(void); + +static inline void mutex_init(mbedtls_threading_mutex_t * mutex) +{ + mutex->mutex = xSemaphoreCreateMutex(); + + if (mutex->mutex != NULL) + { + mutex->is_valid = 1; + } + else + { + mutex->is_valid = 0; + } +} + +static inline void mutex_free(mbedtls_threading_mutex_t * mutex) +{ + if (mutex->is_valid == 1) + { + vSemaphoreDelete(mutex->mutex); + mutex->is_valid = 0; + } +} + +static inline int mutex_lock(mbedtls_threading_mutex_t * mutex) +{ + int ret = MBEDTLS_ERR_THREADING_BAD_INPUT_DATA; + + if (mutex->is_valid == 1) + { + if (xSemaphoreTake(mutex->mutex, portMAX_DELAY)) + { + ret = 0; + } + else + { + ret = MBEDTLS_ERR_THREADING_MUTEX_ERROR; + } + } + + return ret; +} + +static inline int mutex_unlock(mbedtls_threading_mutex_t * mutex) +{ + int ret = MBEDTLS_ERR_THREADING_BAD_INPUT_DATA; + + if (mutex->is_valid == 1) + { + if (xSemaphoreGive(mutex->mutex)) + { + ret = 0; + } + else + { + ret = MBEDTLS_ERR_THREADING_MUTEX_ERROR; + } + } + + return ret; +} + +void freertos_mbedtls_mutex_init(void) +{ + // Configure mbedtls to use mutexes from FreeRTOS + mbedtls_threading_set_alt(mutex_init, mutex_free, mutex_lock, mutex_unlock); +} + +static void freertos_mbedtls_heap_init(void) +{ + mbedtls_memory_buffer_alloc_init(mdedtls_heap, sizeof(mdedtls_heap)); +} + +void freertos_mbedtls_init(void) +{ + freertos_mbedtls_mutex_init(); + freertos_mbedtls_heap_init(); +} diff --git a/src/platform/stm32/STM32FreeRtosHooks.h b/src/platform/stm32/STM32FreeRtosHooks.h new file mode 100644 index 00000000000000..d49d7ab05a4994 --- /dev/null +++ b/src/platform/stm32/STM32FreeRtosHooks.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 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 "FreeRTOS.h" +#include "semphr.h" +#ifdef __cplusplus +extern "C" { +#endif +void freertos_mbedtls_init(void); +#ifdef __cplusplus +} +#endif diff --git a/src/platform/stm32/SystemPlatformConfig.h b/src/platform/stm32/SystemPlatformConfig.h new file mode 100644 index 00000000000000..f2ed9d41b35d77 --- /dev/null +++ b/src/platform/stm32/SystemPlatformConfig.h @@ -0,0 +1,43 @@ +/* + * + * 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. + */ + +/** + * @file + * Platform-specific configuration overrides for the CHIP System + * Layer on stm32 platforms. + * + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { +struct ChipDeviceEvent; +} // namespace DeviceLayer +} // namespace chip + +// ==================== Platform Adaptations ==================== +#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 +#define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * + +// ========== Platform-specific Configuration Overrides ========= + +#ifndef CHIP_SYSTEM_CONFIG_NUM_TIMERS +#define CHIP_SYSTEM_CONFIG_NUM_TIMERS 16 +#endif // CHIP_SYSTEM_CONFIG_NUM_TIMERS diff --git a/src/platform/stm32/ThreadStackManagerImpl.cpp b/src/platform/stm32/ThreadStackManagerImpl.cpp new file mode 100644 index 00000000000000..ee97ff2ad0927b --- /dev/null +++ b/src/platform/stm32/ThreadStackManagerImpl.cpp @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the ThreadStackManager object for the + * STM32 platform using the OpenThread + * stack. + * + */ +/* this file behaves like a config.h, comes first */ +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "dbg_trace.h" +#include +#include + +//#include + +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +using namespace ::chip::DeviceLayer::Internal; + +ThreadStackManagerImpl ThreadStackManagerImpl::sInstance; + +CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack(void) +{ + return InitThreadStack(NULL); +} + +CHIP_ERROR ThreadStackManagerImpl::InitThreadStack(otInstance * otInst) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic implementation base classes. + err = GenericThreadStackManagerImpl_FreeRTOS::DoInit(); + SuccessOrExit(err); + err = GenericThreadStackManagerImpl_OpenThread::DoInit(otInst); + SuccessOrExit(err); + +exit: + return err; +} + +CHIP_ERROR ThreadStackManagerImpl::_StartThreadTask() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic implementation base classes. + err = GenericThreadStackManagerImpl_FreeRTOS::_StartThreadTask(); + SuccessOrExit(err); + +exit: + return err; +} +CHIP_ERROR ThreadStackManagerImpl::SetThreadEnabled(bool val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + err = GenericThreadStackManagerImpl_OpenThread::_SetThreadEnabled(val); + + return err; +} + +bool ThreadStackManagerImpl::IsInitialized() +{ + return sInstance.mThreadStackLock != NULL; +} + +} // namespace DeviceLayer +} // namespace chip + +using namespace ::chip::DeviceLayer; + +void ThreadStackManagerImpl::_ProcessThreadActivity() +{ + GenericThreadStackManagerImpl_OpenThread::_ProcessThreadActivity(); +} + +/** + * Glue function called directly by the OpenThread stack when tasklet processing work + * is pending. +// */ +extern "C" void otTaskletsSignalPending(otInstance * p_instance) +{ + ThreadStackMgrImpl().SignalThreadActivityPending(); +} + +/** + * Glue function called directly by the OpenThread stack when system event processing work + * is pending. + */ +extern "C" { +void otSysEventSignalPending(void) +{ + ChipLogProgress(DeviceLayer, "otSysEventSignalPending DEBUG THIS "); + // BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR(); + // portYIELD_FROM_ISR(yieldRequired); +} +} +extern "C" { +void * otPlatCAlloc(size_t aNum, size_t aSize) +{ + return CHIPPlatformMemoryCalloc(aNum, aSize); +} +} + +extern "C" { +void otPlatFree(void * aPtr) +{ + CHIPPlatformMemoryFree(aPtr); +} +} diff --git a/src/platform/stm32/ThreadStackManagerImpl.h b/src/platform/stm32/ThreadStackManagerImpl.h new file mode 100644 index 00000000000000..d721c7f32c9ce8 --- /dev/null +++ b/src/platform/stm32/ThreadStackManagerImpl.h @@ -0,0 +1,128 @@ +/* + * + * 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. + */ + +/** + * @file + * Provides an implementation of the ThreadStackManager object + * for stm32 platforms and the OpenThread + * stack. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +extern "C" void otSysEventSignalPending(void); + +namespace chip { +namespace DeviceLayer { + +class ThreadStackManager; +class ThreadStackManagerImpl; +namespace Internal { +extern int GetEntropy(uint8_t * buf, size_t bufSize); +} + +/** + * Concrete implementation of the ThreadStackManager singleton object for stm32 platforms + * using the OpenThread stack. + */ +class ThreadStackManagerImpl final : public ThreadStackManager, + public Internal::GenericThreadStackManagerImpl_OpenThread, + public Internal::GenericThreadStackManagerImpl_FreeRTOS +{ + // Allow the ThreadStackManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class ThreadStackManager; + + // Allow the generic implementation base classes to call helper methods on + // this class. +#ifndef DOXYGEN_SHOULD_SKIP_THIS + friend Internal::GenericThreadStackManagerImpl_OpenThread; + friend Internal::GenericThreadStackManagerImpl_OpenThread; + friend Internal::GenericThreadStackManagerImpl_FreeRTOS; +#endif + + // Allow glue functions called by OpenThread to call helper methods on this + // class. + friend void ::otTaskletsSignalPending(otInstance * otInst); + friend void ::otSysEventSignalPending(void); + +public: + // ===== Platform-specific members that may be accessed directly by the application. + + using ThreadStackManager::InitThreadStack; + CHIP_ERROR InitThreadStack(otInstance * otInst); + void SendThreadmsg(); + + CHIP_ERROR SetThreadEnabled(bool val); + +protected: + CHIP_ERROR _StartThreadTask(); + + void _ProcessThreadActivity(); + +private: + // ===== Methods that implement the ThreadStackManager abstract interface. + + CHIP_ERROR _InitThreadStack(void); + + // ===== Members for internal use by the following friends. + + friend ThreadStackManager & ::chip::DeviceLayer::ThreadStackMgr(void); + friend ThreadStackManagerImpl & ::chip::DeviceLayer::ThreadStackMgrImpl(void); + friend int Internal::GetEntropy(uint8_t * buf, size_t bufSize); + + static ThreadStackManagerImpl sInstance; + + static bool IsInitialized(); + + // ===== Private members for use by this class only. + + ThreadStackManagerImpl() = default; +}; + +/** + * Returns the public interface of the ThreadStackManager singleton object. + * + * chip applications should use this to access features of the ThreadStackManager object + * that are common to all platforms. + */ +inline ThreadStackManager & ThreadStackMgr(void) +{ + return ThreadStackManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the ThreadStackManager singleton object. + * + * chip applications can use this to gain access to features of the ThreadStackManager + * that are specific to the platform. + */ +inline ThreadStackManagerImpl & ThreadStackMgrImpl(void) +{ + return ThreadStackManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/args.gni b/src/platform/stm32/args.gni new file mode 100644 index 00000000000000..38080e25dd39ad --- /dev/null +++ b/src/platform/stm32/args.gni @@ -0,0 +1,53 @@ +# Copyright (c) 2023 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/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${chip_root}/examples/platform/stm32/args.gni") + +# ARM architecture flags will be set based on stm32_family. +arm_platform_config = "${stm32_sdk_build_root}/stm32_arm.gni" +chip_device_platform = "stm32" + +# add board protector for stm32wb +chip_with_lwip = false +mbedtls_target = "${stm32_sdk_build_root}:mbedtls" + +# GLOBAL CONFIG +chip_monolithic_tests = false +chip_system_config_provide_statistics = false +chip_config_memory_management = "platform" + +# FREERTOS CONFIG +chip_stack_lock_tracking = "fatal" + +# SHELL CONFIG +chip_build_libshell = false + +# OPENTHREAD CONFIG +chip_enable_openthread = true + +# NFC CONFIG +chip_enable_nfc = false + +# INET CONFIG for thread +chip_inet_config_enable_ipv4 = false +chip_inet_config_enable_dns_resolver = false +chip_inet_config_enable_tcp_endpoint = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_mdns = "platform" + +# OTA CONFIG +chip_enable_ota_requestor = false diff --git a/src/system/BUILD.gn b/src/system/BUILD.gn index 7ce311d6499f19..2eae6348e0b12d 100644 --- a/src/system/BUILD.gn +++ b/src/system/BUILD.gn @@ -62,6 +62,8 @@ if (chip_device_platform == "cc13x2_26x2") { import("//build_overrides/cyw30739_sdk.gni") } else if (chip_device_platform == "mt793x") { import("//build_overrides/mt793x_sdk.gni") +} else if (chip_device_platform == "stm32") { + import("//build_overrides/stm32_sdk.gni") } buildconfig_header("system_buildconfig") { @@ -177,6 +179,9 @@ source_set("system_config_header") { if (chip_device_platform == "cyw30739") { public_deps += [ "${cyw30739_sdk_build_root}:cyw30739_sdk" ] } + if (chip_device_platform == "stm32") { + public_deps += [ "${stm32_sdk_build_root}:stm32_sdk" ] + } # Add platform here as needed. } diff --git a/third_party/st/BUILD.gn b/third_party/st/BUILD.gn new file mode 100644 index 00000000000000..2868aa880a6b45 --- /dev/null +++ b/third_party/st/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2023 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/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${chip_root}/src/platform/device.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +declare_args() { + # Build target to use for STM32 SDK. Use this to set global SDK defines. + stm32_sdk_target = "" +} + +assert(stm32_sdk_target != "", "stm32_sdk_target must be specified") + +group("stm32_sdk") { + public_deps = [ stm32_sdk_target ] +} + +config("stm32_mbedtls_config") { + if (stm32_family == "stm32wb5") { + defines = [ "MBEDTLS_USER_CONFIG_FILE=" ] + + include_dirs = [ + chip_root, + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + ] + } +} +mbedtls_target("mbedtls") { + public_configs = [ ":stm32_mbedtls_config" ] + public_deps = [ "${stm32_sdk_build_root}:stm32_sdk" ] +} diff --git a/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper b/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper new file mode 100644 index 00000000000000..0c79564e0d8c0a --- /dev/null +++ b/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper @@ -0,0 +1,77 @@ +# STM32WB5MM-DK_sdk.gn_helper + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +declare_args() { + ## PATHS FOR STM32WB BOARD ## + stm32_board_src = "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK" + bsp_stm32wb5mm_dk = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/STM32WB5MM-DK" + components_common = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/Common" + components_ssd1315 = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/ssd1315" + components_s25fl128s = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/s25fl128s" + + ## PATHS FOR ST UTILITIES ## + stm32_fonts_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/Fonts" + stm32_lcd_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/LCD" + stm32_lpm_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/lpm/tiny_lpm" +} + +SOURCES = [ + # BOARD APPLICATION SRC(in examples/platform/stm32/common/STM32WB5MM-DK/) + "${stm32_board_src}/Src/entropy_hardware_poll.c", + "${stm32_board_src}/Src/flash_driver.c", + "${stm32_board_src}/Src/flash_wb.c", + "${stm32_board_src}/Src/freertos_port.c", + "${stm32_board_src}/Src/hw_timerserver.c", + "${stm32_board_src}/Src/hw_uart.c", + "${stm32_board_src}/Src/stm32_lpm_if.c", + "${stm32_board_src}/Src/stm32wbxx_hal_msp.c", + "${stm32_board_src}/Src/stm32wbxx_hal_timebase_tim.c", + "${stm32_board_src}/Src/stm32wbxx_it.c", + "${stm32_board_src}/Src/stm_logging.c", + "${stm32_board_src}/Src/syscalls.c", + "${stm32_board_src}/Src/system_stm32wbxx.c", + "${stm32_board_src}/Src/otp.c", + "${stm32_board_src}/STM32_WPAN/Target/hw_ipcc.c", + + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/matter_config.h", + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h", + + #BSP DRIVERS + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk_bus.c", + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk_lcd.c", + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk.c", + + #BSP COMPONENTS + "${components_ssd1315}/ssd1315_reg.c", + "${components_ssd1315}/ssd1315.c", + + # BOARD UTILITIES + "${stm32_lpm_util}/stm32_lpm.c", + "${stm32_lcd_util}/stm32_lcd.c", + ] + +INCLUDE_DIRS = [ + "${components_common}", + "${components_s25fl128s}", + "${components_ssd1315}", + + "${bsp_stm32wb5mm_dk}", + + "${stm32_lpm_util}", + "${stm32_fonts_util}", + "${stm32_lcd_util}", + + "${stm32_board_src}/Inc", + "${stm32_board_src}/STM32_WPAN/App", + ] + +DEFINES = [ + ] + +LIBS = [ + ] + +FLAGS = [ + ] diff --git a/third_party/st/FAMILY/stm32wb5_sdk.gn_helper b/third_party/st/FAMILY/stm32wb5_sdk.gn_helper new file mode 100644 index 00000000000000..eb660301f13344 --- /dev/null +++ b/third_party/st/FAMILY/stm32wb5_sdk.gn_helper @@ -0,0 +1,173 @@ +# stm32wb5_sdk.gn_helper + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("//build_overrides/freertos.gni") +import("//build_overrides/mbedtls.gni") +import("//build_overrides/lwip.gni") + +declare_args() { + + # CSMSIS PATHS # + cmsis = "${chip_root}/third_party/st/STM32CubeWB/Drivers/CMSIS" + + ## PATHS FOR STM32WB FAMILY ## + stm32_wb_sdk = "${chip_root}/third_party/st/STM32CubeWB/Drivers" + stm32_wb_hal = "${chip_root}/third_party/st/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver" + cmsis_device_wb = "${chip_root}/third_party/st/STM32CubeWB/Drivers/CMSIS/Device/ST/STM32WBxx" + stm32_wpan_sdk = "${chip_root}/third_party/st/STM32CubeWB/Middlewares/ST/STM32_WPAN" + stm32_config_files = "${chip_root}/examples/platform/stm32/config_files/STM32WB5" + + ## PATHS FOR FREERTOS ## + freertos_st = "${chip_root}/third_party/st/STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source" + +} + +SOURCES = [ + #HAL DRIVERS + "${stm32_wb_hal}/Src/stm32wbxx_hal_cortex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_dma.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_exti.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_flash_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_flash.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_gpio.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_ipcc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_pwr_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_pwr.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_qspi.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rcc_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rcc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rng.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rtc_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rtc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_spi_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_spi.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_tim_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_tim.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_uart_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_uart.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal.c", + + #WPAN + "${stm32_wpan_sdk}/ble/core/auto/ble_events.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_gap_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_gatt_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_hal_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_hci_le.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_l2cap_aci.c", + "${stm32_wpan_sdk}/ble/core/template/osal.c", + "${stm32_wpan_sdk}/ble/svc/Src/svc_ctl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/shci/shci.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/hci_tl_if.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/hci_tl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/shci_tl_if.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/shci_tl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/tl_mbox.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/tl_thread_hci.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/channel_manager.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/channel_monitor.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/child_supervision.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/coap.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/commissioner.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/crypto.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dataset_ftd.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dataset.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/diag.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dns.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dns_server.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/errors.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/icmp6.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/instance.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/ip6.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/jam_detection.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/joiner.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/link_raw.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/link.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/message.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/netdata.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/network_time.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread_api_config_ftd.h", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread_api_wb.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/radio.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/server.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/srp_client.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/tasklet.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/thread_ftd.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/thread.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/udp.c", + "${stm32_wpan_sdk}/utilities/dbg_trace.c", + "${stm32_wpan_sdk}/utilities/stm_list.c", + "${stm32_wpan_sdk}/utilities/stm_queue.c", + + #FREERTOS + "${stm32_config_files}/FreeRTOSConfig.h", + "${freertos_st}/CMSIS_RTOS_V2/cmsis_os2.c", + "${freertos_st}/croutine.c", + "${freertos_st}/event_groups.c", + "${freertos_st}/list.c", + "${freertos_st}/portable/GCC/ARM_CM4F/port.c", + "${freertos_st}/portable/MemMang/heap_4.c", + "${freertos_st}/queue.c", + "${freertos_st}/stream_buffer.c", + "${freertos_st}/tasks.c", + "${freertos_st}/timers.c", +] + +INCLUDE_DIRS = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + "${chip_root}/src/include/", + "${cmsis}/Include", + "${cmsis_device_wb}/Include", + "${stm32_wb_hal}/Inc", + "${stm32_wb_hal}/Inc/Legacy", + "${chip_root}/src/platform/stm32", + "${chip_root}/src/include/", + + #WPAN + "${stm32_wpan_sdk}/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/shci/", + "${stm32_wpan_sdk}/ble/core/", + "${stm32_wpan_sdk}/ble/core/auto/", + "${stm32_wpan_sdk}/ble/core/template/", + "${stm32_wpan_sdk}/ble/svc/Inc/", + "${stm32_wpan_sdk}/ble/svc/Src/", + "${stm32_wpan_sdk}/ble/", + "${stm32_wpan_sdk}/thread/openthread/stack/include/openthread/", + "${stm32_wpan_sdk}/thread/openthread/stack/src/core/", + "${stm32_wpan_sdk}/thread/openthread/stack/src/core/config/", + "${stm32_wpan_sdk}/thread/openthread/stack/include/", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/", + "${stm32_wpan_sdk}/thread/openthread/", + "${stm32_wpan_sdk}/interface/patterns/ble-thread/tl/", + "${stm32_wpan_sdk}/utilities/", + + #FREERTOS INCLUDES + "${freertos_st}/include", + "${stm32_config_files}/", + "${freertos_st}/portable/GCC/ARM_CM4F", + "${freertos_st}/portable", + "${freertos_st}/CMSIS_RTOS_V2", + +] + +DEFINES = [ + "CHIP_PROJECT_CONFIG_INCLUDE=", + "CHIP_HAVE_CONFIG_H", + "OPENTHREAD_CONFIG_FILE=", + "MBEDTLS_CONFIG_FILE=", + "CORE_CM4", + "THREAD_WB", + "STM32WB55xx", + "USE_STM32WB5M_DK", +] + +LIBS = [ + # add any .o/.a library here +] + +FLAGS = [ +] diff --git a/third_party/st/STM32CubeWB b/third_party/st/STM32CubeWB new file mode 160000 index 00000000000000..d23878380596ba --- /dev/null +++ b/third_party/st/STM32CubeWB @@ -0,0 +1 @@ +Subproject commit d23878380596ba031e33fcfa4841ff91aa1ab024 diff --git a/third_party/st/stm32_arm.gni b/third_party/st/stm32_arm.gni new file mode 100644 index 00000000000000..580506c483b5ca --- /dev/null +++ b/third_party/st/stm32_arm.gni @@ -0,0 +1,23 @@ +# Copyright (c) 2023 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("stm32_board.gni") + +if (stm32_family == "stm32wb55" || stm32_family == "stm32wb5") { + arm_arch = "armv7e-m" + arm_abi = "aapcs" + arm_cpu = "cortex-m4" + arm_float_abi = "hard" + arm_fpu = "fpv4-sp-d16" +} diff --git a/third_party/st/stm32_board.gni b/third_party/st/stm32_board.gni new file mode 100644 index 00000000000000..3d95d3576fb174 --- /dev/null +++ b/third_party/st/stm32_board.gni @@ -0,0 +1,36 @@ +# Copyright (c) 2023 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. + +declare_args() { + # STM32 board used + stm32_board = "" +} + +if (stm32_board == "") { + stm32_board = "STM32WB5MM-DK" +} + +assert(stm32_board != "", "stm32_board must be specified") + +# Differentiate between boards +# - STM32WB5MMG-DK / STM32WB55... / ZigBee-Thread 2.4GHz + +board_defines = [] + +if (stm32_board == "STM32WB5MM-DK") { + stm32_family = "stm32wb5" + stm32_mcu = "STM32WB5MMGHX" +} else { + assert(false, "The board ${stm32_board} not currently supported") +} diff --git a/third_party/st/stm32_executable.gni b/third_party/st/stm32_executable.gni new file mode 100644 index 00000000000000..fa2c8d14e28ee9 --- /dev/null +++ b/third_party/st/stm32_executable.gni @@ -0,0 +1,75 @@ +# Copyright (c) 2023 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_overrides/chip.gni") + +import("${build_root}/toolchain/flashable_executable.gni") + +template("stm32_executable") { + # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- + # (Add .bin + .hex to .elf + flashing scripts in output dir/) + # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- + + output_base_name = get_path_info(invoker.output_name, "name") + + objcopy_image_name = output_base_name + ".hex" + objcopy_image_format = "ihex" + objcopy = "arm-none-eabi-objcopy" + + # Copy flashing dependencies to the output directory so that the output + # is collectively self-contained; this allows flashing to work reliably + # even if the build and flashing steps take place on different machines + # or in different containers. + + flashing_runtime_target = target_name + ".flashing_runtime" + flashing_script_inputs = [ + "${chip_root}/scripts/flashing/stm32_firmware_utils.py", + "${chip_root}/scripts/flashing/firmware_utils.py", + ] + copy(flashing_runtime_target) { + sources = flashing_script_inputs + outputs = [ "${root_out_dir}/{{source_file_part}}" ] + } + + flashing_script_generator = + "${chip_root}/scripts/flashing/gen_flashing_script.py" + flashing_script_name = output_base_name + ".flash.py" + flashing_options = [ "stm32" ] + + flash_target_name = target_name + ".flash_executable" + flashbundle_name = "${target_name}.flashbundle.txt" + flashable_executable(flash_target_name) { + forward_variables_from(invoker, "*") + data_deps = [ ":${flashing_runtime_target}" ] + } + + # Add a target which generates the .bin file in addition to .hex. + executable_target = "$flash_target_name.executable" + bin_image_name = output_base_name + ".bin" + bin_target_name = target_name + ".bin" + objcopy_convert(bin_target_name) { + conversion_input = "${root_out_dir}/${invoker.output_name}" + conversion_output = "${root_out_dir}/${bin_image_name}" + conversion_target_format = "binary" + deps = [ ":$executable_target" ] + } + + group(target_name) { + deps = [ + ":$bin_target_name", + ":$flash_target_name", + ] + } +} diff --git a/third_party/st/stm32_sdk.gni b/third_party/st/stm32_sdk.gni new file mode 100644 index 00000000000000..eaa7775761ccbe --- /dev/null +++ b/third_party/st/stm32_sdk.gni @@ -0,0 +1,182 @@ +# Copyright (c) 2023 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_overrides/chip.gni") +import("//build_overrides/freertos.gni") +import("//build_overrides/mbedtls.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${freertos_root}/freertos.gni") +import("${mbedtls_root}/mbedtls.gni") +import("stm32_board.gni") + +#import("${lwip_root}/lwip.gni") + +declare_args() { + kvs_max_entries = 75 + + use_external_flash = false + + stm32_sdk_root = "${chip_root}/third_party/st" + + stm32_ic_family = "STM32WB5MM-DK" +} + +if (stm32_family == "stm32wb5") { + use_stm32_wpan = true +} + +assert(stm32_sdk_root != "", "ST SDK root must be specified") + +# +# Defines an stm32 SDK build target. +# +# Parameters: +# stm32_sdk_root - The location of the stm32 SDK. +# sources - The sources files to build. +# +template("stm32_sdk") { + if (defined(invoker.stm32_sdk_root)) { + stm32_sdk_root = invoker.stm32_sdk_root + } + + assert(stm32_sdk_root != "", "stm32_sdk_root must be specified") + + use_stm32_wpan = false + if (defined(invoker.use_stm32_wpan)) { + if (invoker.use_stm32_wpan) { + use_stm32_wpan = true + } + } + + if (defined(invoker.stm32_target_ic)) { + stm_target_ic = invoker.stm32_target_ic + } + + sdk_target_name = target_name + + slist_stm32_board = + read_file("${stm32_sdk_root}/FAMILY/BOARD/${stm32_board}_sdk.gn_helper", + "scope") + slist_stm32_family = + read_file("${stm32_sdk_root}/FAMILY/${stm32_family}_sdk.gn_helper", + "scope") + + config("${sdk_target_name}_config") { + include_dirs = [] + + if (defined(invoker.include_dirs)) { + include_dirs += invoker.include_dirs + } + + libs = [ + # add any common .o/.a library here + ] + + # Treat these includes as system includes, so warnings in them are not fatal. + _include_dirs = [ + # common .h used by STM32 + ] + + defines = [ + # common defines + "DEBUG", + "USE_HAL_DRIVER", + ] + + # Note that we're setting the mbedTLS and PSA configuration files through a + # define. This means the build system by default does not pick up changes in + # the content of these, only when changing the filename itself. + # To fix this, these files are also manually depended upon in the source set + # declared in stm32_mbedtls_config further down this file. + if (stm32_family == "stm32wb5") { + defines += [ "MBEDTLS_USER_CONFIG_FILE=" ] + } + + if (defined(invoker.enable_sleepy_device)) { + if (invoker.enable_sleepy_device) { + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_SED=1", + "STM32_SLEEP_DEVICE", + ] + } + } + + _include_dirs += slist_stm32_board.INCLUDE_DIRS + _include_dirs += slist_stm32_family.INCLUDE_DIRS + + defines += slist_stm32_board.DEFINES + defines += slist_stm32_family.DEFINES + + libs += slist_stm32_board.LIBS + libs += slist_stm32_family.LIBS + + cflags = [] + foreach(include_dir, _include_dirs) { + cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] + } + + cflags += [ + "-Wno-maybe-uninitialized", + "-Wno-shadow", + ] + + cflags += slist_stm32_board.FLAGS + cflags += slist_stm32_family.FLAGS + + if (defined(invoker.defines)) { + defines += invoker.defines + } + } + + source_set("stm32_mbedtls_config") { + # We're setting the mbedTLS config flags here as the stm32_sdk target + # acts as the mbedTLS target for stm32 builds. We need this for the build + # system to recompile mbedTLS (= the SDK) when the mbedTLS config gets + # edited. + if (stm32_family == "stm32wb5") { + sources = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h", + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/matter_config.h", + ] + } + + public_deps = [ "${chip_root}/src/crypto:crypto_buildconfig" ] + } + + source_set(sdk_target_name) { + if (defined(invoker.enable_sleepy_device)) { + } + + sources = slist_stm32_family.SOURCES + sources += slist_stm32_board.SOURCES + + if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || + (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { + sources += [ + # + # + ] + } + + public_deps = [ ":stm32_mbedtls_config" ] + + if (defined(invoker.sources)) { + sources += invoker.sources + } + + public_configs = [ ":${sdk_target_name}_config" ] + } +} From ce417bac5e7f345810644e2c08378c2d4f3b87b7 Mon Sep 17 00:00:00 2001 From: weicheng Date: Thu, 7 Sep 2023 04:11:10 +0800 Subject: [PATCH 69/96] enable asr lwip lock assert; add more ASR CI (#29041) Co-authored-by: weicheng --- .github/workflows/examples-asr.yaml | 2 ++ src/inet/UDPEndPointImplLwIP.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 .github/workflows/examples-asr.yaml mode change 100644 => 100755 src/inet/UDPEndPointImplLwIP.cpp diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml old mode 100644 new mode 100755 index cc9a6ccdbab73b..f34af7876eecc0 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -57,5 +57,7 @@ jobs: --target asr-asr582x-bridge-factory \ --target asr-asr582x-temperature-measurement-rotating_id \ --target asr-asr582x-thermostat-rio \ + --target asr-asr582x-dishwasher \ + --target asr-asr582x-refrigerator \ build \ " \ No newline at end of file diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp old mode 100644 new mode 100755 index 8690fb3839377c..8db3d7e593e2b0 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -41,8 +41,7 @@ static_assert(LWIP_VERSION_MAJOR > 1, "CHIP requires LwIP 2.0 or later"); -#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L || \ - CHIP_DEVICE_LAYER_TARGET_ASR) +#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L) static_assert(LWIP_TCPIP_CORE_LOCKING, "CHIP requires config LWIP_TCPIP_CORE_LOCKING enabled"); #endif From 0e7d3b718e89e4602cafb4a34de14085cf8b8676 Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 08:48:50 +0100 Subject: [PATCH 70/96] Added Feature Map to read handler (#29098) --- .../concentration-measurement-server.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index 391674bb844d95..c2799fd822cdf9 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -112,7 +112,7 @@ class Instance MeasurementMediumEnum mMeasurementMedium; - uint32_t mFeature = 0; + uint32_t mFeatureMap = 0; // AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override @@ -192,6 +192,10 @@ class Instance case Attributes::MeasurementMedium::Id: ReturnErrorOnFailure(aEncoder.Encode(mMeasurementMedium)); break; + + case Attributes::FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeatureMap)); + break; } return CHIP_NO_ERROR; @@ -351,7 +355,7 @@ class Instance // Register the object as attribute provider VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); - mFeature = GenerateFeatureMap(); + mFeatureMap = GenerateFeatureMap(); return CHIP_NO_ERROR; }; From 9a751256a122a78728f845b2d37b37edb7fb510c Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 7 Sep 2023 16:12:19 +0300 Subject: [PATCH 71/96] [Telink] Add B92 (tlsr9528a) SoC support & Update Telink image to 10 (#28841) * [Telink] Add tlsr9528a (B92) to CI * [Telink] Remove set board by default (Readme files needs to be updated) * [Telink] use B9X instead of B91 * [Telink] Add tlsr9528a (B92) DTS overlay * [Telink] temporarry disable BLE for Jenkins * [Telink] Use Zephyr sys_reboot instead of HAL version * Revert "[Telink] temporarry disable BLE for Jenkins" This reverts commit 066b0a26f3eb58e21a4e87118a42ada6b2a76355. * [Telink] use B9X instead of B91 * [Telink] Set correct BOOT_MAX_IMG_SECTORS for B92 * [Telink] Adopt to latest master chnages * [Telink] Add info how to build B9X * [Telink] Update partitions * [Telink] Reset default CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT * [Telink] Support USB dongle * [Telink] Update Telink image to 10 * Restyled * [Telink] Change bootloader log level * [Telink] Add Chef example to CI * [Telink] Use B9X * [Telink] Add chef bundle function * Restyled by autopep8 * [Telink] Divide CI apps between two SoCs --------- Co-authored-by: Andrii Bilynskyi Co-authored-by: Restyled.io --- .github/workflows/chef.yaml | 21 ++++ .github/workflows/examples-telink.yaml | 117 +++++++----------- config/telink/app/bootloader.conf | 20 ++- config/telink/app/zephyr.conf | 12 +- config/telink/chip-module/CMakeLists.txt | 17 ++- .../all-clusters-app/telink/CMakeLists.txt | 2 - examples/all-clusters-app/telink/Readme.md | 15 +-- .../telink/CMakeLists.txt | 2 - .../all-clusters-minimal-app/telink/Readme.md | 15 +-- examples/bridge-app/telink/CMakeLists.txt | 2 - examples/bridge-app/telink/README.md | 15 +-- examples/bridge-app/telink/prj.conf | 2 +- examples/chef/chef.py | 19 +++ examples/chef/telink/prj.conf | 2 +- .../contact-sensor-app/telink/CMakeLists.txt | 2 - examples/contact-sensor-app/telink/README.md | 15 +-- .../light-switch-app/telink/CMakeLists.txt | 2 - examples/light-switch-app/telink/README.md | 15 +-- examples/lighting-app/telink/CMakeLists.txt | 25 +++- examples/lighting-app/telink/README.md | 15 +-- examples/lighting-app/telink/prj.conf | 2 +- examples/lock-app/telink/CMakeLists.txt | 2 - examples/lock-app/telink/README.md | 15 +-- .../ota-requestor-app/telink/CMakeLists.txt | 2 - examples/ota-requestor-app/telink/Readme.md | 15 +-- .../telink/common/src/AppTaskCommon.cpp | 4 +- .../platform/telink/common/src/mainCommon.cpp | 27 ++++ .../telink/pw_sys_io/sys_io_telink.cc | 23 +++- examples/pump-app/telink/CMakeLists.txt | 2 - examples/pump-app/telink/README.md | 15 +-- .../pump-controller-app/telink/CMakeLists.txt | 2 - examples/pump-controller-app/telink/README.md | 15 +-- examples/shell/telink/CMakeLists.txt | 2 - examples/shell/telink/README.md | 15 +-- examples/shell/telink/prj.conf | 2 +- .../smoke-co-alarm-app/telink/CMakeLists.txt | 2 - examples/smoke-co-alarm-app/telink/README.md | 15 +-- examples/smoke-co-alarm-app/telink/prj.conf | 2 +- .../telink/CMakeLists.txt | 2 - .../telink/README.md | 15 +-- .../telink/prj.conf | 2 +- examples/thermostat/telink/CMakeLists.txt | 2 - examples/thermostat/telink/Readme.md | 15 +-- examples/window-app/telink/CMakeLists.txt | 2 - examples/window-app/telink/README.md | 15 +-- examples/window-app/telink/prj.conf | 2 +- integrations/cloudbuild/build-all.yaml | 1 + scripts/build/build/targets.py | 7 +- scripts/build/builders/telink.py | 5 +- .../build/testdata/all_targets_linux_x64.txt | 2 +- scripts/tools/telink/mfg_tool.py | 2 +- scripts/tools/telink/readme.md | 2 +- src/platform/Zephyr/ThreadStackManagerImpl.h | 4 +- src/platform/telink/ThreadStackManagerImpl.h | 4 +- src/platform/telink/tlsr9518adk80d.overlay | 32 ++--- src/platform/telink/tlsr9518adk80d_usb.conf | 4 + .../telink/tlsr9518adk80d_usb.overlay | 99 +++++++++++++++ .../telink/tlsr9518adk80d_usb_boot.overlay | 23 ++++ src/platform/telink/tlsr9528a.overlay | 112 +++++++++++++++++ 59 files changed, 590 insertions(+), 259 deletions(-) create mode 100644 src/platform/telink/tlsr9518adk80d_usb.conf create mode 100644 src/platform/telink/tlsr9518adk80d_usb.overlay create mode 100644 src/platform/telink/tlsr9518adk80d_usb_boot.overlay create mode 100644 src/platform/telink/tlsr9528a.overlay diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 76bbb9cf6da05c..c7268985a200fd 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -89,3 +89,24 @@ jobs: shell: bash run: | ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect" + + chef_telink: + name: Chef - Telink CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-telink:10 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: telink + - name: CI Examples Telink + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink" diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 07b5ddc9a10f08..f7ddf8dc340e1d 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2022-2023 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. @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:1 + image: ghcr.io/project-chip/chip-build-telink:10 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -54,7 +54,7 @@ jobs: with: gh-context: ${{ toJson(github) }} - - name: Build example Telink All Clusters App + - name: Build example Telink (B91) All Clusters App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters' build" @@ -66,19 +66,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink All Clusters Minimal App + - name: Build example Telink (B92) All Clusters Minimal App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters-minimal' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d all-clusters-minimal-app \ - out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \ + telink tlsr9528a all-clusters-minimal-app \ + out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Bridge App + - name: Build example Telink (B91) Bridge App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-bridge' build" @@ -90,70 +90,43 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Contact Sensor App + - name: Build example Telink (B92) Contact Sensor App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-contact-sensor' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-contact-sensor' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d contact-sensor-app \ - out/telink-tlsr9518adk80d-contact-sensor/zephyr/zephyr.elf \ + telink tlsr9528a contact-sensor-app \ + out/telink-tlsr9528a-contact-sensor/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app \ - out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with RPC - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-rpc \ - out/telink-tlsr9518adk80d-light-rpc/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Shell + - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | + ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux + ./scripts/build/gn_gen.sh + ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-shell' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-shell \ - out/telink-tlsr9518adk80d-light-shell/zephyr/zephyr.elf \ + telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Factory Data + - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | - ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - ./scripts/build/gn_gen.sh - ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-factory-data \ - out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \ + telink tlsr9528a lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9528a-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Light Switch App + - name: Build example Telink (B91) Light Switch App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build" @@ -165,19 +138,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lock App + - name: Build example Telink (B92) Lock App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-lock' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lock-app \ - out/telink-tlsr9518adk80d-lock/zephyr/zephyr.elf \ + telink tlsr9528a lock-app \ + out/telink-tlsr9528a-lock/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink OTA Requestor App + - name: Build example Telink (B91) OTA Requestor App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-ota-requestor' build" @@ -189,19 +162,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump App + - name: Build example Telink (B92) Pump App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-pump' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d pump-app \ - out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \ + telink tlsr9528a pump-app \ + out/telink-tlsr9528a-pump/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump Controller App + - name: Build example Telink (B91) Pump Controller App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build" @@ -213,7 +186,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Shell App + - name: Build example Telink (B91) Shell App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build" @@ -225,31 +198,31 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Smoke CO Alarm App + - name: Build example Telink (B92) Smoke CO Alarm App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-smoke-co-alarm' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-smoke-co-alarm' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d smoke_co_alarm-app \ - out/telink-tlsr9518adk80d-smoke-co-alarm/zephyr/zephyr.elf \ + telink tlsr9528a smoke_co_alarm-app \ + out/telink-tlsr9528a-smoke-co-alarm/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Temperature Measurement App + - name: Build example Telink (B92) Temperature Measurement App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-temperature-measurement' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d temperature-measurement-app \ - out/telink-tlsr9518adk80d-temperature-measurement/zephyr/zephyr.elf \ + telink tlsr9528a temperature-measurement-app \ + out/telink-tlsr9528a-temperature-measurement/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Thermostat App + - name: Build example Telink (B91) Thermostat App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" @@ -261,7 +234,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Window Covering App + - name: Build example Telink (B91) Window Covering App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-window-covering' build" diff --git a/config/telink/app/bootloader.conf b/config/telink/app/bootloader.conf index 5fb0182690cdaa..2098bc7072cb3d 100644 --- a/config/telink/app/bootloader.conf +++ b/config/telink/app/bootloader.conf @@ -16,7 +16,7 @@ # Enable this option in case if restoring the slot0 partition is expected from slot1 # partition in case if slot0 is not bootable or damaged -CONFIG_BOOT_BOOTSTRAP=n +CONFIG_BOOT_BOOTSTRAP=y # Enable this option in case if SWAP_MOVE logic need to be used CONFIG_BOOT_SWAP_USING_MOVE=y @@ -28,3 +28,21 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n # Enable this option in case if the whole slot0 image need to be validated # With disabled option the only image magic is validated CONFIG_BOOT_VALIDATE_SLOT0=y + +# Maximum number of image sectors supported by the bootloader. +CONFIG_BOOT_MAX_IMG_SECTORS=4096 + +# Sets log level for modules which don't specify it explicitly. +# When set to 0 it means log will not be activated for those modules. +# Levels are: +# - 0 OFF, do not write by default +# - 1 ERROR, default to only write LOG_LEVEL_ERR +# - 2 WARNING, default to write LOG_LEVEL_WRN +# - 3 INFO, default to write LOG_LEVEL_INFO +# - 4 DEBUG, default to write LOG_LEVEL_DBG +CONFIG_LOG_DEFAULT_LEVEL=1 + +# USB DFU configuration +CONFIG_USB_DFU_WILL_DETACH=n +CONFIG_BOOT_USB_DFU_GPIO=y +CONFIG_MCUBOOT_INDICATION_LED=y diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index 6948ce36b083d3..47c2b88f91aa3a 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2021-2023 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. @@ -111,22 +111,22 @@ CONFIG_OPENTHREAD_EXTERNAL_HEAP=y # Config dynamic interrupts to have posibility to switch between BLE/Thread radio drivers CONFIG_DYNAMIC_INTERRUPTS=y -# Set multiplicator of Name Value Storage (NVS) as 16 to reach NVS sector size 4096 -# nvs_sector_size = flash_page_size * mult = 256 * 16 = 4096 -CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=16 +# Set multiplicator of Name Value Storage (NVS) as 1 to reach NVS sector size 4KB +# nvs_sector_size = flash_page_size * mult = 4KB * 1 = 4KB +CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=1 # Enable NVS lookup cache CONFIG_NVS_LOOKUP_CACHE=y CONFIG_NVS_LOOKUP_CACHE_SIZE=2048 # Reboot system when fault happened -CONFIG_TELINK_B91_REBOOT_ON_FAULT=y +CONFIG_TELINK_B9X_REBOOT_ON_FAULT=y # Shell settings CONFIG_SHELL=n # BLE MAC address -CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 +CONFIG_B9X_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 # getopt version CONFIG_GETOPT_LONG=y diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 26f0d58612abe8..bfb38cb5172c69 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -137,6 +137,17 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) # Define 'chip-ota-image' target for building CHIP OTA image # ============================================================================== + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + set(USB_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + else() + unset(USB_BOOT_DTC_OVERLAY_FILE) + endif() +else() + unset(USB_BOOT_DTC_OVERLAY_FILE) +endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") else() @@ -153,14 +164,14 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr - -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE} + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}" ) add_custom_target(merge_mcuboot ALL COMMAND dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=76 + dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=100 ) chip_ota_image(chip-ota-image @@ -175,7 +186,7 @@ endif() if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) add_custom_target(merge_factory_data ALL COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1040 + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 ) if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index aacc82ddc06b25..7ca03211176776 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index e05afa4e3a1e30..3684a8cf432eb2 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -11,31 +11,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index 410f305c3b317a..d852f1534d0d73 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index 66eda43b732c9b..96d8dfc751ccf1 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -11,31 +11,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 46953af249d8b7..58ed38fd93ba89 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 7fe72ca3e5fa26..159516fcf9e476 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -88,31 +88,32 @@ defined: 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/prj.conf b/examples/bridge-app/telink/prj.conf index 72b6dce7e2866c..ec4db478cf33b4 100644 --- a/examples/bridge-app/telink/prj.conf +++ b/examples/bridge-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 7e1b6238c69484..841eed2001cf6b 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -248,6 +248,25 @@ def bundle_esp32(device_name: str) -> None: shutil.copy(src_item, dest_item) +def bundle_telink(device_name: str) -> None: + zephyr_exts = ["elf", "map", "bin"] + telink_root = os.path.join(_CHEF_SCRIPT_PATH, + "telink", + "build", + "zephyr") + sub_dir = os.path.join(_CD_STAGING_DIR, device_name) + os.mkdir(sub_dir) + for zephyr_ext in zephyr_exts: + input_base = f"zephyr.{zephyr_ext}" + output_base = f"{device_name}.{zephyr_ext}" + src_item = os.path.join(telink_root, input_base) + if zephyr_ext == "bin": + dest_item = os.path.join(sub_dir, output_base) + else: + dest_item = os.path.join(_CD_STAGING_DIR, output_base) + shutil.copy(src_item, dest_item) + + def main() -> int: check_python_version() diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index d83c730a8f61e2..2aa9402f0f1881 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -68,5 +68,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index 3f6a32566a3bba..2a6e63cbc284da 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index ec755135003da3..21c3c045f23f2d 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 18a5f83ac1ebbf..d05508812f04e9 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 6b44caa1e0ba50..6e0cda2bcbf644 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -14,31 +14,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 16f6dfb4244663..986338c723651b 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -15,12 +15,27 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) +set(ignoreMe "${TLNK_USB_DONGLE}") + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + set(USB_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + else() + unset(USB_DTC_OVERLAY_FILE) + endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + set(USB_CONF_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + else() + unset(USB_CONF_OVERLAY_FILE) + endif() +else() + unset(USB_CONF_OVERLAY_FILE) +endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") else() @@ -35,14 +50,14 @@ endif() if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() -set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf prj.conf) +set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf ${USB_CONF_OVERLAY_FILE} prj.conf) # Load NCS/Zephyr build system list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/telink/chip-module) diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 286f289303500f..e774a8b1ecf87a 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 71a134523d33c8..141f820ae003dc 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 \ No newline at end of file diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index 98b3e5de27e567..66f5e432f96d92 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 466e053b2a9944..b215fa543839dc 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index f9dcafa515b74a..5d88c0c504121f 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index b072547d9e5a27..c04bbfcb463550 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -5,31 +5,32 @@ 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 3a831ea0ef8fce..969f3c14638ae3 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -202,8 +202,8 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate }; #if CONFIG_CHIP_LIB_SHELL -#include #include +#include static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** argv) { @@ -211,7 +211,7 @@ static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** ar ARG_UNUSED(argv); shell_print(shell, "Performing board reboot..."); - sys_reboot(); + sys_reboot(0); return 0; } diff --git a/examples/platform/telink/common/src/mainCommon.cpp b/examples/platform/telink/common/src/mainCommon.cpp index 63c41b3a211982..d88a6a981dd985 100644 --- a/examples/platform/telink/common/src/mainCommon.cpp +++ b/examples/platform/telink/common/src/mainCommon.cpp @@ -23,10 +23,18 @@ #include +#ifdef CONFIG_USB_DEVICE_STACK +#include +#endif /* CONFIG_USB_DEVICE_STACK */ + #ifdef CONFIG_CHIP_PW_RPC #include "Rpc.h" #endif +#ifdef CONFIG_BOOTLOADER_MCUBOOT +#include +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + LOG_MODULE_REGISTER(app, CONFIG_CHIP_APP_LOG_LEVEL); using namespace ::chip; @@ -94,6 +102,10 @@ static void FactoryResetOnBoot(void) int main(void) { +#if defined(CONFIG_USB_DEVICE_STACK) && !defined(CONFIG_CHIP_PW_RPC) + usb_enable(NULL); +#endif /* CONFIG_USB_DEVICE_STACK */ + CHIP_ERROR err = CHIP_NO_ERROR; #ifdef CONFIG_CHIP_PW_RPC @@ -143,6 +155,21 @@ int main(void) goto exit; } +#ifdef CONFIG_BOOTLOADER_MCUBOOT + if (mcuboot_swap_type() == BOOT_SWAP_TYPE_REVERT) + { + int img_confirmation = boot_write_img_confirmed(); + if (img_confirmation) + { + LOG_ERR("Image not confirmed %d. Will be reverted!", img_confirmation); + } + else + { + LOG_INF("Image confirmed"); + } + } +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + err = GetAppTask().StartApp(); exit: diff --git a/examples/platform/telink/pw_sys_io/sys_io_telink.cc b/examples/platform/telink/pw_sys_io/sys_io_telink.cc index ff40aeadd6e583..4241e191110cea 100644 --- a/examples/platform/telink/pw_sys_io/sys_io_telink.cc +++ b/examples/platform/telink/pw_sys_io/sys_io_telink.cc @@ -22,17 +22,28 @@ #include #include -#ifdef CONFIG_USB +#ifdef CONFIG_USB_DEVICE_STACK #include + +static bool output_enable = false; + +static void usb_dc_status_change(enum usb_dc_status_code cb_status, const uint8_t * param) +{ + (void) param; + if (cb_status == USB_DC_CONFIGURED) + { + output_enable = true; + } +} #endif extern "C" void pw_sys_io_Init() { int err; -#ifdef CONFIG_USB - err = usb_enable(nullptr); - assert(err == 0); +#ifdef CONFIG_USB_DEVICE_STACK + output_enable = false; + (void) usb_enable(usb_dc_status_change); #endif err = console_init(); @@ -54,6 +65,10 @@ Status ReadByte(std::byte * dest) Status WriteByte(std::byte b) { +#ifdef CONFIG_USB_DEVICE_STACK + if (!output_enable) + return Status::FailedPrecondition(); +#endif return console_putchar(static_cast(b)) < 0 ? Status::FailedPrecondition() : OkStatus(); } diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 03f3012008517b..70886f44fa82b4 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index 8b0dbda6b2add5..3500672a41720f 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -13,31 +13,32 @@ reference for creating your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index d5eeb88ee6d202..d45b4c8018bb77 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 1e17a923ff896f..ab73fabc6346af 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -14,31 +14,32 @@ your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/CMakeLists.txt b/examples/shell/telink/CMakeLists.txt index debe82e67ee2cd..0c95e739097f63 100755 --- a/examples/shell/telink/CMakeLists.txt +++ b/examples/shell/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(APP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH) diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index ffbfce8a1867d3..d4a3c43e875180 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/prj.conf b/examples/shell/telink/prj.conf index 3abb915e850fcd..7814bceb6be45c 100755 --- a/examples/shell/telink/prj.conf +++ b/examples/shell/telink/prj.conf @@ -69,5 +69,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index d6fa3994a89962..6df4292b041645 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index 02f78a25560065..20d4672b5688df 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf index 637c9bf1d752e1..819051b9b1cf05 100755 --- a/examples/smoke-co-alarm-app/telink/prj.conf +++ b/examples/smoke-co-alarm-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 022eef1d319bce..35e0815a19f083 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index 964c0f27d39b2f..ac6fec9325e39c 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -13,31 +13,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/temperature-measurement-app/telink/prj.conf b/examples/temperature-measurement-app/telink/prj.conf index 63deb05cbddfcb..fe19cab9f70ad2 100644 --- a/examples/temperature-measurement-app/telink/prj.conf +++ b/examples/temperature-measurement-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 63744747849bfe..58b4c58485a57f 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index fdd4730c6f831a..905217a94a1ab8 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index ef7801e3728e6c..d4ca74d955d2db 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index 9fef8eaa8972b1..7445e330a496d2 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -12,31 +12,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/prj.conf b/examples/window-app/telink/prj.conf index 753040f73c6086..2a65b939cf343c 100644 --- a/examples/window-app/telink/prj.conf +++ b/examples/window-app/telink/prj.conf @@ -65,5 +65,5 @@ CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index a1a8a1832d8726..dc66ec8eda7eb1 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -163,6 +163,7 @@ steps: --target qpg-qpg6105-light --target qpg-qpg6105-shell --target telink-tlsr9518adk80d-light + --target telink-tlsr9528a-light --target tizen-arm-light build --create-archives /workspace/artifacts/ diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7f8f3812b95e01..0414a7e820fce7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -674,8 +674,11 @@ def BuildGenioTarget(): def BuildTelinkTarget(): target = BuildTarget('telink', TelinkBuilder) - target.AppendFixedTargets( - [TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D)]) + + target.AppendFixedTargets([ + TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D), + TargetPart('tlsr9528a', board=TelinkBoard.TLSR9528A), + ]) target.AppendFixedTargets([ TargetPart('all-clusters', app=TelinkApp.ALL_CLUSTERS), diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index f023207146712c..754bc077f46254 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -108,10 +108,13 @@ def AppNamePrefix(self): class TelinkBoard(Enum): TLSR9518ADK80D = auto() + TLSR9528A = auto() def GnArgName(self): if self == TelinkBoard.TLSR9518ADK80D: return 'tlsr9518adk80d' + elif self == TelinkBoard.TLSR9528A: + return 'tlsr9528a' else: raise Exception('Unknown board type: %r' % self) @@ -122,7 +125,7 @@ def __init__(self, root, runner, app: TelinkApp = TelinkApp, - board: TelinkBoard = TelinkBoard.TLSR9518ADK80D, + board: TelinkBoard = TelinkBoard, enable_shell: bool = False, enable_rpcs: bool = False, enable_factory_data: bool = False): diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 44ca9c3fe2480d..7e945289bcb21c 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] -telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] +telink-{tlsr9518adk80d,tlsr9528a}-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/tools/telink/mfg_tool.py b/scripts/tools/telink/mfg_tool.py index 286648c37185d8..3725707d7c9c78 100644 --- a/scripts/tools/telink/mfg_tool.py +++ b/scripts/tools/telink/mfg_tool.py @@ -642,7 +642,7 @@ def base64_str(s): return base64.b64decode(s) basic_args.add_argument('--part_number', type=str, required=False, help='Provide human-readable product number') part_gen_args = parser.add_argument_group('Partition generator options') - part_gen_args.add_argument('--offset', type=allow_any_int, default=0x104000, + part_gen_args.add_argument('--offset', type=allow_any_int, default=0x107000, help='Partition offset - an address in devices NVM memory, where factory data will be stored') part_gen_args.add_argument('--size', type=allow_any_int, default=0x1000, help='The maximum partition size') diff --git a/scripts/tools/telink/readme.md b/scripts/tools/telink/readme.md index 1ee492c2ffc695..37e0418342436d 100644 --- a/scripts/tools/telink/readme.md +++ b/scripts/tools/telink/readme.md @@ -188,7 +188,7 @@ You can try one of these factory partition FW on developing stage. > [v1.0-branch](https://github.com/telink-semi/zephyr/blob/telink_matter_v1.0-branch/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) > is `0xF4000` and for > [master branch](https://github.com/telink-semi/zephyr/blob/telink_matter/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) - > is `0x104000`. You can check the `factory_partition` reg at + > is `0x107000`. You can check the `factory_partition` reg at > `tlsr9518adk80d.dts` for details. For example, the `factory_data_bin` with serial number diff --git a/src/platform/Zephyr/ThreadStackManagerImpl.h b/src/platform/Zephyr/ThreadStackManagerImpl.h index d9a9020dfadf5c..1345a9ba27bc5a 100644 --- a/src/platform/Zephyr/ThreadStackManagerImpl.h +++ b/src/platform/Zephyr/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/ThreadStackManagerImpl.h b/src/platform/telink/ThreadStackManagerImpl.h index 508382332072c6..d1040542f3c616 100644 --- a/src/platform/telink/ThreadStackManagerImpl.h +++ b/src/platform/telink/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/tlsr9518adk80d.overlay b/src/platform/telink/tlsr9518adk80d.overlay index 22b5ac801ac974..32fbb3f5661809 100644 --- a/src/platform/telink/tlsr9518adk80d.overlay +++ b/src/platform/telink/tlsr9518adk80d.overlay @@ -61,16 +61,16 @@ &pinctrl { pwm_ch0_pb4_default: pwm_ch0_pb4_default { - pinmux = ; + pinmux = ; }; pwm_ch1_pb5_default: pwm_ch1_pb5_default { - pinmux = ; + pinmux = ; }; pwm_ch2_pe2_default: pwm_ch2_pe2_default { - pinmux = ; + pinmux = ; }; pwm_ch3_pe0_default: pwm_ch3_pe0_default { - pinmux = ; + pinmux = ; }; }; @@ -83,30 +83,30 @@ partitions { /delete-node/ partition@0; - /delete-node/ partition@18000; - /delete-node/ partition@84000; + /delete-node/ partition@20000; + /delete-node/ partition@88000; /delete-node/ partition@f0000; /delete-node/ partition@f4000; boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x13000>; + reg = <0x00000000 0x19000>; }; - slot0_partition: partition@13000 { + slot0_partition: partition@19000 { label = "image-0"; - reg = <0x13000 0xf1000>; + reg = <0x19000 0xee000>; }; - factory_partition: partition@104000 { + factory_partition: partition@107000 { label = "factory-data"; - reg = <0x104000 0x1000>; + reg = <0x107000 0x1000>; }; - storage_partition: partition@105000 { + storage_partition: partition@108000 { label = "storage"; - reg = <0x105000 0x8000>; + reg = <0x108000 0x8000>; }; - slot1_partition: partition@10d000 { + slot1_partition: partition@110000 { label = "image-1"; - reg = <0x10d000 0xf1000>; + reg = <0x110000 0xee000>; }; /* region <0x1fe000 0x2000> is reserved for Telink B91 SDK's data */ }; -}; \ No newline at end of file +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb.conf b/src/platform/telink/tlsr9518adk80d_usb.conf new file mode 100644 index 00000000000000..3e0b1849d2969c --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.conf @@ -0,0 +1,4 @@ +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n +CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y +CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=y diff --git a/src/platform/telink/tlsr9518adk80d_usb.overlay b/src/platform/telink/tlsr9518adk80d_usb.overlay new file mode 100644 index 00000000000000..f2523794a0d110 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.overlay @@ -0,0 +1,99 @@ +/ { + chosen { + zephyr,console = &cdc_acm_uart0; + zephyr,shell-uart = &cdc_acm_uart0; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_2; + /delete-node/ button_3; + /delete-node/ button_4; + + key_1: button_1 { + gpios = <&gpiob 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpioc 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpioc 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiob 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + /delete-node/ pwm_led_1; + /delete-node/ pwm_led_2; + /delete-node/ pwm_led_3; + + pwm_led0: pwm_led_0 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 5 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED White"; + }; + }; + + aliases { + system-state-led = &led_yellow; + }; + + leds { + led_yellow: led_yellow { + gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>; + label = "LED Yellow"; + }; + }; +}; + +&pinctrl { + pwm_ch2_pb7_default: pwm_ch2_pb7_default { + pinmux = ; + }; + pwm_ch5_pb0_default: pwm_ch5_pb0_default { + pinmux = ; + }; + pwm_ch0_pb4_default: pwm_ch0_pb4_default { + pinmux = ; + }; + pwm_ch3_pb1_default: pwm_ch3_pb1_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch2_pb7_default &pwm_ch5_pb0_default &pwm_ch0_pb4_default &pwm_ch3_pb1_default>; +}; + + +&zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; + +&gpiob { + interrupts = <37 1>; +}; + +&gpioc { + interrupts = <38 1>; +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb_boot.overlay b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay new file mode 100644 index 00000000000000..7eeb3a96eb6e50 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay @@ -0,0 +1,23 @@ +/ { + leds { + /delete-node/ led_0; + + led_blue: led_0 { + gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; + label = "LED Blue"; + }; + }; + + keys { + /delete-node/ button_dfu; + + key_dfu: button_dfu { + label = "USB DFU"; + gpios = <&gpiob 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; diff --git a/src/platform/telink/tlsr9528a.overlay b/src/platform/telink/tlsr9528a.overlay new file mode 100644 index 00000000000000..996981e6834b0b --- /dev/null +++ b/src/platform/telink/tlsr9528a.overlay @@ -0,0 +1,112 @@ +/ { + aliases { + system-state-led = &led_red; + pwm-led0 = &pwm_led0; + pwm-led1 = &pwm_led1; + pwm-led2 = &pwm_led2; + pwm-led3 = &pwm_led3; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + pwm_led0: pwm_led_0 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED Green"; + }; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_3; + compatible = "gpio-keys"; + key_1: button_1 { + gpios = <&gpiod 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpiod 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpiod 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiof 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + + key_matrix_col1: key_matrix_col1 { + gpios = <&gpiod 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_col2: key_matrix_col2 { + gpios = <&gpiof 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_row1: key_matrix_row1 { + gpios = <&gpiod 2 GPIO_PULL_DOWN>; + }; + key_matrix_row2: key_matrix_row2 { + gpios = <&gpiod 7 GPIO_PULL_DOWN>; + }; + }; +}; + +&pinctrl { + pwm_ch0_pd0_default: pwm_ch0_pd0_default { + pinmux = ; + }; + pwm_ch1_pd1_default: pwm_ch1_pd1_default { + pinmux = ; + }; + pwm_ch2_pe2_default: pwm_ch2_pe2_default { + pinmux = ; + }; + pwm_ch3_pe0_default: pwm_ch3_pe0_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch0_pd0_default &pwm_ch1_pd1_default &pwm_ch2_pe2_default &pwm_ch3_pe0_default>; +}; + +&flash { + reg = <0x20000000 0x200000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0xee000>; + }; + factory_partition: partition@107000 { + label = "factory-data"; + reg = <0x107000 0x1000>; + }; + storage_partition: partition@108000 { + label = "storage"; + reg = <0x108000 0x8000>; + }; + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x110000 0xee000>; + }; + /* region <0x1fe000 0x2000> is reserved for Telink B92 SDK's data */ + }; +}; From b0bc001a098031f71079b4397cb4962f4bcf2dce Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 14:13:52 +0100 Subject: [PATCH 72/96] Added Feature Map to `AirQuality` Read Handler (#29105) * Added Feature Map to read handler * Set the air quality feature map to zero in zapfile so that we are sure the value is being encoded by the read handler --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 8 ++++---- .../clusters/air-quality-server/air-quality-server.cpp | 3 +++ 3 files changed, 8 insertions(+), 5 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 58f744659d5801..705324367f39e9 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 @@ -6826,7 +6826,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 15; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } 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 bcd0bb239ab26d..191519900a4990 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 @@ -10495,7 +10495,7 @@ ] }, { - "id": 4, + "id": 2, "name": "MA-onofflight", "deviceTypeRef": { "code": 256, @@ -16926,7 +16926,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -34866,7 +34866,7 @@ ] }, { - "id": 2, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { "code": 61442, @@ -35394,4 +35394,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 875bd4c4dfa9bb..f9ff17bc4fe53f 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -115,6 +115,9 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu case Attributes::AirQuality::Id: ReturnErrorOnFailure(aEncoder.Encode(mAirQuality)); break; + case Attributes::FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature.Raw())); + break; } return CHIP_NO_ERROR; } From 27ab38892792182a2eaab7d7d1fceffc5e764593 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 06:15:59 -0700 Subject: [PATCH 73/96] Reture result directly instead of via reference (#29078) --- .../ManualOnboardingPayloadParser.kt | 5 +- .../OnboardingPayloadParser.kt | 7 +- .../QRCodeOnboardingPayloadParser.kt | 5 +- .../chip/onboardingpayload/ManualCodeTest.kt | 82 +++++++++++-------- .../chip/onboardingpayload/QRCodeTest.kt | 14 +--- 5 files changed, 61 insertions(+), 52 deletions(-) diff --git a/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt index f913a9d99206c8..3e2bac7be7d287 100644 --- a/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt @@ -30,8 +30,9 @@ class ManualOnboardingPayloadParser(decimalRepresentation: String) { decimalStringRepresentation = decimalRepresentation.replace("-", "") } - fun populatePayload(outPayload: OnboardingPayload): Unit { + fun populatePayload(): OnboardingPayload { var representationWithoutCheckDigit: String + var outPayload: OnboardingPayload = OnboardingPayload() representationWithoutCheckDigit = checkDecimalStringValidity(decimalStringRepresentation) @@ -125,6 +126,8 @@ class ManualOnboardingPayloadParser(decimalRepresentation: String) { require(kManualSetupDiscriminatorFieldLengthInBits <= 8) { "Won't fit in UInt8" } outPayload.discriminator = discriminator outPayload.hasShortDiscriminator = true + + return outPayload } companion object { diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt index e1d8357908e236..cef151816f9d6c 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt @@ -54,9 +54,7 @@ class OnboardingPayloadParser { qrCodeString: String, skipPayloadValidation: Boolean ): OnboardingPayload { - val payload = OnboardingPayload() - - QRCodeOnboardingPayloadParser(qrCodeString).populatePayload(payload) + val payload = QRCodeOnboardingPayloadParser(qrCodeString).populatePayload() if (skipPayloadValidation == false && !payload.isValidQRCodePayload()) { throw OnboardingPayloadException("Invalid payload") @@ -103,8 +101,7 @@ class OnboardingPayloadParser { manualPairingCodeString: String, skipPayloadValidation: Boolean ): OnboardingPayload { - val payload = OnboardingPayload() - ManualOnboardingPayloadParser(manualPairingCodeString).populatePayload(payload) + val payload = ManualOnboardingPayloadParser(manualPairingCodeString).populatePayload() if (skipPayloadValidation == false && !payload.isValidManualCode()) { throw OnboardingPayloadException("Invalid manual entry code") diff --git a/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt index 18d91e8b2b4f45..ef33405114e1ee 100644 --- a/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt @@ -24,8 +24,9 @@ import java.util.concurrent.atomic.AtomicInteger * to a OnboardingPayload object */ class QRCodeOnboardingPayloadParser(private val mBase38Representation: String) { - fun populatePayload(outPayload: OnboardingPayload) { + fun populatePayload(): OnboardingPayload { var indexToReadFrom: AtomicInteger = AtomicInteger(0) + var outPayload: OnboardingPayload = OnboardingPayload() val payload = extractPayload(mBase38Representation) if (payload.length == 0) { @@ -60,6 +61,8 @@ class QRCodeOnboardingPayloadParser(private val mBase38Representation: String) { } // TODO: populate TLV optional fields + + return outPayload } companion object { diff --git a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt index 51fb0bfc0c51ac..acaf7e8d4758b9 100644 --- a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt @@ -165,8 +165,7 @@ class ManualCodeTest { // Test short 11 digit code var generator = ManualOnboardingPayloadGenerator(payload) var result = generator.payloadDecimalStringRepresentation() - var outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + var outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, payload.setupPinCode, @@ -183,8 +182,7 @@ class ManualCodeTest { // Test long 21 digit code generator = ManualOnboardingPayloadGenerator(payload) result = generator.payloadDecimalStringRepresentation() - outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, payload.setupPinCode, @@ -216,12 +214,11 @@ class ManualCodeTest { */ @Test fun testPayloadParser_partialPayload() { - val payload = getDefaultPayload() var decimalString = "2361087535" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + var payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -234,7 +231,7 @@ class ManualCodeTest { decimalString = "236-108753-5" decimalString += computeCheckChar(decimalString) assertEquals(13, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -246,13 +243,13 @@ class ManualCodeTest { decimalString = "0000010000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues(payload, pinCode = 1, discriminator = 0, vendorId = 0, productId = 0) decimalString = "63610875350000000000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -265,19 +262,40 @@ class ManualCodeTest { decimalString = "0033407535" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0, + vendorId = 0, + productId = 0 + ) // no vid (= 0) decimalString = "63610875350000014526" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0xa, + vendorId = 0, + productId = 14526 + ) // no pid (= 0) decimalString = "63610875354536700000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0xa, + vendorId = 45367, + productId = 0 + ) } /* @@ -285,11 +303,10 @@ class ManualCodeTest { */ @Test fun testPayloadParser_fullPayload() { - val payload = getDefaultPayload() var decimalString = "63610875354536714526" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + var payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -301,7 +318,7 @@ class ManualCodeTest { // The same thing, but with dashes separating digit groups. decimalString = "6361-0875-3545-3671-4526" decimalString += computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -312,7 +329,7 @@ class ManualCodeTest { decimalString = "52927623630456200032" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 38728284, @@ -323,7 +340,7 @@ class ManualCodeTest { decimalString = "40000100000000100001" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues(payload, pinCode = 1, discriminator = 0, vendorId = 1, productId = 1) } @@ -332,13 +349,13 @@ class ManualCodeTest { */ @Test fun testPayloadParser_invalidEntry() { - val payload = OnboardingPayload() + var payload = OnboardingPayload() // Empty input var decimalString = "" decimalString += Verhoeff10.computeCheckChar(decimalString) try { - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -348,7 +365,7 @@ class ManualCodeTest { decimalString = "24184.2196" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -358,7 +375,7 @@ class ManualCodeTest { decimalString = "2456" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -368,7 +385,7 @@ class ManualCodeTest { decimalString = "123456789123456785671" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -378,7 +395,7 @@ class ManualCodeTest { decimalString = "12749875380" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -388,7 +405,7 @@ class ManualCodeTest { decimalString = "23456789123456785610" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -398,7 +415,7 @@ class ManualCodeTest { decimalString = "2327680000" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -407,7 +424,7 @@ class ManualCodeTest { // wrong check digit decimalString = "02684354589" try { - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -420,11 +437,9 @@ class ManualCodeTest { @Test fun testShortCodeReadWrite() { val inPayload = getDefaultPayload() - val outPayload = OnboardingPayload() - var generator = ManualOnboardingPayloadGenerator(inPayload) var result = generator.payloadDecimalStringRepresentation() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() // Override the discriminator in the input payload with the short version, // since that's what we will produce. @@ -442,10 +457,9 @@ class ManualCodeTest { inPayload.vendorId = 1 inPayload.productId = 1 - val outPayload = OnboardingPayload() var generator = ManualOnboardingPayloadGenerator(inPayload) var result = generator.payloadDecimalStringRepresentation() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() // Override the discriminator in the input payload with the short version, // since that's what we will produce. @@ -651,8 +665,7 @@ class ManualCodeTest { val generator = ManualOnboardingPayloadGenerator(payload) val result = generator.payloadDecimalStringRepresentation() - val outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, @@ -672,8 +685,7 @@ class ManualCodeTest { val generator = ManualOnboardingPayloadGenerator(payload) val result = generator.payloadDecimalStringRepresentation() - val outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, diff --git a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt index afbfdd0e3e477d..92ad1bf8c55909 100644 --- a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt @@ -48,8 +48,7 @@ class QRCodeTest { generator.setAllowInvalidPayload(allowInvalidPayload) var result = generator.payloadBase38Representation() - var outPayload = OnboardingPayload() - QRCodeOnboardingPayloadParser(result).populatePayload(outPayload) + var outPayload = QRCodeOnboardingPayloadParser(result).populatePayload() return inPayload == outPayload } @@ -223,10 +222,8 @@ class QRCodeTest { var invalidString = kDefaultPayloadQRCode invalidString = invalidString.dropLast(1) + " " // space is not contained in the base38 alphabet - var payload = OnboardingPayload() - try { - QRCodeOnboardingPayloadParser(invalidString).populatePayload(payload) + QRCodeOnboardingPayloadParser(invalidString).populatePayload() assertThat(false) } catch (e: Exception) { println("Expected exception occurred: ${e.message}") @@ -241,10 +238,8 @@ class QRCodeTest { var invalidString = kDefaultPayloadQRCode invalidString = invalidString.dropLast(1) - var payload = OnboardingPayload() - try { - QRCodeOnboardingPayloadParser(invalidString).populatePayload(payload) + QRCodeOnboardingPayloadParser(invalidString).populatePayload() assertThat(false) } catch (e: Exception) { println("Expected exception occurred: ${e.message}") @@ -284,8 +279,7 @@ class QRCodeTest { var generator = QRCodeOnboardingPayloadGenerator(payload) var base38Rep = generator.payloadBase38Representation() - var resultingPayload = OnboardingPayload() - QRCodeOnboardingPayloadParser(base38Rep).populatePayload(resultingPayload) + var resultingPayload = QRCodeOnboardingPayloadParser(base38Rep).populatePayload() assertEquals(true, resultingPayload.isValidQRCodePayload()) assertEquals(true, payload == resultingPayload) From 5867ac5a69a2bc93ca1e38b93ab4098d878b1420 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:17:27 -0400 Subject: [PATCH 74/96] [Scenes] Level control handler bugfix (#29076) * Used NumericAttributesTraits for storage null values, removed un-necessary typing and added doc on on-off and level control handlers interactions * Update src/app/clusters/on-off-server/on-off-server.cpp Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --------- Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --- .../clusters/level-control/level-control.cpp | 19 +++++++++++++------ .../clusters/on-off-server/on-off-server.cpp | 5 +++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index b61d2c34156570..28f7c16573d86f 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -171,9 +171,16 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl uint8_t maxLevel; VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED); - pairs[0].attributeID = Attributes::CurrentLevel::Id; - pairs[0].attributeValue = (!level.IsNull()) ? level.Value() : maxLevel + 1; - size_t attributeCount = 1; + pairs[0].attributeID = Attributes::CurrentLevel::Id; + if (!level.IsNull()) + { + pairs[0].attributeValue = level.Value(); + } + else + { + chip::app::NumericAttributeTraits::SetNull(pairs[0].attributeValue); + } + size_t attributeCount = 1; if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)) { uint16_t frequency; @@ -238,9 +245,9 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl CommandId command = LevelControlHasFeature(endpoint, LevelControl::Feature::kOnOff) ? Commands::MoveToLevelWithOnOff::Id : Commands::MoveToLevel::Id; - status = moveToLevelHandler( - endpoint, command, level, app::DataModel::MakeNullable(static_cast(timeMs / 100)), - chip::Optional>(), chip::Optional>(), INVALID_STORED_LEVEL); + status = moveToLevelHandler(endpoint, command, level, app::DataModel::MakeNullable(static_cast(timeMs / 100)), + chip::Optional>(), chip::Optional>(), + INVALID_STORED_LEVEL); if (status != Status::Success) { diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 16a7e60664d658..a3ebc06d740b7c 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -289,6 +289,11 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl return err; } + // This handler assumes it is being used with the default handler for the level control. Therefore if the level control + // cluster with on off feature is present on the endpoint and the level control handler is registered, it assumes this + // handler will take action on the on-off state. This assumes the level control attributes were also saved in the scene. + // This is to prevent a behavior where the on off state is set by this handler, and then the level control handler or vice + // versa. #ifdef EMBER_AF_PLUGIN_LEVEL_CONTROL if (!(LevelControlWithOnOffFeaturePresent(endpoint) && Scenes::ScenesServer::Instance().IsHandlerRegistered(endpoint, LevelControlServer::GetSceneHandler()))) From f58ca4783ec414ae200182257736c4fc37b43589 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Thu, 7 Sep 2023 08:33:45 -0700 Subject: [PATCH 75/96] [Darwin] MTRDevice should change state to reachable immediately upon receiving subscription reports (#28996) * [Darwin] MTRDevice should change state to reachable immediately upon receiving subscription reports * Fix unit tests * Address review comment on _handleEventReport: needing to handle _state behavior change Co-authored-by: Boris Zbarsky * Clarify _handleEventReport comments * Clarify further _handleEventReport comments --------- Co-authored-by: Boris Zbarsky --- .../CHIP/MTRBaseSubscriptionCallback.h | 9 ++- .../CHIP/MTRBaseSubscriptionCallback.mm | 11 +++- src/darwin/Framework/CHIP/MTRDevice.mm | 65 +++++++++++++++++-- .../Framework/CHIPTests/MTRDeviceTests.m | 49 ++++++++------ 4 files changed, 107 insertions(+), 27 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h index dc2dda374db49e..12488e6817b970 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h @@ -56,13 +56,16 @@ typedef void (^ErrorCallback)(NSError * error); typedef void (^SubscriptionEstablishedHandler)(void); typedef void (^OnDoneHandler)(void); typedef void (^UnsolicitedMessageFromPublisherHandler)(void); +typedef void (^ReportBeginHandler)(void); +typedef void (^ReportEndHandler)(void); class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callback { public: MTRBaseSubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler _Nullable resubscriptionCallback, SubscriptionEstablishedHandler _Nullable subscriptionEstablishedHandler, OnDoneHandler _Nullable onDoneHandler, - UnsolicitedMessageFromPublisherHandler _Nullable unsolicitedMessageFromPublisherHandler = NULL) + UnsolicitedMessageFromPublisherHandler _Nullable unsolicitedMessageFromPublisherHandler = nil, + ReportBeginHandler _Nullable reportBeginHandler = nil, ReportEndHandler _Nullable reportEndHandler = nil) : mAttributeReportCallback(attributeReportCallback) , mEventReportCallback(eventReportCallback) , mErrorCallback(errorCallback) @@ -71,6 +74,8 @@ class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callbac , mBufferedReadAdapter(*this) , mOnDoneHandler(onDoneHandler) , mUnsolicitedMessageFromPublisherHandler(unsolicitedMessageFromPublisherHandler) + , mReportBeginHandler(reportBeginHandler) + , mReportEndHandler(reportEndHandler) { } @@ -137,6 +142,8 @@ class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callbac MTRDeviceResubscriptionScheduledHandler _Nullable mResubscriptionCallback = nil; SubscriptionEstablishedHandler _Nullable mSubscriptionEstablishedHandler = nil; UnsolicitedMessageFromPublisherHandler _Nullable mUnsolicitedMessageFromPublisherHandler = nil; + ReportBeginHandler _Nullable mReportBeginHandler = nil; + ReportEndHandler _Nullable mReportEndHandler = nil; chip::app::BufferedReadCallback mBufferedReadAdapter; // Our lifetime management is a little complicated. On errors that don't diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm index 7e077206a6730c..24301ce2a28062 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm @@ -27,6 +27,9 @@ { mAttributeReports = [NSMutableArray new]; mEventReports = [NSMutableArray new]; + if (mReportBeginHandler) { + mReportBeginHandler(); + } } // Reports attribute and event data if any exists @@ -48,7 +51,13 @@ } } -void MTRBaseSubscriptionCallback::OnReportEnd() { ReportData(); } +void MTRBaseSubscriptionCallback::OnReportEnd() +{ + ReportData(); + if (mReportEndHandler) { + mReportEndHandler(); + } +} void MTRBaseSubscriptionCallback::OnError(CHIP_ERROR aError) { diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 3b9f0bd793c852..7fbff236a2d9cb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -91,6 +91,8 @@ - (id)strongObject using namespace chip::app; using namespace chip::Protocols::InteractionModel; +typedef void (^FirstReportHandler)(void); + namespace { class SubscriptionCallback final : public MTRBaseSubscriptionCallback { @@ -98,9 +100,11 @@ - (id)strongObject SubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler resubscriptionCallback, SubscriptionEstablishedHandler subscriptionEstablishedHandler, OnDoneHandler onDoneHandler, - UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler) + UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler, ReportBeginHandler reportBeginHandler, + ReportEndHandler reportEndHandler) : MTRBaseSubscriptionCallback(attributeReportCallback, eventReportCallback, errorCallback, resubscriptionCallback, - subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler) + subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler, reportBeginHandler, + reportEndHandler) { } @@ -278,7 +282,6 @@ - (void)nodeMayBeAdvertisingOperational // Return YES if there's a valid delegate AND subscription is expected to report value - (BOOL)_subscriptionAbleToReport { - // TODO: include period from when first report comes in until establish callback return (_weakDelegate.strongObject) && (_state == MTRDeviceStateReachable); } @@ -290,9 +293,11 @@ - (void)_changeState:(MTRDeviceState)state _state = state; if (lastState != state) { if (state != MTRDeviceStateReachable) { - MTR_LOG_INFO("%@ Set estimated start time to nil due to state change", self); + MTR_LOG_INFO("%@ State change %lu => %lu, set estimated start time to nil", self, lastState, state); _estimatedStartTime = nil; _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil; + } else { + MTR_LOG_INFO("%@ State change %lu => %lu", self, lastState, state); } id delegate = _weakDelegate.strongObject; if (delegate) { @@ -411,6 +416,20 @@ - (void)_handleUnsolicitedMessageFromPublisher os_unfair_lock_unlock(&self->_lock); } +- (void)_handleReportBegin +{ + os_unfair_lock_lock(&self->_lock); + [self _changeState:MTRDeviceStateReachable]; + os_unfair_lock_unlock(&self->_lock); +} + +- (void)_handleReportEnd +{ + os_unfair_lock_lock(&self->_lock); + _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil; + os_unfair_lock_unlock(&self->_lock); +} + // assume lock is held - (void)_reportAttributes:(NSArray *> *)attributes { @@ -442,11 +461,33 @@ - (void)_handleEventReport:(NSArray *> *)eventRepor NSDate * oldEstimatedStartTime = _estimatedStartTime; for (NSDictionary * eventDict in eventReport) { // Whenever a StartUp event is received, reset the estimated start time + // New subscription case + // - Starts Unreachable + // - Start CASE and send subscription request + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save start time estimate + // - Optionally receive StartUp event + // - Set estimated system time from event receipt time, or saved UpTime estimate if exists + // - ReportEnd handler clears the saved start time estimate based on UpTime + // Subscription dropped from client point of view case + // - Starts Unreachable + // - Resubscribe happens after some time, and then same as the above + // Server resuming subscription after reboot case + // - Starts Reachable + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save value + // - Optionally receive StartUp event + // - Set estimated system time from event receipt time, or saved UpTime estimate if exists + // - ReportEnd handler clears the saved start time estimate based on UpTime + // Server resuming subscription after timeout case + // - Starts Reachable + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save value + // - ReportEnd handler clears the saved start time estimate based on UpTime MTREventPath * eventPath = eventDict[MTREventPathKey]; BOOL isStartUpEvent = (eventPath.cluster.unsignedLongValue == MTRClusterIDTypeBasicInformationID) && (eventPath.event.unsignedLongValue == MTREventIDTypeClusterBasicInformationEventStartUpID); - if (isStartUpEvent && (_state == MTRDeviceStateReachable)) { - // StartUp event received when server resumes subscription + if (isStartUpEvent) { if (_estimatedStartTimeFromGeneralDiagnosticsUpTime) { // If UpTime was received, make use of it as mark of system start time MTR_LOG_INFO("%@ StartUp event: set estimated start time forward to %@", self, @@ -610,6 +651,18 @@ - (void)_setupSubscription // OnUnsolicitedMessageFromPublisher [self _handleUnsolicitedMessageFromPublisher]; }); + }, + ^(void) { + MTR_LOG_DEFAULT("%@ got report begin", self); + dispatch_async(self.queue, ^{ + [self _handleReportBegin]; + }); + }, + ^(void) { + MTR_LOG_DEFAULT("%@ got report end", self); + dispatch_async(self.queue, ^{ + [self _handleReportEnd]; + }); }); // Set up a cluster state cache. We just want this for the logic it has for diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 0d9b693296bc2d..95f4aab4d5d30c 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -118,19 +118,19 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr typedef void (^MTRDeviceTestDelegateDataHandler)(NSArray *> *); @interface MTRDeviceTestDelegate : NSObject -@property (nonatomic) dispatch_block_t onSubscriptionEstablished; +@property (nonatomic) dispatch_block_t onReachable; +@property (nonatomic, nullable) dispatch_block_t onNotReachable; @property (nonatomic, nullable) MTRDeviceTestDelegateDataHandler onAttributeDataReceived; @property (nonatomic, nullable) MTRDeviceTestDelegateDataHandler onEventDataReceived; -@property (nonatomic, nullable) dispatch_block_t onSubscriptionDropped; @end @implementation MTRDeviceTestDelegate - (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state { if (state == MTRDeviceStateReachable) { - self.onSubscriptionEstablished(); - } else if (state == MTRDeviceStateUnknown && self.onSubscriptionDropped != nil) { - self.onSubscriptionDropped(); + self.onReachable(); + } else if (state != MTRDeviceStateReachable && self.onNotReachable != nil) { + self.onNotReachable(); } } @@ -1423,10 +1423,12 @@ - (void)test017_TestMTRDeviceBasics __auto_type * device = [MTRDevice deviceWithNodeID:kDeviceId deviceController:sController]; dispatch_queue_t queue = dispatch_get_main_queue(); + // Given reachable state becomes true before underlying OnSubscriptionEstablished callback, this expectation is necessary but + // not sufficient as a mark to the end of reports XCTestExpectation * subscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up"]; __auto_type * delegate = [[MTRDeviceTestDelegate alloc] init]; - delegate.onSubscriptionEstablished = ^() { + delegate.onReachable = ^() { [subscriptionExpectation fulfill]; }; @@ -1435,6 +1437,10 @@ - (void)test017_TestMTRDeviceBasics attributeReportsReceived += data.count; }; + // This is dependent on current implementation that priming reports send attributes and events in that order, and also that + // events in this test would fit in one report. So receiving events would mean all attributes and events have been received, and + // can satisfy the test below. + XCTestExpectation * gotReportsExpectation = [self expectationWithDescription:@"Attribute and Event reports have been received"]; __block unsigned eventReportsReceived = 0; delegate.onEventDataReceived = ^(NSArray *> * eventReport) { eventReportsReceived += eventReport.count; @@ -1451,6 +1457,7 @@ - (void)test017_TestMTRDeviceBasics XCTAssertNotNil(eventDict[MTREventTimestampDateKey]); } } + [gotReportsExpectation fulfill]; }; [device setDelegate:delegate queue:queue]; @@ -1481,7 +1488,7 @@ - (void)test017_TestMTRDeviceBasics [device readAttributeWithEndpointID:@(1) clusterID:@(MTRClusterIDTypeLevelControlID) attributeID:@(4) params:nil]; [device readAttributeWithEndpointID:@(1) clusterID:@(MTRClusterIDTypeLevelControlID) attributeID:@(4) params:nil]; - [self waitForExpectations:@[ subscriptionExpectation ] timeout:60]; + [self waitForExpectations:@[ subscriptionExpectation, gotReportsExpectation ] timeout:60]; XCTAssertNotEqual(attributeReportsReceived, 0); XCTAssertNotEqual(eventReportsReceived, 0); @@ -1489,16 +1496,6 @@ - (void)test017_TestMTRDeviceBasics attributeReportsReceived = 0; eventReportsReceived = 0; - XCTestExpectation * resubscriptionExpectation = [self expectationWithDescription:@"Resubscription has happened"]; - delegate.onSubscriptionEstablished = ^() { - [resubscriptionExpectation fulfill]; - }; - - XCTestExpectation * subscriptionDroppedExpectation = [self expectationWithDescription:@"Subscription has dropped"]; - delegate.onSubscriptionDropped = ^() { - [subscriptionDroppedExpectation fulfill]; - }; - // Before resubscribe, first test write failure and expected value effects NSNumber * testEndpointID = @(1); NSNumber * testClusterID = @(8); @@ -1547,11 +1544,25 @@ - (void)test017_TestMTRDeviceBasics [device readAttributeWithEndpointID:testEndpointID clusterID:testClusterID attributeID:testAttributeID params:nil]; [self waitForExpectations:@[ attributeReportErrorExpectation ] timeout:10]; + // Resubscription test setup + XCTestExpectation * subscriptionDroppedExpectation = [self expectationWithDescription:@"Subscription has dropped"]; + delegate.onNotReachable = ^() { + [subscriptionDroppedExpectation fulfill]; + }; + XCTestExpectation * resubscriptionExpectation = [self expectationWithDescription:@"Resubscription has happened"]; + delegate.onReachable = ^() { + [resubscriptionExpectation fulfill]; + }; + // reset the onAttributeDataReceived to validate the following resubscribe test delegate.onAttributeDataReceived = ^(NSArray *> * data) { attributeReportsReceived += data.count; }; + delegate.onEventDataReceived = ^(NSArray *> * eventReport) { + eventReportsReceived += eventReport.count; + }; + // Now trigger another subscription which will cause ours to drop; we should re-subscribe after that. MTRBaseDevice * baseDevice = GetConnectedDevice(); __auto_type params = [[MTRSubscribeParams alloc] initWithMinInterval:@(1) maxInterval:@(10)]; @@ -1580,9 +1591,9 @@ - (void)test017_TestMTRDeviceBasics // Now make sure we ignore later tests. Ideally we would just unsubscribe // or remove the delegate, but there's no good way to do that. - delegate.onSubscriptionEstablished = ^() { + delegate.onReachable = ^() { }; - delegate.onSubscriptionDropped = nil; + delegate.onNotReachable = nil; delegate.onAttributeDataReceived = nil; delegate.onEventDataReceived = nil; From 8b7f55b4306c353cdb413934cda1ac4aaee7c122 Mon Sep 17 00:00:00 2001 From: EricZijian_SiterWell Date: Fri, 8 Sep 2023 00:43:42 +0800 Subject: [PATCH 76/96] Change chip-tool.py to chip-tool (#29081) Co-authored-by: Hare --- .../certification/Test_TC_SMOKECO_2_2.yaml | 6 +-- .../certification/Test_TC_SMOKECO_2_3.yaml | 6 +-- .../certification/Test_TC_SMOKECO_2_4.yaml | 16 +++---- .../certification/Test_TC_SMOKECO_2_5.yaml | 44 +++++++++---------- .../certification/Test_TC_SMOKECO_2_6.yaml | 20 ++++----- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml index fbd307e0a0928a..efe21c12ec5090 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml @@ -105,7 +105,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -191,7 +191,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 2 @@ -242,7 +242,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml index 9e6430731dce5d..eb98f64d53f4b0 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml @@ -104,7 +104,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -190,7 +190,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 2 @@ -241,7 +241,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml index 7333b55fd247b4..d9374a8fa82a78 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml @@ -117,7 +117,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 1 @@ -168,7 +168,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 2 @@ -219,7 +219,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 0 @@ -281,7 +281,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + ./chip-tool smokecoalarm read hardware-fault-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 [TOO] HardwareFaultAlert: TRUE @@ -333,7 +333,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + ./chip-tool smokecoalarm read hardware-fault-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 [TOO] HardwareFaultAlert: FALSE @@ -395,7 +395,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + ./chip-tool smokecoalarm read end-of-service-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 [TOO] EndOfServiceAlert: 1 @@ -447,7 +447,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + ./chip-tool smokecoalarm read end-of-service-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 [TOO] EndOfServiceAlert: 0 @@ -577,7 +577,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read test-in-progress 1 1 + ./chip-tool smokecoalarm read test-in-progress 1 1 This step needs to be completed quickly diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml index f44ce08ab77d82..8fb355e1ed18dd 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml @@ -152,7 +152,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 1 @@ -204,7 +204,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 0 @@ -275,7 +275,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 1 @@ -327,7 +327,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 0 @@ -390,7 +390,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 Verify that the value of ContaminationState is 2 or 3 @@ -427,7 +427,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 0 @@ -462,7 +462,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 1 @@ -497,7 +497,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 0 @@ -544,7 +544,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 0 @@ -579,7 +579,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 1 @@ -614,7 +614,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 2 @@ -649,7 +649,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 1 @@ -716,7 +716,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -757,7 +757,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 1 @@ -800,7 +800,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 0 @@ -851,7 +851,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 2 @@ -928,7 +928,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 @@ -984,7 +984,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -1025,7 +1025,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 1 @@ -1068,7 +1068,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 0 @@ -1119,7 +1119,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 2 @@ -1196,7 +1196,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml index f5106b7f316591..00ecd8b85a63b2 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml @@ -188,7 +188,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 1 @@ -231,7 +231,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 1 @@ -272,7 +272,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 1 @@ -313,7 +313,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -354,7 +354,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -397,7 +397,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 @@ -447,7 +447,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 @@ -498,7 +498,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 0 @@ -550,7 +550,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 0 @@ -600,7 +600,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 0 From 5bdfb7524d6421252c17266f1a928b27afb2ba53 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 09:44:41 -0700 Subject: [PATCH 77/96] Optimize the algorithm to replace all occurrences of java/util/Optional (#29077) * Optimize the algorithm to replace all occurrences of java/util/Optional * Restyled by clang-format * Address review comment --------- Co-authored-by: Restyled.io --- src/lib/support/JniReferences.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 36f6b98e7e8a6a..edf9b8544d2665 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -124,7 +124,6 @@ CHIP_ERROR JniReferences::N2J_ByteArray(JNIEnv * env, const uint8_t * inArray, j CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * methodName, const char * methodSignature, jmethodID * methodId) { - CHIP_ERROR err = CHIP_NO_ERROR; jclass javaClass = nullptr; VerifyOrReturnError(env != nullptr && object != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); @@ -132,23 +131,31 @@ CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * VerifyOrReturnError(javaClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); *methodId = env->GetMethodID(javaClass, methodName, methodSignature); + env->ExceptionClear(); + + if (*methodId != nullptr) + { + return CHIP_NO_ERROR; + } // Try `j$` when enabling Java8. std::string methodSignature_java8_str(methodSignature); - if (*methodId == nullptr && methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + size_t pos = methodSignature_java8_str.find("java/util/Optional"); + if (pos != std::string::npos) { // Replace all "java/util/Optional" with "j$/util/Optional". - while (methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + while (pos != std::string::npos) { - size_t pos = methodSignature_java8_str.find("java/util/Optional"); methodSignature_java8_str.replace(pos, strlen("java/util/Optional"), "j$/util/Optional"); + pos = methodSignature_java8_str.find("java/util/Optional"); } *methodId = env->GetMethodID(javaClass, methodName, methodSignature_java8_str.c_str()); + env->ExceptionClear(); } VerifyOrReturnError(*methodId != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - return err; + return CHIP_NO_ERROR; } void JniReferences::CallVoidInt(JNIEnv * env, jobject object, const char * methodName, jint argument) @@ -218,11 +225,13 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti chip::JniClass jniClass(optionalCls); jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + env->ExceptionClear(); // Try `Lj$/util/Optional;` when enabling Java8. if (ofMethod == nullptr) { ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); + env->ExceptionClear(); } VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); From 971047f5931ee7ca1c49c9c7870cfb29b6a6e1c8 Mon Sep 17 00:00:00 2001 From: shchen-Lab <75290921+shchen-Lab@users.noreply.github.com> Date: Fri, 8 Sep 2023 01:08:15 +0800 Subject: [PATCH 78/96] [BouffaloLab]update sdk to support open network (#29070) * BL702&BL602 Support OpenNetWork * update sdk to support open network on bl706-wifi * Restyled by whitespace * BLCONFIG Bytes alignment * remove repo openthread misc * code style * Restyled by gn * remove otPlatCAlloc/otPlatFree * Restyled by gn * add comment and check credentials length * Restyled by clang-format --------- Co-authored-by: wyhong Co-authored-by: Restyled.io --- .../BL602/NetworkCommissioningDriver.cpp | 34 ++++++++++++++++--- .../BL602/NetworkCommissioningDriver.h | 9 ++++- .../BL702/NetworkCommissioningDriver.cpp | 28 ++++++++++++++- .../BL702/NetworkCommissioningDriver.h | 9 ++++- .../BL702/ThreadStackManagerImpl.cpp | 10 ------ .../BL702L/ThreadStackManagerImpl.cpp | 10 ------ src/platform/bouffalolab/common/BLConfig.cpp | 33 +++++++++++++++--- third_party/bouffalolab/repo | 2 +- 8 files changed, 102 insertions(+), 33 deletions(-) diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp index d9dd83c923cd57..b051a44a44a0d5 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp @@ -44,11 +44,11 @@ CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeC size_t ssidLen = 0; size_t credentialsLen = 0; - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.credentials, + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.credentials, sizeof(mSavedNetwork.credentials), &credentialsLen); SuccessOrExit(err); - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.ssid, - sizeof(mSavedNetwork.ssid), &ssidLen); + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), + &ssidLen); SuccessOrExit(err); mSavedNetwork.credentialsLen = credentialsLen; @@ -160,7 +160,33 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, memcpy(passwd, key, keyLen); wifi_interface_t wifi_interface; wifi_interface = wifi_mgmr_sta_enable(); - wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, passwd, NULL, NULL, 0, 0); + // Valid Credentials length are: + // - 0 bytes: Unsecured (open) connection + // - 5 bytes: WEP-64 passphrase + // - 10 hexadecimal ASCII characters: WEP-64 40-bit hex raw PSK + // - 13 bytes: WEP-128 passphrase + // - 26 hexadecimal ASCII characters: WEP-128 104-bit hex raw PSK + // - 8..63 bytes: WPA/WPA2/WPA3 passphrase + // - 64 bytes: WPA/WPA2/WPA3 raw hex PSK + // Note 10 hex WEP64 and 13 bytes / 26 hex WEP128 passphrase are covered by 8~63 bytes WPA passphrase, so we don't check WEP64 + // hex and WEP128 passphrase. + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || + (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) + { + + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) + { + wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, NULL, NULL, NULL, 0, 0); + } + else + { + wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, passwd, NULL, NULL, 0, 0); + } + } + else + { + return CHIP_ERROR_INVALID_STRING_LENGTH; + } return CHIP_NO_ERROR; } diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 7e0fd1b30727a1..83416a534988ac 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -86,6 +86,14 @@ class BLWiFiDriver final : public WiFiDriver char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; uint8_t credentialsLen = 0; }; + enum WiFiCredentialLength + { + kOpen = 0, + kWEP64 = 5, + kMinWPAPSK = 8, + kMaxWPAPSK = 63, + kWPAPSKHex = 64, + }; // BaseDriver NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } @@ -116,7 +124,6 @@ class BLWiFiDriver final : public WiFiDriver CHIP_ERROR SetLastDisconnectReason(const ChipDeviceEvent * event); int32_t GetLastDisconnectReason(); - static BLWiFiDriver & GetInstance() { static BLWiFiDriver instance; diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp index 6087fce9d94f66..252a1eba7f2475 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp @@ -132,7 +132,33 @@ Status BLWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCh CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen) { ChipLogProgress(NetworkProvisioning, "ConnectWiFiNetwork"); - wifiInterface_connect((char *) ssid, (char *) key); + // Valid Credentials length are: + // - 0 bytes: Unsecured (open) connection + // - 5 bytes: WEP-64 passphrase + // - 10 hexadecimal ASCII characters: WEP-64 40-bit hex raw PSK + // - 13 bytes: WEP-128 passphrase + // - 26 hexadecimal ASCII characters: WEP-128 104-bit hex raw PSK + // - 8..63 bytes: WPA/WPA2/WPA3 passphrase + // - 64 bytes: WPA/WPA2/WPA3 raw hex PSK + // Note 10 hex WEP64 and 13 bytes / 26 hex WEP128 passphrase are covered by 8~63 bytes WPA passphrase, so we don't check WEP64 + // hex and WEP128 passphrase. + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || + (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) + { + + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) + { + wifiInterface_connect((char *) ssid, NULL); + } + else + { + wifiInterface_connect((char *) ssid, (char *) key); + } + } + else + { + return CHIP_ERROR_INVALID_STRING_LENGTH; + } ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); return CHIP_NO_ERROR; } diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h index 48bf7d098c869f..caa071ddd467b2 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h @@ -78,7 +78,14 @@ class BLWiFiDriver final : public WiFiDriver char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength + 1]; uint8_t credentialsLen = 0; }; - + enum WiFiCredentialLength + { + kOpen = 0, + kWEP64 = 5, + kMinWPAPSK = 8, + kMaxWPAPSK = 63, + kWPAPSKHex = 64, + }; // BaseDriver NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } CHIP_ERROR Init(NetworkStatusChangeCallback * networkStatusChangeCallback) override; diff --git a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp index c4981afe84a656..94932a9febb8c8 100644 --- a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp @@ -103,16 +103,6 @@ extern "C" otInstance * otrGetInstance() return ThreadStackMgrImpl().OTInstance(); } -extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) -{ - return calloc(aNum, aSize); -} - -extern "C" void otPlatFree(void * aPtr) -{ - free(aPtr); -} - extern "C" uint32_t otrEnterCrit(void) { if (xPortIsInsideInterrupt()) diff --git a/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp b/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp index 1b1ebf197e006f..f2996526e84445 100644 --- a/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp @@ -106,16 +106,6 @@ extern "C" otInstance * otrGetInstance() return ThreadStackMgrImpl().OTInstance(); } -extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) -{ - return calloc(aNum, aSize); -} - -extern "C" void otPlatFree(void * aPtr) -{ - free(aPtr); -} - extern "C" ot_system_event_t otrGetNotifyEvent(void) { ot_system_event_t sevent = OT_SYSTEM_EVENT_NONE; diff --git a/src/platform/bouffalolab/common/BLConfig.cpp b/src/platform/bouffalolab/common/BLConfig.cpp index de1cc24d139508..ff03eb662a1bb7 100644 --- a/src/platform/bouffalolab/common/BLConfig.cpp +++ b/src/platform/bouffalolab/common/BLConfig.cpp @@ -111,9 +111,21 @@ CHIP_ERROR BLConfig::WriteConfigValue(const char * key, uint8_t * val, size_t si ef_port_env_lock(); - if (size && val) + if (size) { - ret = ef_set_env_blob(key, val, size); + if (val) + { + ret = ef_set_env_blob(key, val, size); + } + else + { + ret = EF_ENV_ARG_ERR; + } + } + else + { + uint32_t value_null = 0; + ret = ef_set_env_blob(key, &value_null, size); } ef_port_env_unlock(); @@ -240,11 +252,22 @@ CHIP_ERROR BLConfig::WriteKVS(const char * key, const void * value, size_t value ef_port_env_lock(); - if (value && value_size) + if (value_size) { - ret = ef_set_env_blob(key, value, value_size); + if (value) + { + ret = ef_set_env_blob(key, value, value_size); + } + else + { + ret = EF_ENV_ARG_ERR; + } + } + else + { + uint32_t value_null = 0; + ret = ef_set_env_blob(key, &value_null, value_size); } - ef_port_env_unlock(); if (ret == EF_NO_ERR) diff --git a/third_party/bouffalolab/repo b/third_party/bouffalolab/repo index dbca8b07013852..0c5772fb31ad08 160000 --- a/third_party/bouffalolab/repo +++ b/third_party/bouffalolab/repo @@ -1 +1 @@ -Subproject commit dbca8b07013852985a8bcea9cc56f486f53c77bd +Subproject commit 0c5772fb31ad083cafdedc9a9de578d3abd5a234 From 1b31a96879c576ab1bafff8b4d99863ccc15d549 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 7 Sep 2023 19:19:33 +0200 Subject: [PATCH 79/96] [MatterYamlTests] Add basic support for darwin-framework-tool (#28969) * Add darwin-framework-tool python yaml parser connection support. For the moment darwin-framework-tool does not send back anything nor supports special test commands that have been added to chip-tool to fully support yaml * Add sleep command to darwin-framework-tool * Add wait-for-commissionee command to darwin-framework-tool * Add darwin-framework-tool python yaml parser output connection support * Hack examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py so it does use the right argument names for darwin-framework-tool --------- Co-authored-by: Vivien Nicolas --- .../matter_chip_tool_adapter/decoder.py | 16 + .../matter_chip_tool_adapter/encoder.py | 21 +- examples/darwin-framework-tool/BUILD.gn | 20 +- .../commands/common/CHIPCommandBridge.mm | 6 + .../commands/common/RemoteDataModelLogger.h | 35 + .../commands/common/RemoteDataModelLogger.mm | 195 + .../commands/delay/Commands.h | 34 + .../commands/delay/SleepCommand.h | 52 + .../commands/delay/SleepCommand.mm | 28 + .../delay/WaitForCommissioneeCommand.h | 57 + .../delay/WaitForCommissioneeCommand.mm | 76 + .../commands/interactive/Commands.h | 1 + .../interactive/InteractiveCommands.h | 47 +- .../interactive/InteractiveCommands.mm | 241 +- examples/darwin-framework-tool/main.mm | 2 + .../templates/commands.zapt | 52 +- scripts/tests/yaml/chiptool.py | 55 +- scripts/tests/yaml/darwinframeworktool.py | 85 + scripts/tests/yaml/runner.py | 14 + scripts/tests/yaml/tests_tool.py | 68 + .../Matter.xcodeproj/project.pbxproj | 230 + .../zap-generated/cluster/Commands.h | 19363 +++++++++++++--- 22 files changed, 17961 insertions(+), 2737 deletions(-) create mode 100644 examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h create mode 100644 examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm create mode 100644 examples/darwin-framework-tool/commands/delay/Commands.h create mode 100644 examples/darwin-framework-tool/commands/delay/SleepCommand.h create mode 100644 examples/darwin-framework-tool/commands/delay/SleepCommand.mm create mode 100644 examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h create mode 100644 examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm create mode 100755 scripts/tests/yaml/darwinframeworktool.py create mode 100644 scripts/tests/yaml/tests_tool.py diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py index ec9b4702de0a3d..dc721b24268447 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py @@ -303,6 +303,22 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool): ) del value[str(field_code)] + # darwin-framework-tool returns the field name but with a different casing than what + # the test suite expects. + # To not confuse the test suite, the field name is replaced by its field name + # equivalent from the spec and then removed. + wrong_casing_field_name = field_name[0].lower( + ) + field_name[1:] + if field_name not in value and field_name[0].upper() == field_name[0] and wrong_casing_field_name in value: + value[field_name] = self.run( + specs, + value[wrong_casing_field_name], + cluster_name, + field_type, + field_array + ) + del value[wrong_casing_field_name] + if specs.is_fabric_scoped(struct): value[_FABRIC_INDEX_FIELD_NAME] = self.run( specs, diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 7a3735e213e049..355a2b18433e31 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -14,7 +14,9 @@ import base64 import json +import os import re +import sys _ANY_COMMANDS_LIST = [ 'ReadById', @@ -208,6 +210,12 @@ class Encoder: def __init__(self, specifications): self.__specs = specifications + # This is not the best way to toggle this flag. But for now it prevents having + # to build a new adapter for the very small differences that exists... + is_darwin_framework_tool = os.path.basename( + sys.argv[0]) == 'darwinframeworktool.py' + self.__is_darwin_framework_tool = is_darwin_framework_tool + def encode(self, request): cluster = self.__get_cluster_name(request) command, command_specifier = self.__get_command_name(request) @@ -305,7 +313,10 @@ def __maybe_add_destination(self, rv, request): if not self._supports_destination(request): return rv - destination_argument_name = 'destination-id' + if self.__is_darwin_framework_tool: + destination_argument_name = 'node-id' + else: + destination_argument_name = 'destination-id' destination_argument_value = None if request.group_id: @@ -333,6 +344,9 @@ def __maybe_add_endpoint(self, rv, request): if (request.is_attribute and not request.command == "writeAttribute") or request.is_event or (request.command in _ANY_COMMANDS_LIST and not request.command == "WriteById"): endpoint_argument_name = 'endpoint-ids' + if self.__is_darwin_framework_tool: + endpoint_argument_name = 'endpoint-id' + if rv: rv += ', ' rv += f'"{endpoint_argument_name}": "{endpoint_argument_value}"' @@ -378,7 +392,10 @@ def __get_argument_name(self, request, entry): if request.is_attribute: if command_name == 'writeAttribute': - argument_name = 'attribute-values' + if self.__is_darwin_framework_tool: + argument_name = 'attr-value' + else: + argument_name = 'attribute-values' else: argument_name = 'value' diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index c32fda585f7cca..1c792dfbd605ee 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -14,6 +14,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") +import("//build_overrides/jsoncpp.gni") import("${chip_root}/build/chip/tools.gni") import("${chip_root}/build/config/compiler/compiler.gni") @@ -132,6 +133,7 @@ action("build-darwin-framework") { config("config") { include_dirs = [ ".", + "${chip_root}/examples/common", "${chip_root}/examples/darwin-framework-tool/commands/common", "${chip_root}/zzz_generated/darwin-framework-tool", "${chip_root}/zzz_generated/controller-clusters", @@ -178,6 +180,13 @@ executable("darwin-framework-tool") { "commands/common/MTRError.mm", "commands/common/MTRError_Utils.h", "commands/common/MTRLogging.h", + "commands/common/RemoteDataModelLogger.h", + "commands/common/RemoteDataModelLogger.mm", + "commands/delay/Commands.h", + "commands/delay/SleepCommand.h", + "commands/delay/SleepCommand.mm", + "commands/delay/WaitForCommissioneeCommand.h", + "commands/delay/WaitForCommissioneeCommand.mm", "commands/discover/Commands.h", "commands/discover/DiscoverCommissionablesCommand.h", "commands/discover/DiscoverCommissionablesCommand.mm", @@ -200,12 +209,16 @@ executable("darwin-framework-tool") { deps = [ ":build-darwin-framework", - "${chip_root}/third_party/jsoncpp", + jsoncpp_root, ] if (config_use_interactive_mode) { sources += [ "commands/interactive/InteractiveCommands.mm" ] - deps += [ "${editline_root}:editline" ] + + deps += [ + "${chip_root}/examples/common/websocket-server", + "${editline_root}:editline", + ] } ldflags = [ @@ -240,6 +253,7 @@ executable("darwin-framework-tool") { # pics is needed by tests "${chip_root}/src/app/tests/suites/pics", + "${chip_root}/src/protocols:im_status", ] defines = [] @@ -248,6 +262,8 @@ executable("darwin-framework-tool") { "${chip_root}/config/standalone/", "${chip_root}/src/", "${chip_root}/src/include/", + "${chip_root}/src/protocols/", + "${chip_root}/src/protocols/interaction_model", "${chip_root}/third_party/nlassert/repo/include/", "${chip_root}/third_party/nlio/repo/include/", "${chip_root}/zzz_generated/app-common/", diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 55f429caeca981..eb938c2abb0614 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -40,6 +40,12 @@ ChipLogProgress(chipTool, "Running Command"); ReturnErrorOnFailure(MaybeSetUpStack()); SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); + + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = YES; + } + ReturnLogErrorOnFailure(RunCommand()); auto err = StartWaiting(GetWaitDuration()); diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h new file mode 100644 index 00000000000000..d8130143e20d8c --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 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. + * + */ + +#import + +#include + +class RemoteDataModelLoggerDelegate { +public: + CHIP_ERROR virtual LogJSON(const char *) = 0; + virtual ~RemoteDataModelLoggerDelegate() {}; +}; + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, id result); +CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, id result); +CHIP_ERROR LogAttributeErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, NSError * error); +CHIP_ERROR LogCommandErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, NSError * error); +void SetDelegate(RemoteDataModelLoggerDelegate * delegate); +}; // namespace RemoteDataModelLogger diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm new file mode 100644 index 00000000000000..679dca5bd3be83 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2023 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 "RemoteDataModelLogger.h" + +#import "MTRError_Utils.h" +#import + +#include +#include +#include + +#include + +constexpr const char * kClusterIdKey = "clusterId"; +constexpr const char * kEndpointIdKey = "endpointId"; +constexpr const char * kAttributeIdKey = "attributeId"; +constexpr const char * kCommandIdKey = "commandId"; +constexpr const char * kErrorIdKey = "error"; +constexpr const char * kClusterErrorIdKey = "clusterError"; +constexpr const char * kValueKey = "value"; + +constexpr const char kBase64Header[] = "base64:"; + +namespace { +RemoteDataModelLoggerDelegate * gDelegate; + +std::string JsonToString(Json::Value & json) +{ + Json::FastWriter writer; + writer.omitEndingLineFeed(); + return writer.write(json); +} + +CHIP_ERROR LogError(Json::Value & value, const chip::app::StatusIB & status) +{ + if (status.mClusterStatus.HasValue()) { + auto statusValue = status.mClusterStatus.Value(); + value[kClusterErrorIdKey] = statusValue; + } + +#if CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + auto statusName = chip::Protocols::InteractionModel::StatusName(status.mStatus); + value[kErrorIdKey] = statusName; +#else + auto statusName = status.mStatus; + value[kErrorIdKey] = chip::to_underlying(statusName); +#endif // CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR AsJsonValue(id value, Json::Value & jsonValue) +{ + if (value == nil) { + jsonValue = Json::nullValue; + } else if ([value isKindOfClass:[NSNumber class]]) { + if (CFNumberIsFloatType((CFNumberRef) value)) { + jsonValue = [value doubleValue]; + } else if ([[value stringValue] hasPrefix:@"-"]) { + jsonValue = [value longLongValue]; + } else { + jsonValue = [value unsignedLongLongValue]; + } + } else if ([value isKindOfClass:[NSArray class]]) { + jsonValue = Json::arrayValue; + + NSArray * array = value; + for (id element in array) { + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(element, jsonElement)); + jsonValue.append(jsonElement); + } + } else if ([value isKindOfClass:[NSDictionary class]]) { + jsonValue = Json::ValueType::objectValue; + + NSDictionary * dict = value; + for (id key in dict) { + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue([dict objectForKey:key], jsonElement)); + jsonValue[[key UTF8String]] = jsonElement; + } + } else if ([value isKindOfClass:[NSData class]]) { + NSData * data = value; + data = [data base64EncodedDataWithOptions:0]; + auto base64Str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + auto prefix = [NSString stringWithUTF8String:kBase64Header]; + auto base64PrefixedStr = [prefix stringByAppendingString:base64Str]; + jsonValue = [base64PrefixedStr UTF8String]; + } else if ([value isKindOfClass:[NSString class]]) { + jsonValue = [value UTF8String]; + } else if ([value isKindOfClass:[NSObject class]]) { + jsonValue = Json::ValueType::objectValue; + + unsigned int numberOfProperties; + objc_property_t * properties = class_copyPropertyList([value class], &numberOfProperties); + for (NSUInteger i = 0; i < numberOfProperties; i++) { + objc_property_t property = properties[i]; + NSString * key = [[NSString alloc] initWithUTF8String:property_getName(property)]; + + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue([value valueForKey:key], jsonElement)); + jsonValue[[key UTF8String]] = jsonElement; + } + free(properties); + } else { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + + return CHIP_NO_ERROR; +} + +} // namespace + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, id result) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kAttributeIdKey] = [attributeId unsignedLongLongValue]; + + Json::Value jsonValue; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); + value[kValueKey] = jsonValue; + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, id result) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kCommandIdKey] = [commandId unsignedLongLongValue]; + + Json::Value jsonValue; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); + value[kValueKey] = jsonValue; + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogAttributeErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, NSError * error) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kAttributeIdKey] = [attributeId unsignedLongLongValue]; + + auto err = MTRErrorToCHIPErrorCode(error); + auto status = chip::app::StatusIB(err); + return LogError(value, status); +} + +CHIP_ERROR LogCommandErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, NSError * error) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kCommandIdKey] = [commandId unsignedLongLongValue]; + + auto err = MTRErrorToCHIPErrorCode(error); + auto status = chip::app::StatusIB(err); + return LogError(value, status); +} + +void SetDelegate(RemoteDataModelLoggerDelegate * delegate) { gDelegate = delegate; } +}; // namespace RemoteDataModelLogger diff --git a/examples/darwin-framework-tool/commands/delay/Commands.h b/examples/darwin-framework-tool/commands/delay/Commands.h new file mode 100644 index 00000000000000..1f0ecfb8e997a4 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/Commands.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 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 "commands/common/Commands.h" +#include "commands/delay/SleepCommand.h" +#include "commands/delay/WaitForCommissioneeCommand.h" + +void registerCommandsDelay(Commands & commands) +{ + const char * clusterName = "Delay"; + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + }; + + commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for waiting for something to happen."); +} diff --git a/examples/darwin-framework-tool/commands/delay/SleepCommand.h b/examples/darwin-framework-tool/commands/delay/SleepCommand.h new file mode 100644 index 00000000000000..417bc59688b2d5 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/SleepCommand.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2022 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 "../common/CHIPCommandBridge.h" + +/** + * This command blocks the event loop processing for a given amount of time. + * + * For example when the event loop is blocked the messages coming-in will not be acked, + * forcing a retransmission on the other side. + * + */ + +class SleepCommand : public CHIPCommandBridge +{ +public: + SleepCommand() : CHIPCommandBridge("sleep") + { + AddArgument("duration-in-ms", 0, UINT32_MAX, &mDurationInMs, + "Block the event loop processing for duration-in-ms milliseconds."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override + { + // The allowed duration of this method is at least as long as the time specified for blocking the + // event loop. In order to not fail on some small delays in processing some extra time before + // failing is added. + constexpr uint16_t mExtraTimeForFailure = 1000; + + return chip::System::Clock::Milliseconds32(mDurationInMs + mExtraTimeForFailure); + } + +private: + uint32_t mDurationInMs; +}; diff --git a/examples/darwin-framework-tool/commands/delay/SleepCommand.mm b/examples/darwin-framework-tool/commands/delay/SleepCommand.mm new file mode 100644 index 00000000000000..8fefd145e8acee --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/SleepCommand.mm @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 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 "SleepCommand.h" +#include +#include + +CHIP_ERROR SleepCommand::RunCommand() +{ + std::this_thread::sleep_for(std::chrono::milliseconds(mDurationInMs)); + SetCommandExitStatus(CHIP_NO_ERROR); + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h new file mode 100644 index 00000000000000..053d8c04247493 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023 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 "../common/CHIPCommandBridge.h" +#include +#include + +NS_ASSUME_NONNULL_BEGIN +@interface MTRDeviceTestDelegate : NSObject +@property CHIPCommandBridge * commandBridge; +- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge; +- (instancetype)init NS_UNAVAILABLE; +@end +NS_ASSUME_NONNULL_END + +class WaitForCommissioneeCommand : public CHIPCommandBridge { +public: + WaitForCommissioneeCommand() + : CHIPCommandBridge("wait-for-commissionee") + , mDeviceDelegate([[MTRDeviceTestDelegate alloc] initWithCommandBridge:this]) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("expire-existing-session", 0, 1, &mExpireExistingSession); + AddArgument( + "timeout", 0, UINT64_MAX, &mTimeoutSecs, "Time, in seconds, before this command is considered to have timed out."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeoutSecs.ValueOr(10)); + } + +private: + chip::NodeId mNodeId; + chip::Optional mTimeoutSecs; + chip::Optional mExpireExistingSession; + id _Nullable mDeviceDelegate; +}; diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm new file mode 100644 index 00000000000000..a806757ac1eb85 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 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 "WaitForCommissioneeCommand.h" + +#import "MTRDevice_Externs.h" + +@implementation MTRDeviceTestDelegate +- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge +{ + if (!(self = [super init])) { + return nil; + } + + _commandBridge = commandBridge; + return self; +} + +- (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state +{ + if (state == MTRDeviceStateReachable) { + _commandBridge->SetCommandExitStatus(CHIP_NO_ERROR); + } else if (state == MTRDeviceStateUnreachable) { + _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); + } else if (state == MTRDeviceStateUnknown) { + _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); + } else { + // This should not happens. + chipDie(); + } +} + +- (void)device:(MTRDevice *)device receivedAttributeReport:(NSArray *> *)attributeReport +{ +} + +- (void)device:(MTRDevice *)device receivedEventReport:(NSArray *> *)eventReport +{ +} +@end + +CHIP_ERROR WaitForCommissioneeCommand::RunCommand() +{ + MTRDeviceController * commissioner = CurrentCommissioner(); + + auto * base_device = [MTRBaseDevice deviceWithNodeID:@(mNodeId) controller:commissioner]; + VerifyOrReturnError(base_device != nil, CHIP_ERROR_INCORRECT_STATE); + + if (mExpireExistingSession.ValueOr(true)) { + [base_device invalidateCASESession]; + } + base_device = nil; + + auto * device = [MTRDevice deviceWithNodeID:@(mNodeId) controller:commissioner]; + VerifyOrReturnError(device != nil, CHIP_ERROR_INCORRECT_STATE); + + auto queue = dispatch_queue_create("com.chip.wait_for_commissionee", DISPATCH_QUEUE_SERIAL); + [device setDelegate:mDeviceDelegate queue:queue]; + + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/commands/interactive/Commands.h b/examples/darwin-framework-tool/commands/interactive/Commands.h index fdc92f45579725..96cc657048899a 100644 --- a/examples/darwin-framework-tool/commands/interactive/Commands.h +++ b/examples/darwin-framework-tool/commands/interactive/Commands.h @@ -32,6 +32,7 @@ void registerCommandsInteractive(Commands & commands) commands_list clusterCommands = { #if CONFIG_USE_INTERACTIVE_MODE make_unique(&commands), + make_unique(&commands), #endif // CONFIG_USE_INTERACTIVE_MODE }; diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h index cff524a1c0650e..15f1303f0fe54f 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h @@ -21,28 +21,63 @@ #import #include "../common/CHIPCommandBridge.h" +#include "../common/RemoteDataModelLogger.h" #include "commands/common/Commands.h" #include "InteractiveCommands.h" +#include + class Commands; -class InteractiveStartCommand : public CHIPCommandBridge +class InteractiveCommand : public CHIPCommandBridge { public: - InteractiveStartCommand(Commands * commandsHandler) : CHIPCommandBridge("start"), mHandler(commandsHandler) + InteractiveCommand(const char * name, Commands * commandsHandler) : CHIPCommandBridge(name), mHandler(commandsHandler) { AddArgument( "additional-prompt", &mAdditionalPrompt, "Force printing of an additional prompt that can then be detected by something trying to script interactive mode"); } - CHIP_ERROR RunCommand() override; - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(0); } + bool ParseCommand(char * command, int * status); + +protected: + chip::Optional mAdditionalPrompt; + private: - bool ParseCommand(char * command); Commands * mHandler = nullptr; - chip::Optional mAdditionalPrompt; +}; + +class InteractiveStartCommand : public InteractiveCommand +{ +public: + InteractiveStartCommand(Commands * commandsHandler) : InteractiveCommand("start", commandsHandler) {} + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; +}; + +class InteractiveServerCommand : public InteractiveCommand, public WebSocketServerDelegate, public RemoteDataModelLoggerDelegate +{ +public: + InteractiveServerCommand(Commands * commandsHandler) : InteractiveCommand("server", commandsHandler) + { + AddArgument("port", 0, UINT16_MAX, &mPort, "Port the websocket will listen to. Defaults to 9002."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + + /////////// WebSocketServerDelegate Interface ///////// + bool OnWebSocketMessageReceived(char * msg) override; + + /////////// RemoteDataModelLoggerDelegate interface ///////// + CHIP_ERROR LogJSON(const char * json) override; + +private: + WebSocketServer mWebSocketServer; + chip::Optional mPort; }; diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index a3db301d6529ee..ab55be5a245cfe 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -18,6 +18,7 @@ #include "InteractiveCommands.h" +#include #include #include @@ -25,6 +26,9 @@ constexpr const char * kInteractiveModePrompt = "Stop and restart stack: [Ctrl+_] & [Ctrl+^] \nQuit Interactive: 'quit()'\n>>> "; constexpr const char * kInteractiveModeHistoryFilePath = "/tmp/darwin_framework_tool_history"; constexpr const char * kInteractiveModeStopCommand = "quit()"; +constexpr const char * kCategoryError = "Error"; +constexpr const char * kCategoryProgress = "Info"; +constexpr const char * kCategoryDetail = "Debug"; namespace { @@ -71,6 +75,187 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, chip::Logging::Platform::LogV(module, category, msg, args); ClearLine(); } + +class ScopedLock { +public: + ScopedLock(std::mutex & mutex) + : mMutex(mutex) + { + mMutex.lock(); + } + + ~ScopedLock() { mMutex.unlock(); } + +private: + std::mutex & mMutex; +}; + +struct InteractiveServerResultLog { + std::string module; + std::string message; + std::string messageType; +}; + +struct InteractiveServerResult { + bool mEnabled = false; + uint16_t mTimeout = 0; + int mStatus = EXIT_SUCCESS; + bool mIsAsyncReport = false; + std::vector mResults; + std::vector mLogs; + + // The InteractiveServerResult instance (gInteractiveServerResult) is initially + // accessed on the main thread in InteractiveServerCommand::RunCommand, which is + // when chip-tool starts in 'interactive server' mode. + // + // Then command results are normally sent over the wire onto the main thread too + // when a command is received over WebSocket in InteractiveServerCommand::OnWebSocketMessageReceived + // which for most cases runs a command onto the chip thread and block until + // it is resolved (or until it timeouts). + // + // But in the meantime, when some parts of the command result happens, it is appended + // to the mResults vector onto the chip thread. + // + // For empty commands, which means that the test suite is *waiting* for some events + // (e.g a subscription report), the command results are sent over the chip thread + // (this is the isAsyncReport use case). + // + // Finally, logs can be appended from either the chip thread or the main thread. + // + // This class should be refactored to abstract that properly and reduce the scope of + // of the mutex, but in the meantime, the access to the members of this class are + // protected by a mutex. + std::mutex mMutex; + + void Setup(bool isAsyncReport, uint16_t timeout) + { + auto lock = ScopedLock(mMutex); + mEnabled = true; + mIsAsyncReport = isAsyncReport; + mTimeout = timeout; + } + + void Reset() + { + auto lock = ScopedLock(mMutex); + + mEnabled = false; + mIsAsyncReport = false; + mTimeout = 0; + mStatus = EXIT_SUCCESS; + mResults.clear(); + mLogs.clear(); + } + + bool IsAsyncReport() + { + auto lock = ScopedLock(mMutex); + return mIsAsyncReport; + } + + void MaybeAddLog(const char * module, uint8_t category, const char * base64Message) + { + auto lock = ScopedLock(mMutex); + VerifyOrReturn(mEnabled); + + const char * messageType = nullptr; + switch (category) { + case chip::Logging::kLogCategory_Error: + messageType = kCategoryError; + break; + case chip::Logging::kLogCategory_Progress: + messageType = kCategoryProgress; + break; + case chip::Logging::kLogCategory_Detail: + messageType = kCategoryDetail; + break; + default: + // This should not happen. + chipDie(); + break; + } + + mLogs.push_back(InteractiveServerResultLog({ module, base64Message, messageType })); + } + + void MaybeAddResult(const char * result) + { + auto lock = ScopedLock(mMutex); + VerifyOrReturn(mEnabled); + + mResults.push_back(result); + } + + std::string AsJsonString() + { + auto lock = ScopedLock(mMutex); + + std::stringstream content; + content << "{"; + + content << " \"results\": ["; + if (mResults.size()) { + for (const auto & result : mResults) { + content << result << ","; + } + + // Remove last comma. + content.seekp(-1, std::ios_base::end); + } + + if (mStatus != EXIT_SUCCESS) { + if (mResults.size()) { + content << ","; + } + content << "{ \"error\": \"FAILURE\" }"; + } + content << "],"; + + content << "\"logs\": ["; + if (mLogs.size()) { + for (const auto & log : mLogs) { + content << "{" + " \"module\": \"" + + log.module + + "\"," + " \"category\": \"" + + log.messageType + + "\"," + " \"message\": \"" + + log.message + + "\"" + "},"; + } + + // Remove last comma. + content.seekp(-1, std::ios_base::end); + } + content << "]"; + + content << "}"; + return content.str(); + } +}; + +InteractiveServerResult gInteractiveServerResult; + +void ENFORCE_FORMAT(3, 0) InteractiveServerLoggingCallback(const char * module, uint8_t category, const char * msg, va_list args) +{ + va_list args_copy; + va_copy(args_copy, args); + + chip::Logging::Platform::LogV(module, category, msg, args); + + char message[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + vsnprintf(message, sizeof(message), msg, args_copy); + va_end(args_copy); + + char base64Message[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE * 2] = {}; + chip::Base64Encode(chip::Uint8::from_char(message), static_cast(strlen(message)), base64Message); + + gInteractiveServerResult.MaybeAddLog(module, category, base64Message); +} + } // namespace char * GetCommand(const chip::Optional & mAdditionalPrompt, char * command) @@ -122,9 +307,10 @@ el_status_t StopFunction() el_bind_key(CTL('_'), StopFunction); char * command = nullptr; + int status; while (YES) { command = GetCommand(mAdditionalPrompt, command); - if (command != nullptr && !ParseCommand(command)) { + if (command != nullptr && !ParseCommand(command, &status)) { break; } } @@ -138,7 +324,54 @@ el_status_t StopFunction() return CHIP_NO_ERROR; } -bool InteractiveStartCommand::ParseCommand(char * command) +CHIP_ERROR InteractiveServerCommand::RunCommand() +{ + read_history(kInteractiveModeHistoryFilePath); + + // Logs needs to be redirected in order to refresh the screen appropriately when something + // is dumped to stdout while the user is typing a command. + chip::Logging::SetLogRedirectCallback(InteractiveServerLoggingCallback); + + RemoteDataModelLogger::SetDelegate(this); + ReturnErrorOnFailure(mWebSocketServer.Run(mPort, this)); + + gInteractiveServerResult.Reset(); + SetCommandExitStatus(CHIP_NO_ERROR); + return CHIP_NO_ERROR; +} + +bool InteractiveServerCommand::OnWebSocketMessageReceived(char * msg) +{ + bool isAsyncReport = strlen(msg) == 0; + uint16_t timeout = 0; + if (!isAsyncReport && strlen(msg) <= 5 /* Only look for numeric values <= 65535 */) { + std::stringstream ss; + ss << msg; + ss >> timeout; + if (!ss.fail()) { + isAsyncReport = true; + } + } + gInteractiveServerResult.Setup(isAsyncReport, timeout); + VerifyOrReturnValue(!isAsyncReport, true); + + auto shouldStop = ParseCommand(msg, &gInteractiveServerResult.mStatus); + mWebSocketServer.Send(gInteractiveServerResult.AsJsonString().c_str()); + gInteractiveServerResult.Reset(); + return shouldStop; +} + +CHIP_ERROR InteractiveServerCommand::LogJSON(const char * json) +{ + gInteractiveServerResult.MaybeAddResult(json); + if (gInteractiveServerResult.IsAsyncReport()) { + mWebSocketServer.Send(gInteractiveServerResult.AsJsonString().c_str()); + gInteractiveServerResult.Reset(); + } + return CHIP_NO_ERROR; +} + +bool InteractiveCommand::ParseCommand(char * command, int * status) { if (strcmp(command, kInteractiveModeStopCommand) == 0) { ExecuteDeferredCleanups(); @@ -146,6 +379,8 @@ el_status_t StopFunction() } ClearLine(); - mHandler->RunInteractive(command); + + *status = mHandler->RunInteractive(command); + return YES; } diff --git a/examples/darwin-framework-tool/main.mm b/examples/darwin-framework-tool/main.mm index 51325001e59c2e..8c96d490dc5ed8 100644 --- a/examples/darwin-framework-tool/main.mm +++ b/examples/darwin-framework-tool/main.mm @@ -21,6 +21,7 @@ #import "logging/logging.h" #include "commands/common/Commands.h" +#include "commands/delay/Commands.h" #include "commands/discover/Commands.h" #include "commands/interactive/Commands.h" #include "commands/pairing/Commands.h" @@ -38,6 +39,7 @@ int main(int argc, const char * argv[]) Commands commands; registerCommandsPairing(commands); + registerCommandsDelay(commands); registerCommandsDiscover(commands); registerCommandsInteractive(commands); registerCommandsPayload(commands); diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index f572311a53c2c5..9d1c98e1d1d06f 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -74,6 +74,10 @@ public: {{#if hasSpecificResponse}} ^(MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase responseName}}Params * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase responseName}}::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } {{else}} ^(NSError * _Nullable error) { {{/if}} @@ -81,6 +85,12 @@ public: if (error != nil) { mError = error; LogNSError("Error", error); + {{#if hasSpecificResponse}} + constexpr chip::CommandId responseId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase responseName}}::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + {{else}} + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + {{/if}} } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -153,8 +163,11 @@ public: {{~/if_is_fabric_scoped_struct~}} ^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error) { NSLog(@"{{asUpperCamelCase parent.name preserveAcronyms=true}}.{{asUpperCamelCase name preserveAcronyms=true}} response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("{{asUpperCamelCase parent.name preserveAcronyms=true}} {{asUpperCamelCase name preserveAcronyms=true}} read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -200,17 +213,33 @@ public: {{#if_chip_complex}} {{asObjectiveCType type parent.name}} value; {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} - {{else if (isOctetString type)}} - {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - {{else if (isString type)}} - {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; {{else}} - {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue]; + {{#if isNullable}} + {{asObjectiveCType type parent.name}} value = nil; + if (!mValue.IsNull()) { + {{#if (isOctetString type)}} + value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; + {{else if (isString type)}} + value = [[NSString alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size() encoding:NSUTF8StringEncoding]; + {{else}} + value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue.Value()]; + {{/if}} + } + {{else}} + {{#if (isOctetString type)}} + {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + {{else if (isString type)}} + {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue{{#if isNullable}}.Value(){{/if}}]; + {{/if}} + {{/if}} {{/if_chip_complex}} [cluster write{{>attribute}}WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("{{asUpperCamelCase parent.name preserveAcronyms=true}} {{asUpperCamelCase name preserveAcronyms=true}} write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -222,11 +251,11 @@ private: {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}} mValue; TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}}> mComplex; {{else if (isOctetString type)}} - chip::ByteSpan mValue; + {{#if isNullable}}chip::app::DataModel::Nullable{{else}}chip::ByteSpan{{/if}} mValue; {{else if (isCharString type)}} - chip::ByteSpan mValue; + {{#if isNullable}}chip::app::DataModel::Nullable{{else}}chip::ByteSpan{{/if}} mValue; {{else}} - {{as_underlying_zcl_type type}} mValue; + {{#if isNullable}}chip::app::DataModel::Nullable<{{as_underlying_zcl_type type}}>{{else}}{{as_underlying_zcl_type type}}{{/if}} mValue; {{/if_chip_complex}} }; @@ -265,6 +294,11 @@ public: subscriptionEstablished:^(){ mSubscriptionEstablished=YES; } reportHandler:^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error) { NSLog(@"{{asUpperCamelCase parent.name preserveAcronyms=true}}.{{asUpperCamelCase name preserveAcronyms=true}} response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; diff --git a/scripts/tests/yaml/chiptool.py b/scripts/tests/yaml/chiptool.py index 757d304312d77b..60fc542d572311 100755 --- a/scripts/tests/yaml/chiptool.py +++ b/scripts/tests/yaml/chiptool.py @@ -16,64 +16,15 @@ import relative_importer # isort: split # noqa: F401 -import asyncio -import json import sys from typing import List import click -from matter_chip_tool_adapter.decoder import MatterLog -from matter_yamltests.websocket_runner import WebSocketRunner, WebSocketRunnerConfig from paths_finder import PathsFinder -from runner import CONTEXT_SETTINGS, chiptool, runner_base -from tests_logger import TestColoredLogPrinter, WebSocketRunnerLogger +from runner import CONTEXT_SETTINGS, chiptool +from tests_tool import send_raw_command, send_yaml_command _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' - - -@click.pass_context -def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): - kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, - 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} - - index = 0 - while len(commands) - index > 1: - kwargs[commands[index].replace('--', '')] = commands[index+1] - index += 2 - ctx.invoke(runner_base, **kwargs) - - del ctx.params['commands'] - del ctx.params['pics'] - del ctx.params['additional_pseudo_clusters_directory'] - - return ctx.forward(chiptool) - - -def send_raw_command(command: str, server_path: str, server_arguments: str): - websocket_runner_hooks = WebSocketRunnerLogger() - websocket_runner_config = WebSocketRunnerConfig( - server_path=server_path, server_arguments=server_arguments, hooks=websocket_runner_hooks) - runner = WebSocketRunner(websocket_runner_config) - - async def send_over_websocket(): - payload = None - try: - await runner.start() - payload = await runner.execute(command) - finally: - await runner.stop() - return payload - - payload = asyncio.run(send_over_websocket()) - json_payload = json.loads(payload) - - log_printer = TestColoredLogPrinter() - log_printer.print(MatterLog.decode_logs(json_payload.get('logs'))) - - success = not bool(len([lambda x: x.get('error') for x in json_payload.get('results')])) - return success - - _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' @@ -136,7 +87,7 @@ def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, se maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/darwinframeworktool.py b/scripts/tests/yaml/darwinframeworktool.py new file mode 100755 index 00000000000000..77ab3d8b813716 --- /dev/null +++ b/scripts/tests/yaml/darwinframeworktool.py @@ -0,0 +1,85 @@ +#!/usr/bin/env -S python3 -B + +# Copyright (c) 2023 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 relative_importer # isort: split # noqa: F401 + +import sys +from typing import List + +import click +from paths_finder import PathsFinder +from runner import CONTEXT_SETTINGS, darwinframeworktool +from tests_tool import send_raw_command, send_yaml_command + +_DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' +_DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' + + +def darwinframeworktool_runner_options(f): + f = click.option('--server_path', type=click.Path(exists=True), default=None, + help='Path to an websocket server to run at launch.')(f) + f = click.option('--server_name', type=str, default='darwin-framework-tool', + help='Name of a websocket server to run at launch.')(f) + f = click.option('--server_arguments', type=str, default='interactive server', + help='Optional arguments to pass to the websocket server at launch.')(f) + f = click.option('--show_adapter_logs', type=bool, default=False, show_default=True, + help='Show additional logs provided by the adapter.')(f) + f = click.option('--delay-in-ms', '--delayInMs', type=int, default=0, show_default=True, + help='Add a delay between each test suite steps.')(f) + f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, + help='Do not stop running the test suite on first error.')(f) + f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, + help='Path to the PICS file to use.')(f) + f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, + help='Path to a directory containing additional pseudo clusters.')(f) + return f + + +CONTEXT_SETTINGS['ignore_unknown_options'] = True +CONTEXT_SETTINGS['default_map']['darwinframeworktool']['use_test_harness_log_format'] = True + + +def maybe_update_stop_on_error(ctx): + if ctx.params['continueonfailure']: + ctx.params['stop_on_error'] = False + + del ctx.params['continueonfailure'] + + +@click.command(context_settings=CONTEXT_SETTINGS) +@click.argument('commands', nargs=-1) +@darwinframeworktool_runner_options +@click.pass_context +def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): + success = False + + server_arguments = ctx.params['server_arguments'] + maybe_update_stop_on_error(ctx) + + if len(commands) > 1 and commands[0] == 'tests': + success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + additional_pseudo_clusters_directory, commands[2:]) + else: + if server_path is None and server_name: + paths_finder = PathsFinder() + server_path = paths_finder.get(server_name) + success = send_raw_command(' '.join(commands), server_path, server_arguments) + + sys.exit(0 if success else 1) + + +if __name__ == '__main__': + darwinframeworktool_py() diff --git a/scripts/tests/yaml/runner.py b/scripts/tests/yaml/runner.py index 04f30401eb1b02..073726fa7e4813 100755 --- a/scripts/tests/yaml/runner.py +++ b/scripts/tests/yaml/runner.py @@ -224,6 +224,11 @@ def __add_custom_params(self, ctx): 'server_name': 'chip-tool', 'server_arguments': 'interactive server', }, + 'darwinframeworktool': { + 'adapter': 'matter_chip_tool_adapter.adapter', + 'server_name': 'darwin-framework-tool', + 'server_arguments': 'interactive server', + }, 'app1': { 'configuration_directory': 'examples/placeholder/linux/apps/app1', 'adapter': 'matter_placeholder_adapter.adapter', @@ -349,6 +354,15 @@ def chiptool(ctx, *args, **kwargs): return ctx.forward(websocket) +@runner_base.command() +@test_runner_options +@websocket_runner_options +@click.pass_context +def darwinframeworktool(ctx, *args, **kwargs): + """Run the test suite using darwin-framework-tool.""" + return ctx.forward(websocket) + + @runner_base.command() @test_runner_options @websocket_runner_options diff --git a/scripts/tests/yaml/tests_tool.py b/scripts/tests/yaml/tests_tool.py new file mode 100644 index 00000000000000..65883a4bf8def5 --- /dev/null +++ b/scripts/tests/yaml/tests_tool.py @@ -0,0 +1,68 @@ +# Copyright (c) 2023 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 relative_importer # isort: split # noqa: F401 + +import asyncio +import json +from typing import List + +import click +from matter_chip_tool_adapter.decoder import MatterLog +from matter_yamltests.websocket_runner import WebSocketRunner, WebSocketRunnerConfig +from runner import runner_base +from tests_logger import TestColoredLogPrinter, WebSocketRunnerLogger + + +@click.pass_context +def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): + kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, + 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} + + index = 0 + while len(commands) - index > 1: + kwargs[commands[index].replace('--', '')] = commands[index+1] + index += 2 + ctx.invoke(runner_base, **kwargs) + + del ctx.params['commands'] + del ctx.params['pics'] + del ctx.params['additional_pseudo_clusters_directory'] + + return ctx.forward(test_tool) + + +def send_raw_command(command: str, server_path: str, server_arguments: str): + websocket_runner_hooks = WebSocketRunnerLogger() + websocket_runner_config = WebSocketRunnerConfig( + server_path=server_path, server_arguments=server_arguments, hooks=websocket_runner_hooks) + runner = WebSocketRunner(websocket_runner_config) + + async def send_over_websocket(): + payload = None + try: + await runner.start() + payload = await runner.execute(command) + finally: + await runner.stop() + return payload + + payload = asyncio.run(send_over_websocket()) + json_payload = json.loads(payload) + + log_printer = TestColoredLogPrinter() + log_printer.print(MatterLog.decode_logs(json_payload.get('logs'))) + + success = not bool(len([lambda x: x.get('error') for x in json_payload.get('results')])) + return success diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index fc6fcc5c7f2c13..6f901de32ab3d5 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -259,6 +259,49 @@ B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */; }; B2F53AF2245B0DCF0010745E /* MTRSetupPayloadParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2F53AF1245B0DCF0010745E /* MTRSetupPayloadParserTests.m */; }; + B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B45373A92A9FE73400807602 /* WebSocketServer.cpp */; }; + B45373BD2A9FEA9100807602 /* service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B22A9FEA9000807602 /* service.c */; }; + B45373BE2A9FEA9100807602 /* network.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B32A9FEA9000807602 /* network.c */; }; + B45373BF2A9FEA9100807602 /* adopt.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B42A9FEA9000807602 /* adopt.c */; }; + B45373C02A9FEA9100807602 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B52A9FEA9000807602 /* output.c */; }; + B45373C12A9FEA9100807602 /* close.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B62A9FEA9000807602 /* close.c */; }; + B45373C22A9FEA9100807602 /* vhost.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B72A9FEA9000807602 /* vhost.c */; }; + B45373C32A9FEA9100807602 /* wsi.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B82A9FEA9000807602 /* wsi.c */; }; + B45373C42A9FEA9100807602 /* dummy-callback.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B92A9FEA9000807602 /* dummy-callback.c */; }; + B45373C52A9FEA9100807602 /* wsi-timeout.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BA2A9FEA9000807602 /* wsi-timeout.c */; }; + B45373C62A9FEA9100807602 /* sorted-usec-list.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BB2A9FEA9100807602 /* sorted-usec-list.c */; }; + B45373C72A9FEA9100807602 /* pollfd.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BC2A9FEA9100807602 /* pollfd.c */; }; + B45373D12A9FEB0C00807602 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CA2A9FEB0C00807602 /* alloc.c */; }; + B45373D22A9FEB0C00807602 /* buflist.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CB2A9FEB0C00807602 /* buflist.c */; }; + B45373D32A9FEB0C00807602 /* libwebsockets.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CC2A9FEB0C00807602 /* libwebsockets.c */; }; + B45373D42A9FEB0C00807602 /* context.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CD2A9FEB0C00807602 /* context.c */; }; + B45373D52A9FEB0C00807602 /* logs.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CE2A9FEB0C00807602 /* logs.c */; }; + B45373D72A9FEB0C00807602 /* lws_dll2.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373D02A9FEB0C00807602 /* lws_dll2.c */; }; + B45373D92A9FEB3800807602 /* poll.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373D82A9FEB3800807602 /* poll.c */; }; + B45373DC2A9FEB5300807602 /* sha-1.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DA2A9FEB5300807602 /* sha-1.c */; }; + B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DB2A9FEB5300807602 /* base64-decode.c */; }; + B45373DF2A9FEB6F00807602 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DE2A9FEB6F00807602 /* system.c */; }; + B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E02A9FEB7F00807602 /* ops-h1.c */; }; + B45373E52A9FEBA400807602 /* date.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E22A9FEBA400807602 /* date.c */; }; + B45373E62A9FEBA400807602 /* header.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E32A9FEBA400807602 /* header.c */; }; + B45373E72A9FEBA400807602 /* parsers.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E42A9FEBA400807602 /* parsers.c */; }; + B45373E92A9FEBC100807602 /* server.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E82A9FEBC100807602 /* server.c */; }; + B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EA2A9FEBDB00807602 /* ops-listen.c */; }; + B45373ED2A9FEBEC00807602 /* ops-pipe.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EC2A9FEBEC00807602 /* ops-pipe.c */; }; + B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */; }; + B45373F22A9FEC1A00807602 /* ops-ws.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F02A9FEC1A00807602 /* ops-ws.c */; }; + B45373F32A9FEC1A00807602 /* server-ws.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F12A9FEC1A00807602 /* server-ws.c */; }; + B45373FB2A9FEC4F00807602 /* unix-service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F42A9FEC4F00807602 /* unix-service.c */; }; + B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F52A9FEC4F00807602 /* unix-caps.c */; }; + B45373FD2A9FEC4F00807602 /* unix-pipe.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F62A9FEC4F00807602 /* unix-pipe.c */; }; + B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F72A9FEC4F00807602 /* unix-fds.c */; }; + B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F82A9FEC4F00807602 /* unix-misc.c */; }; + B45374002A9FEC4F00807602 /* unix-init.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F92A9FEC4F00807602 /* unix-init.c */; }; + B45374012A9FEC4F00807602 /* unix-sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373FA2A9FEC4F00807602 /* unix-sockets.c */; }; + B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */; }; + B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */; }; + B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */; }; + B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */; }; BA09EB43247477BA00605257 /* libCHIP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA09EB3F2474762900605257 /* libCHIP.a */; }; D4772A46285AE98400383630 /* MTRClusterConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = D4772A45285AE98300383630 /* MTRClusterConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ @@ -581,6 +624,49 @@ B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRSetupPayload.h; sourceTree = ""; }; B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRSetupPayload.mm; sourceTree = ""; }; B2F53AF1245B0DCF0010745E /* MTRSetupPayloadParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRSetupPayloadParserTests.m; sourceTree = ""; }; + B45373A92A9FE73400807602 /* WebSocketServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketServer.cpp; sourceTree = ""; }; + B45373B22A9FEA9000807602 /* service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = service.c; path = "repo/lib/core-net/service.c"; sourceTree = ""; }; + B45373B32A9FEA9000807602 /* network.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = network.c; path = "repo/lib/core-net/network.c"; sourceTree = ""; }; + B45373B42A9FEA9000807602 /* adopt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = adopt.c; path = "repo/lib/core-net/adopt.c"; sourceTree = ""; }; + B45373B52A9FEA9000807602 /* output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = output.c; path = "repo/lib/core-net/output.c"; sourceTree = ""; }; + B45373B62A9FEA9000807602 /* close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = close.c; path = "repo/lib/core-net/close.c"; sourceTree = ""; }; + B45373B72A9FEA9000807602 /* vhost.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vhost.c; path = "repo/lib/core-net/vhost.c"; sourceTree = ""; }; + B45373B82A9FEA9000807602 /* wsi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wsi.c; path = "repo/lib/core-net/wsi.c"; sourceTree = ""; }; + B45373B92A9FEA9000807602 /* dummy-callback.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "dummy-callback.c"; path = "repo/lib/core-net/dummy-callback.c"; sourceTree = ""; }; + B45373BA2A9FEA9000807602 /* wsi-timeout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "wsi-timeout.c"; path = "repo/lib/core-net/wsi-timeout.c"; sourceTree = ""; }; + B45373BB2A9FEA9100807602 /* sorted-usec-list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "sorted-usec-list.c"; path = "repo/lib/core-net/sorted-usec-list.c"; sourceTree = ""; }; + B45373BC2A9FEA9100807602 /* pollfd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pollfd.c; path = "repo/lib/core-net/pollfd.c"; sourceTree = ""; }; + B45373CA2A9FEB0C00807602 /* alloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = alloc.c; path = repo/lib/core/alloc.c; sourceTree = ""; }; + B45373CB2A9FEB0C00807602 /* buflist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = buflist.c; path = repo/lib/core/buflist.c; sourceTree = ""; }; + B45373CC2A9FEB0C00807602 /* libwebsockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = libwebsockets.c; path = repo/lib/core/libwebsockets.c; sourceTree = ""; }; + B45373CD2A9FEB0C00807602 /* context.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = context.c; path = repo/lib/core/context.c; sourceTree = ""; }; + B45373CE2A9FEB0C00807602 /* logs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logs.c; path = repo/lib/core/logs.c; sourceTree = ""; }; + B45373D02A9FEB0C00807602 /* lws_dll2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lws_dll2.c; path = repo/lib/core/lws_dll2.c; sourceTree = ""; }; + B45373D82A9FEB3800807602 /* poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = poll.c; path = "repo/lib/event-libs/poll/poll.c"; sourceTree = ""; }; + B45373DA2A9FEB5300807602 /* sha-1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "sha-1.c"; path = "repo/lib/misc/sha-1.c"; sourceTree = ""; }; + B45373DB2A9FEB5300807602 /* base64-decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "base64-decode.c"; path = "repo/lib/misc/base64-decode.c"; sourceTree = ""; }; + B45373DE2A9FEB6F00807602 /* system.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = system.c; path = repo/lib/system/system.c; sourceTree = ""; }; + B45373E02A9FEB7F00807602 /* ops-h1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-h1.c"; path = "repo/lib/roles/h1/ops-h1.c"; sourceTree = ""; }; + B45373E22A9FEBA400807602 /* date.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = date.c; path = repo/lib/roles/http/date.c; sourceTree = ""; }; + B45373E32A9FEBA400807602 /* header.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = header.c; path = repo/lib/roles/http/header.c; sourceTree = ""; }; + B45373E42A9FEBA400807602 /* parsers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parsers.c; path = repo/lib/roles/http/parsers.c; sourceTree = ""; }; + B45373E82A9FEBC100807602 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = server.c; path = repo/lib/roles/http/server/server.c; sourceTree = ""; }; + B45373EA2A9FEBDB00807602 /* ops-listen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-listen.c"; path = "repo/lib/roles/listen/ops-listen.c"; sourceTree = ""; }; + B45373EC2A9FEBEC00807602 /* ops-pipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-pipe.c"; path = "repo/lib/roles/pipe/ops-pipe.c"; sourceTree = ""; }; + B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-raw-skt.c"; path = "repo/lib/roles/raw-skt/ops-raw-skt.c"; sourceTree = ""; }; + B45373F02A9FEC1A00807602 /* ops-ws.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-ws.c"; path = "repo/lib/roles/ws/ops-ws.c"; sourceTree = ""; }; + B45373F12A9FEC1A00807602 /* server-ws.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "server-ws.c"; path = "repo/lib/roles/ws/server-ws.c"; sourceTree = ""; }; + B45373F42A9FEC4F00807602 /* unix-service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-service.c"; path = "repo/lib/plat/unix/unix-service.c"; sourceTree = ""; }; + B45373F52A9FEC4F00807602 /* unix-caps.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-caps.c"; path = "repo/lib/plat/unix/unix-caps.c"; sourceTree = ""; }; + B45373F62A9FEC4F00807602 /* unix-pipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-pipe.c"; path = "repo/lib/plat/unix/unix-pipe.c"; sourceTree = ""; }; + B45373F72A9FEC4F00807602 /* unix-fds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-fds.c"; path = "repo/lib/plat/unix/unix-fds.c"; sourceTree = ""; }; + B45373F82A9FEC4F00807602 /* unix-misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-misc.c"; path = "repo/lib/plat/unix/unix-misc.c"; sourceTree = ""; }; + B45373F92A9FEC4F00807602 /* unix-init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-init.c"; path = "repo/lib/plat/unix/unix-init.c"; sourceTree = ""; }; + B45373FA2A9FEC4F00807602 /* unix-sockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-sockets.c"; path = "repo/lib/plat/unix/unix-sockets.c"; sourceTree = ""; }; + B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteDataModelLogger.mm; sourceTree = ""; }; + B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteDataModelLogger.h; sourceTree = ""; }; + B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SleepCommand.mm; sourceTree = ""; }; + B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WaitForCommissioneeCommand.mm; sourceTree = ""; }; BA09EB3F2474762900605257 /* libCHIP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCHIP.a; path = lib/libCHIP.a; sourceTree = BUILT_PRODUCTS_DIR; }; BA107AEE2470CFBB004287EB /* chip_xcode_build_connector.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = chip_xcode_build_connector.sh; sourceTree = ""; }; D437613E285BDC0D0051FEA2 /* MTRErrorTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRErrorTestUtils.h; sourceTree = ""; }; @@ -639,6 +725,8 @@ 039546872991C400006D42A8 /* chip-tool */, 037C3D7B2991BD4F00B7EEE2 /* commands */, 037C3DAA2991BD4F00B7EEE2 /* logging */, + B45373AD2A9FE9BF00807602 /* libwebsockets */, + B4551B352A9FE53800331CD1 /* websocket-server */, ); name = "darwin-framework-tool"; path = "../../../examples/darwin-framework-tool"; @@ -647,6 +735,7 @@ 037C3D7B2991BD4F00B7EEE2 /* commands */ = { isa = PBXGroup; children = ( + B4E262182AA0CFFE00DBA5BC /* delay */, 03FB93DA2A46200A0048CB35 /* discover */, 037C3D7C2991BD4F00B7EEE2 /* pairing */, 037C3D852991BD4F00B7EEE2 /* clusters */, @@ -732,6 +821,8 @@ 037C3D9B2991BD4F00B7EEE2 /* common */ = { isa = PBXGroup; children = ( + B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */, + B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */, 037C3D9C2991BD4F00B7EEE2 /* CHIPCommandBridge.mm */, 037C3D9D2991BD4F00B7EEE2 /* CHIPToolKeypair.mm */, 037C3D9E2991BD4F00B7EEE2 /* CHIPToolKeypair.h */, @@ -1173,6 +1264,70 @@ path = CHIPTests; sourceTree = ""; }; + B45373AD2A9FE9BF00807602 /* libwebsockets */ = { + isa = PBXGroup; + children = ( + B45373F52A9FEC4F00807602 /* unix-caps.c */, + B45373F72A9FEC4F00807602 /* unix-fds.c */, + B45373F92A9FEC4F00807602 /* unix-init.c */, + B45373F82A9FEC4F00807602 /* unix-misc.c */, + B45373F62A9FEC4F00807602 /* unix-pipe.c */, + B45373F42A9FEC4F00807602 /* unix-service.c */, + B45373FA2A9FEC4F00807602 /* unix-sockets.c */, + B45373F02A9FEC1A00807602 /* ops-ws.c */, + B45373F12A9FEC1A00807602 /* server-ws.c */, + B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */, + B45373EC2A9FEBEC00807602 /* ops-pipe.c */, + B45373EA2A9FEBDB00807602 /* ops-listen.c */, + B45373E82A9FEBC100807602 /* server.c */, + B45373E22A9FEBA400807602 /* date.c */, + B45373E32A9FEBA400807602 /* header.c */, + B45373E42A9FEBA400807602 /* parsers.c */, + B45373E02A9FEB7F00807602 /* ops-h1.c */, + B45373DE2A9FEB6F00807602 /* system.c */, + B45373DB2A9FEB5300807602 /* base64-decode.c */, + B45373DA2A9FEB5300807602 /* sha-1.c */, + B45373D82A9FEB3800807602 /* poll.c */, + B45373CA2A9FEB0C00807602 /* alloc.c */, + B45373CB2A9FEB0C00807602 /* buflist.c */, + B45373CD2A9FEB0C00807602 /* context.c */, + B45373CC2A9FEB0C00807602 /* libwebsockets.c */, + B45373CE2A9FEB0C00807602 /* logs.c */, + B45373D02A9FEB0C00807602 /* lws_dll2.c */, + B45373B42A9FEA9000807602 /* adopt.c */, + B45373B62A9FEA9000807602 /* close.c */, + B45373B92A9FEA9000807602 /* dummy-callback.c */, + B45373B32A9FEA9000807602 /* network.c */, + B45373B52A9FEA9000807602 /* output.c */, + B45373BC2A9FEA9100807602 /* pollfd.c */, + B45373B22A9FEA9000807602 /* service.c */, + B45373BB2A9FEA9100807602 /* sorted-usec-list.c */, + B45373B72A9FEA9000807602 /* vhost.c */, + B45373BA2A9FEA9000807602 /* wsi-timeout.c */, + B45373B82A9FEA9000807602 /* wsi.c */, + ); + name = libwebsockets; + path = ../../third_party/libwebsockets; + sourceTree = ""; + }; + B4551B352A9FE53800331CD1 /* websocket-server */ = { + isa = PBXGroup; + children = ( + B45373A92A9FE73400807602 /* WebSocketServer.cpp */, + ); + name = "websocket-server"; + path = "../common/websocket-server"; + sourceTree = ""; + }; + B4E262182AA0CFFE00DBA5BC /* delay */ = { + isa = PBXGroup; + children = ( + B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */, + B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */, + ); + path = delay; + sourceTree = ""; + }; BA09EB3E2474762900605257 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -1216,6 +1371,7 @@ 037C3DBD2991BD5000B7EEE2 /* OTAProviderDelegate.h in Headers */, 037C3DB02991BD4F00B7EEE2 /* Commands.h in Headers */, 037C3DC02991BD5100B7EEE2 /* Commands.h in Headers */, + B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */, 037C3DCB2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.h in Headers */, 037C3DD32991BD5200B7EEE2 /* logging.h in Headers */, 037C3DB72991BD5000B7EEE2 /* ModelCommandBridge.h in Headers */, @@ -1468,22 +1624,53 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + B45373C32A9FEA9100807602 /* wsi.c in Sources */, + B45373D42A9FEB0C00807602 /* context.c in Sources */, + B45373D32A9FEB0C00807602 /* libwebsockets.c in Sources */, + B45373C12A9FEA9100807602 /* close.c in Sources */, 039546A62991E151006D42A8 /* InteractionModel.cpp in Sources */, + B45373E72A9FEBA400807602 /* parsers.c in Sources */, + B45373BF2A9FEA9100807602 /* adopt.c in Sources */, + B45373F32A9FEC1A00807602 /* server-ws.c in Sources */, 03F430AA2994113500166449 /* sysunix.c in Sources */, + B45373C42A9FEA9100807602 /* dummy-callback.c in Sources */, 039145E82993179300257B3E /* GetCommissionerNodeIdCommand.mm in Sources */, 0395469F2991DFC5006D42A8 /* json_reader.cpp in Sources */, + B45373D22A9FEB0C00807602 /* buflist.c in Sources */, + B45373D72A9FEB0C00807602 /* lws_dll2.c in Sources */, + B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */, + B45373C72A9FEA9100807602 /* pollfd.c in Sources */, + B45373BE2A9FEA9100807602 /* network.c in Sources */, + B45373BD2A9FEA9100807602 /* service.c in Sources */, 0395469E2991DFC5006D42A8 /* json_writer.cpp in Sources */, 03FB93E02A46200A0048CB35 /* DiscoverCommissionablesCommand.mm in Sources */, + B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */, 037C3DD52991C2E200B7EEE2 /* CHIPCommandBridge.mm in Sources */, 039546BC2991E1CB006D42A8 /* LogCommands.cpp in Sources */, 039547042992D9BF006D42A8 /* ota-provider.cpp in Sources */, 039547022992D952006D42A8 /* privilege-storage.cpp in Sources */, + B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */, + B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */, 0382FA2C2992F06C00247BBB /* Commands.cpp in Sources */, + B45373FD2A9FEC4F00807602 /* unix-pipe.c in Sources */, + B45373C52A9FEA9100807602 /* wsi-timeout.c in Sources */, + B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */, 03F430A7299410C000166449 /* ExamplePersistentStorage.cpp in Sources */, + B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */, + B45373E62A9FEBA400807602 /* header.c in Sources */, + B45374002A9FEC4F00807602 /* unix-init.c in Sources */, + B45373DF2A9FEB6F00807602 /* system.c in Sources */, 039547032992D991006D42A8 /* MTRIMDispatch.mm in Sources */, 039546BD2991E1CB006D42A8 /* SystemCommands.cpp in Sources */, + B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, + B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */, + B45373ED2A9FEBEC00807602 /* ops-pipe.c in Sources */, + B45373C02A9FEA9100807602 /* output.c in Sources */, 0395470F2992DB37006D42A8 /* complete.c in Sources */, 039546BE2991E1CB006D42A8 /* DelayCommands.cpp in Sources */, + B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */, + B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */, + B45373D92A9FEB3800807602 /* poll.c in Sources */, 037C3DC12991BD5100B7EEE2 /* SetupPayloadParseCommand.mm in Sources */, 037C3DBF2991BD5100B7EEE2 /* OTAProviderDelegate.mm in Sources */, 037C3DD02991BD5200B7EEE2 /* InteractiveCommands.mm in Sources */, @@ -1493,17 +1680,28 @@ 039546A12991DFC5006D42A8 /* json_value.cpp in Sources */, 0382FA322992FDCE00247BBB /* MTRFramework.mm in Sources */, 0382FA302992F40C00247BBB /* ComplexArgumentParser.cpp in Sources */, + B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */, 039145E12993102B00257B3E /* main.mm in Sources */, 037C3DD42991BD5200B7EEE2 /* logging.mm in Sources */, + B45374012A9FEC4F00807602 /* unix-sockets.c in Sources */, 03F430A82994112B00166449 /* editline.c in Sources */, + B45373E92A9FEBC100807602 /* server.c in Sources */, 037C3DB32991BD5000B7EEE2 /* OpenCommissioningWindowCommand.mm in Sources */, 037C3DAE2991BD4F00B7EEE2 /* PairingCommandBridge.mm in Sources */, + B45373FB2A9FEC4F00807602 /* unix-service.c in Sources */, + B45373F22A9FEC1A00807602 /* ops-ws.c in Sources */, 037C3DCA2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.mm in Sources */, 037C3DCF2991BD5200B7EEE2 /* MTRError.mm in Sources */, 037C3DC72991BD5100B7EEE2 /* CHIPToolKeypair.mm in Sources */, + B45373E52A9FEBA400807602 /* date.c in Sources */, + B45373DC2A9FEB5300807602 /* sha-1.c in Sources */, + B45373D12A9FEB0C00807602 /* alloc.c in Sources */, + B45373C62A9FEA9100807602 /* sorted-usec-list.c in Sources */, 037C3DB62991BD5000B7EEE2 /* ModelCommandBridge.mm in Sources */, + B45373C22A9FEA9100807602 /* vhost.c in Sources */, 037C3DB42991BD5000B7EEE2 /* DeviceControllerDelegateBridge.mm in Sources */, 039547012992D461006D42A8 /* generic-callback-stubs.cpp in Sources */, + B45373D52A9FEB0C00807602 /* logs.c in Sources */, 0382FA312992FD6E00247BBB /* MTRLogging.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1659,8 +1857,22 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", "$(CHIP_ROOT)/third_party/inipp/repo/inipp", "$(CHIP_ROOT)/third_party/editline/include", + "$(CHIP_ROOT)/third_party/libwebsockets/", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core-net", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/plat/unix", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/secure-streams", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/event-libs", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/metrics", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/http", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/h1", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/ws", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/async-dns", "$(CHIP_ROOT)/examples/chip-tool", "$(CHIP_ROOT)/examples/chip-tool/commands/clusters", + "$(CHIP_ROOT)/examples/common", "$(CHIP_ROOT)/zzz_generated/chip-tool", ); LD_RUNPATH_SEARCH_PATHS = ( @@ -1671,6 +1883,8 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/lib", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); + OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; @@ -1709,6 +1923,19 @@ "$(CHIP_ROOT)/third_party/jsoncpp/repo/include", "$(CHIP_ROOT)/config/ios", "$(CHIP_ROOT)/third_party/editline/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core-net", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/plat/unix", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/secure-streams", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/event-libs", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/metrics", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/http", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/h1", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/ws", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/async-dns", "$(CHIP_ROOT)/src/include", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", "$(SRCROOT)/darwin-framework-tool", @@ -1716,6 +1943,7 @@ "$(CHIP_ROOT)/third_party/editline/include", "$(CHIP_ROOT)/examples/chip-tool/commands/clusters", "$(CHIP_ROOT)/examples/chip-tool", + "$(CHIP_ROOT)/examples/common", "$(CHIP_ROOT)/zzz_generated/chip-tool", ); LD_RUNPATH_SEARCH_PATHS = ( @@ -1726,6 +1954,8 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/lib", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); + OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 83b5c849f16e53..ecdb4adc9b032f 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -191,6 +191,7 @@ class IdentifyIdentify : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -235,17 +236,19 @@ class IdentifyTriggerEffect : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster triggerEffectWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + triggerEffectWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -278,8 +281,11 @@ class ReadIdentifyIdentifyTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify IdentifyTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -319,6 +325,8 @@ class WriteIdentifyIdentifyTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Identify IdentifyTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -363,6 +371,11 @@ class SubscribeAttributeIdentifyIdentifyTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -394,8 +407,11 @@ class ReadIdentifyIdentifyType : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeIdentifyTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify IdentifyType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -437,6 +453,11 @@ class SubscribeAttributeIdentifyIdentifyType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -468,8 +489,11 @@ class ReadIdentifyGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -511,6 +535,11 @@ class SubscribeAttributeIdentifyGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -542,8 +571,11 @@ class ReadIdentifyAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -585,6 +617,11 @@ class SubscribeAttributeIdentifyAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -618,8 +655,11 @@ class ReadIdentifyEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -661,6 +701,11 @@ class SubscribeAttributeIdentifyEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -694,8 +739,11 @@ class ReadIdentifyAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -737,6 +785,11 @@ class SubscribeAttributeIdentifyAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -768,8 +821,11 @@ class ReadIdentifyFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -811,6 +867,11 @@ class SubscribeAttributeIdentifyFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -842,8 +903,11 @@ class ReadIdentifyClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -885,6 +949,11 @@ class SubscribeAttributeIdentifyClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -948,18 +1017,25 @@ class GroupsAddGroup : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster addGroupWithParams:params - completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addGroupWithParams:params + completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Groups::Commands::AddGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Groups::Commands::AddGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -997,18 +1073,27 @@ class GroupsViewGroup : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster viewGroupWithParams:params - completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + viewGroupWithParams:params + completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1059,10 +1144,20 @@ class GroupsGetGroupMembership : public ClusterCommand { completion:^(MTRGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1110,10 +1205,18 @@ class GroupsRemoveGroup : public ClusterCommand { removeGroupWithParams:params completion:^(MTRGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1160,6 +1263,8 @@ class GroupsRemoveAllGroups : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1211,6 +1316,8 @@ class GroupsAddGroupIfIdentifying : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1248,8 +1355,11 @@ class ReadGroupsNameSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNameSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.NameSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups NameSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1291,6 +1401,11 @@ class SubscribeAttributeGroupsNameSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.NameSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1322,8 +1437,11 @@ class ReadGroupsGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1365,6 +1483,11 @@ class SubscribeAttributeGroupsGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1396,8 +1519,11 @@ class ReadGroupsAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1439,6 +1565,11 @@ class SubscribeAttributeGroupsAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1472,8 +1603,11 @@ class ReadGroupsEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1515,6 +1649,11 @@ class SubscribeAttributeGroupsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1548,8 +1687,11 @@ class ReadGroupsAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1591,6 +1733,11 @@ class SubscribeAttributeGroupsAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1622,8 +1769,11 @@ class ReadGroupsFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1665,6 +1815,11 @@ class SubscribeAttributeGroupsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1696,8 +1851,11 @@ class ReadGroupsClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1739,6 +1897,11 @@ class SubscribeAttributeGroupsClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1840,18 +2003,25 @@ class ScenesAddScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster addSceneWithParams:params - completion:^(MTRScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addSceneWithParams:params + completion:^(MTRScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Scenes::Commands::AddSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Scenes::Commands::AddSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1893,18 +2063,27 @@ class ScenesViewScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster viewSceneWithParams:params - completion:^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + viewSceneWithParams:params + completion:^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::ViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::ViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1948,10 +2127,18 @@ class ScenesRemoveScene : public ClusterCommand { removeSceneWithParams:params completion:^(MTRScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1994,19 +2181,29 @@ class ScenesRemoveAllScenes : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeAllScenesWithParams:params - completion:^(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeAllScenesWithParams:params + completion:^( + MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2050,10 +2247,18 @@ class ScenesStoreScene : public ClusterCommand { storeSceneWithParams:params completion:^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::StoreSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::StoreSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2108,17 +2313,19 @@ class ScenesRecallScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster recallSceneWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + recallSceneWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2160,10 +2367,20 @@ class ScenesGetSceneMembership : public ClusterCommand { completion:^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2237,19 +2454,29 @@ class ScenesEnhancedAddScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster enhancedAddSceneWithParams:params - completion:^(MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + enhancedAddSceneWithParams:params + completion:^( + MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2295,10 +2522,20 @@ class ScenesEnhancedViewScene : public ClusterCommand { completion:^(MTRScenesClusterEnhancedViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2349,18 +2586,27 @@ class ScenesCopyScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster copySceneWithParams:params - completion:^(MTRScenesClusterCopySceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + copySceneWithParams:params + completion:^(MTRScenesClusterCopySceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::CopySceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::CopySceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2393,8 +2639,11 @@ class ReadScenesSceneCount : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2436,6 +2685,11 @@ class SubscribeAttributeScenesSceneCount : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2467,8 +2721,11 @@ class ReadScenesCurrentScene : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentSceneWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentScene response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes CurrentScene read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2510,6 +2767,11 @@ class SubscribeAttributeScenesCurrentScene : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentScene response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2541,8 +2803,11 @@ class ReadScenesCurrentGroup : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentGroupWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentGroup response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes CurrentGroup read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2584,6 +2849,11 @@ class SubscribeAttributeScenesCurrentGroup : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentGroup response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2615,8 +2885,11 @@ class ReadScenesSceneValid : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneValidWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneValid response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneValid read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2658,6 +2931,11 @@ class SubscribeAttributeScenesSceneValid : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneValid response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2689,8 +2967,11 @@ class ReadScenesNameSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNameSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.NameSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes NameSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2732,6 +3013,11 @@ class SubscribeAttributeScenesNameSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.NameSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2763,8 +3049,11 @@ class ReadScenesLastConfiguredBy : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLastConfiguredByWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes LastConfiguredBy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2806,6 +3095,11 @@ class SubscribeAttributeScenesLastConfiguredBy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2839,8 +3133,11 @@ class ReadScenesSceneTableSize : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneTableSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneTableSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneTableSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2882,6 +3179,11 @@ class SubscribeAttributeScenesSceneTableSize : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneTableSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2916,8 +3218,11 @@ class ReadScenesRemainingCapacity : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeRemainingCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.RemainingCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes RemainingCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2959,6 +3264,11 @@ class SubscribeAttributeScenesRemainingCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.RemainingCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2992,8 +3302,11 @@ class ReadScenesGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3035,6 +3348,11 @@ class SubscribeAttributeScenesGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3066,8 +3384,11 @@ class ReadScenesAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3109,6 +3430,11 @@ class SubscribeAttributeScenesAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3142,8 +3468,11 @@ class ReadScenesEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3185,6 +3514,11 @@ class SubscribeAttributeScenesEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3218,8 +3552,11 @@ class ReadScenesAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3261,6 +3598,11 @@ class SubscribeAttributeScenesAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3292,8 +3634,11 @@ class ReadScenesFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3335,6 +3680,11 @@ class SubscribeAttributeScenesFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3366,8 +3716,11 @@ class ReadScenesClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3409,6 +3762,11 @@ class SubscribeAttributeScenesClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3476,6 +3834,7 @@ class OnOffOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3521,6 +3880,7 @@ class OnOffOn : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3566,6 +3926,7 @@ class OnOffToggle : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3609,17 +3970,19 @@ class OnOffOffWithEffect : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster offWithEffectWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + offWithEffectWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -3661,6 +4024,8 @@ class OnOffOnWithRecallGlobalScene : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3712,6 +4077,8 @@ class OnOffOnWithTimedOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3749,8 +4116,11 @@ class ReadOnOffOnOff : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnOff response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OnOff read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3792,6 +4162,11 @@ class SubscribeAttributeOnOffOnOff : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnOff response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3823,8 +4198,11 @@ class ReadOnOffGlobalSceneControl : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGlobalSceneControlWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff GlobalSceneControl read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3866,6 +4244,11 @@ class SubscribeAttributeOnOffGlobalSceneControl : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3897,8 +4280,11 @@ class ReadOnOffOnTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOnTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OnTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3938,6 +4324,8 @@ class WriteOnOffOnTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff OnTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3982,6 +4370,11 @@ class SubscribeAttributeOnOffOnTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4013,8 +4406,11 @@ class ReadOnOffOffWaitTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOffWaitTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OffWaitTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OffWaitTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4054,6 +4450,8 @@ class WriteOnOffOffWaitTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff OffWaitTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4098,6 +4496,11 @@ class SubscribeAttributeOnOffOffWaitTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OffWaitTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4129,8 +4532,11 @@ class ReadOnOffStartUpOnOff : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeStartUpOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.StartUpOnOff response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff StartUpOnOff read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4163,13 +4569,18 @@ class WriteOnOffStartUpOnOff : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpOnOffWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff StartUpOnOff write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4177,7 +4588,7 @@ class WriteOnOffStartUpOnOff : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { @@ -4214,6 +4625,11 @@ class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.StartUpOnOff response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4245,8 +4661,11 @@ class ReadOnOffGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4288,6 +4707,11 @@ class SubscribeAttributeOnOffGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4319,8 +4743,11 @@ class ReadOnOffAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4362,6 +4789,11 @@ class SubscribeAttributeOnOffAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4395,8 +4827,11 @@ class ReadOnOffEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4438,6 +4873,11 @@ class SubscribeAttributeOnOffEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4471,8 +4911,11 @@ class ReadOnOffAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4514,6 +4957,11 @@ class SubscribeAttributeOnOffAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4545,8 +4993,11 @@ class ReadOnOffFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4588,6 +5039,11 @@ class SubscribeAttributeOnOffFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4619,8 +5075,11 @@ class ReadOnOffClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4662,6 +5121,11 @@ class SubscribeAttributeOnOffClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4713,8 +5177,11 @@ class ReadOnOffSwitchConfigurationSwitchType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSwitchTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration SwitchType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4758,6 +5225,11 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchType : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4791,8 +5263,11 @@ class ReadOnOffSwitchConfigurationSwitchActions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSwitchActionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration SwitchActions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4834,6 +5309,8 @@ class WriteOnOffSwitchConfigurationSwitchActions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOffSwitchConfiguration SwitchActions write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4880,6 +5357,11 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchActions : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4914,8 +5396,11 @@ class ReadOnOffSwitchConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4959,6 +5444,11 @@ class SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4993,8 +5483,11 @@ class ReadOnOffSwitchConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5038,6 +5531,11 @@ class SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5073,8 +5571,11 @@ class ReadOnOffSwitchConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5118,6 +5619,11 @@ class SubscribeAttributeOnOffSwitchConfigurationEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5153,8 +5659,11 @@ class ReadOnOffSwitchConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5198,6 +5707,11 @@ class SubscribeAttributeOnOffSwitchConfigurationAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5231,8 +5745,11 @@ class ReadOnOffSwitchConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5276,6 +5793,11 @@ class SubscribeAttributeOnOffSwitchConfigurationFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5309,8 +5831,11 @@ class ReadOnOffSwitchConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5354,6 +5879,11 @@ class SubscribeAttributeOnOffSwitchConfigurationClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5441,17 +5971,19 @@ class LevelControlMoveToLevel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToLevelWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5507,6 +6039,7 @@ class LevelControlMove : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5569,6 +6102,7 @@ class LevelControlStep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5621,6 +6155,7 @@ class LevelControlStop : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5681,6 +6216,8 @@ class LevelControlMoveToLevelWithOnOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5735,17 +6272,19 @@ class LevelControlMoveWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5797,17 +6336,19 @@ class LevelControlStepWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stepWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5849,17 +6390,19 @@ class LevelControlStopWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5905,6 +6448,8 @@ class LevelControlMoveToClosestFrequency : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5944,8 +6489,11 @@ class ReadLevelControlCurrentLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl CurrentLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5989,6 +6537,11 @@ class SubscribeAttributeLevelControlCurrentLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6022,8 +6575,11 @@ class ReadLevelControlRemainingTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.RemainingTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl RemainingTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6067,6 +6623,11 @@ class SubscribeAttributeLevelControlRemainingTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.RemainingTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6100,8 +6661,11 @@ class ReadLevelControlMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6145,6 +6709,11 @@ class SubscribeAttributeLevelControlMinLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6178,8 +6747,11 @@ class ReadLevelControlMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6223,6 +6795,11 @@ class SubscribeAttributeLevelControlMaxLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6256,8 +6833,11 @@ class ReadLevelControlCurrentFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl CurrentFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6301,6 +6881,11 @@ class SubscribeAttributeLevelControlCurrentFrequency : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6334,8 +6919,11 @@ class ReadLevelControlMinFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MinFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6379,6 +6967,11 @@ class SubscribeAttributeLevelControlMinFrequency : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6412,8 +7005,11 @@ class ReadLevelControlMaxFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MaxFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6457,6 +7053,11 @@ class SubscribeAttributeLevelControlMaxFrequency : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6490,8 +7091,11 @@ class ReadLevelControlOptions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.Options response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl Options read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6533,6 +7137,8 @@ class WriteLevelControlOptions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl Options write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6579,6 +7185,11 @@ class SubscribeAttributeLevelControlOptions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.Options response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6612,8 +7223,11 @@ class ReadLevelControlOnOffTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnOffTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6655,6 +7269,8 @@ class WriteLevelControlOnOffTransitionTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnOffTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6701,6 +7317,11 @@ class SubscribeAttributeLevelControlOnOffTransitionTime : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6734,8 +7355,11 @@ class ReadLevelControlOnLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6770,13 +7394,18 @@ class WriteLevelControlOnLevel : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnLevelWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6784,7 +7413,7 @@ class WriteLevelControlOnLevel : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { @@ -6823,6 +7452,11 @@ class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6856,8 +7490,11 @@ class ReadLevelControlOnTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6892,13 +7529,18 @@ class WriteLevelControlOnTransitionTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeOnTransitionTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6906,7 +7548,7 @@ class WriteLevelControlOnTransitionTime : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute { @@ -6945,6 +7587,11 @@ class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6978,8 +7625,11 @@ class ReadLevelControlOffTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OffTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7014,13 +7664,18 @@ class WriteLevelControlOffTransitionTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeOffTransitionTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OffTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7028,7 +7683,7 @@ class WriteLevelControlOffTransitionTime : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribute { @@ -7067,6 +7722,11 @@ class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7100,8 +7760,11 @@ class ReadLevelControlDefaultMoveRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl DefaultMoveRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7136,13 +7799,18 @@ class WriteLevelControlDefaultMoveRate : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeDefaultMoveRateWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl DefaultMoveRate write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7150,7 +7818,7 @@ class WriteLevelControlDefaultMoveRate : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute { @@ -7189,6 +7857,11 @@ class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7222,8 +7895,11 @@ class ReadLevelControlStartUpCurrentLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl StartUpCurrentLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7258,13 +7934,18 @@ class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpCurrentLevelWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl StartUpCurrentLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7272,7 +7953,7 @@ class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttribute { @@ -7311,6 +7992,11 @@ class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7344,8 +8030,11 @@ class ReadLevelControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7389,6 +8078,11 @@ class SubscribeAttributeLevelControlGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7422,8 +8116,11 @@ class ReadLevelControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7467,6 +8164,11 @@ class SubscribeAttributeLevelControlAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7502,8 +8204,11 @@ class ReadLevelControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7547,6 +8252,11 @@ class SubscribeAttributeLevelControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7582,8 +8292,11 @@ class ReadLevelControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7627,6 +8340,11 @@ class SubscribeAttributeLevelControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7660,8 +8378,11 @@ class ReadLevelControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7705,6 +8426,11 @@ class SubscribeAttributeLevelControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7738,8 +8464,11 @@ class ReadLevelControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7783,6 +8512,11 @@ class SubscribeAttributeLevelControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7841,8 +8575,11 @@ class ReadBinaryInputBasicActiveText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ActiveText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7886,6 +8623,8 @@ class WriteBinaryInputBasicActiveText : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic ActiveText write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7932,6 +8671,11 @@ class SubscribeAttributeBinaryInputBasicActiveText : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7965,8 +8709,11 @@ class ReadBinaryInputBasicDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8010,6 +8757,8 @@ class WriteBinaryInputBasicDescription : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic Description write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8056,6 +8805,11 @@ class SubscribeAttributeBinaryInputBasicDescription : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8089,8 +8843,11 @@ class ReadBinaryInputBasicInactiveText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInactiveTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic InactiveText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8134,6 +8891,8 @@ class WriteBinaryInputBasicInactiveText : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic InactiveText write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8180,6 +8939,11 @@ class SubscribeAttributeBinaryInputBasicInactiveText : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8213,8 +8977,11 @@ class ReadBinaryInputBasicOutOfService : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutOfServiceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic OutOfService read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8256,6 +9023,8 @@ class WriteBinaryInputBasicOutOfService : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic OutOfService write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8302,6 +9071,11 @@ class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8335,8 +9109,11 @@ class ReadBinaryInputBasicPolarity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePolarityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Polarity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8380,6 +9157,11 @@ class SubscribeAttributeBinaryInputBasicPolarity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8413,8 +9195,11 @@ class ReadBinaryInputBasicPresentValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePresentValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic PresentValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8456,6 +9241,8 @@ class WriteBinaryInputBasicPresentValue : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic PresentValue write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8502,6 +9289,11 @@ class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8535,8 +9327,11 @@ class ReadBinaryInputBasicReliability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReliabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Reliability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8578,6 +9373,8 @@ class WriteBinaryInputBasicReliability : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic Reliability write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8624,6 +9421,11 @@ class SubscribeAttributeBinaryInputBasicReliability : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8657,8 +9459,11 @@ class ReadBinaryInputBasicStatusFlags : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusFlagsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic StatusFlags read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8702,6 +9507,11 @@ class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8735,8 +9545,11 @@ class ReadBinaryInputBasicApplicationType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ApplicationType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8780,6 +9593,11 @@ class SubscribeAttributeBinaryInputBasicApplicationType : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8813,8 +9631,11 @@ class ReadBinaryInputBasicGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8858,6 +9679,11 @@ class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8891,8 +9717,11 @@ class ReadBinaryInputBasicAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8936,6 +9765,11 @@ class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8971,8 +9805,11 @@ class ReadBinaryInputBasicEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9016,6 +9853,11 @@ class SubscribeAttributeBinaryInputBasicEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9051,8 +9893,11 @@ class ReadBinaryInputBasicAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9096,6 +9941,11 @@ class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9129,8 +9979,11 @@ class ReadBinaryInputBasicFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9174,6 +10027,11 @@ class SubscribeAttributeBinaryInputBasicFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9207,8 +10065,11 @@ class ReadBinaryInputBasicClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9252,6 +10113,11 @@ class SubscribeAttributeBinaryInputBasicClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9304,8 +10170,11 @@ class ReadPulseWidthModulationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9349,6 +10218,11 @@ class SubscribeAttributePulseWidthModulationGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9385,8 +10259,11 @@ class ReadPulseWidthModulationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9430,6 +10307,11 @@ class SubscribeAttributePulseWidthModulationAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9466,8 +10348,11 @@ class ReadPulseWidthModulationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9511,6 +10396,11 @@ class SubscribeAttributePulseWidthModulationEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9547,8 +10437,11 @@ class ReadPulseWidthModulationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9592,6 +10485,11 @@ class SubscribeAttributePulseWidthModulationAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9628,8 +10526,11 @@ class ReadPulseWidthModulationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9673,6 +10574,11 @@ class SubscribeAttributePulseWidthModulationFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9709,8 +10615,11 @@ class ReadPulseWidthModulationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9754,6 +10663,11 @@ class SubscribeAttributePulseWidthModulationClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9810,8 +10724,11 @@ class ReadDescriptorDeviceTypeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDeviceTypeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.DeviceTypeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor DeviceTypeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9855,6 +10772,11 @@ class SubscribeAttributeDescriptorDeviceTypeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.DeviceTypeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9888,8 +10810,11 @@ class ReadDescriptorServerList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeServerListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ServerList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ServerList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9933,6 +10858,11 @@ class SubscribeAttributeDescriptorServerList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ServerList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9966,8 +10896,11 @@ class ReadDescriptorClientList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClientListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClientList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ClientList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10011,6 +10944,11 @@ class SubscribeAttributeDescriptorClientList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClientList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10044,8 +10982,11 @@ class ReadDescriptorPartsList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartsListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.PartsList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor PartsList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10089,6 +11030,11 @@ class SubscribeAttributeDescriptorPartsList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.PartsList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10124,8 +11070,11 @@ class ReadDescriptorTagList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTagListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.TagList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor TagList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10169,6 +11118,11 @@ class SubscribeAttributeDescriptorTagList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.TagList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10204,8 +11158,11 @@ class ReadDescriptorGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10249,6 +11206,11 @@ class SubscribeAttributeDescriptorGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10282,8 +11244,11 @@ class ReadDescriptorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10327,6 +11292,11 @@ class SubscribeAttributeDescriptorAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10362,8 +11332,11 @@ class ReadDescriptorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10407,6 +11380,11 @@ class SubscribeAttributeDescriptorEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10442,8 +11420,11 @@ class ReadDescriptorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10487,6 +11468,11 @@ class SubscribeAttributeDescriptorAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10520,8 +11506,11 @@ class ReadDescriptorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10565,6 +11554,11 @@ class SubscribeAttributeDescriptorFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10598,8 +11592,11 @@ class ReadDescriptorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10643,6 +11640,11 @@ class SubscribeAttributeDescriptorClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10696,8 +11698,13 @@ class ReadBindingBinding : public ReadAttribute { [cluster readAttributeBindingWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.Binding response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding Binding read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10768,6 +11775,8 @@ class WriteBindingBinding : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Binding Binding write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10813,6 +11822,11 @@ class SubscribeAttributeBindingBinding : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.Binding response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10844,8 +11858,11 @@ class ReadBindingGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10887,6 +11904,11 @@ class SubscribeAttributeBindingGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10918,8 +11940,11 @@ class ReadBindingAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10961,6 +11986,11 @@ class SubscribeAttributeBindingAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10994,8 +12024,11 @@ class ReadBindingEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11037,6 +12070,11 @@ class SubscribeAttributeBindingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11070,8 +12108,11 @@ class ReadBindingAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11113,6 +12154,11 @@ class SubscribeAttributeBindingAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11144,8 +12190,11 @@ class ReadBindingFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11187,6 +12236,11 @@ class SubscribeAttributeBindingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11218,8 +12272,11 @@ class ReadBindingClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11261,6 +12318,11 @@ class SubscribeAttributeBindingClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11319,14 +12381,19 @@ class ReadAccessControlAcl : public ReadAttribute { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } - [cluster readAttributeACLWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"AccessControl.ACL response %@", [value description]); - if (error != nil) { - LogNSError("AccessControl ACL read Error", error); - } - SetCommandExitStatus(error); - }]; + [cluster + readAttributeACLWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccessControl.ACL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("AccessControl ACL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; return CHIP_NO_ERROR; } }; @@ -11419,6 +12486,8 @@ class WriteAccessControlAcl : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("AccessControl ACL write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11468,6 +12537,11 @@ class SubscribeAttributeAccessControlAcl : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ACL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11506,8 +12580,13 @@ class ReadAccessControlExtension : public ReadAttribute { [cluster readAttributeExtensionWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.Extension response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl Extension read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11561,6 +12640,8 @@ class WriteAccessControlExtension : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("AccessControl Extension write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11610,6 +12691,11 @@ class SubscribeAttributeAccessControlExtension : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.Extension response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11643,8 +12729,11 @@ class ReadAccessControlSubjectsPerAccessControlEntry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSubjectsPerAccessControlEntryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.SubjectsPerAccessControlEntry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl SubjectsPerAccessControlEntry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11688,6 +12777,11 @@ class SubscribeAttributeAccessControlSubjectsPerAccessControlEntry : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.SubjectsPerAccessControlEntry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11721,8 +12815,11 @@ class ReadAccessControlTargetsPerAccessControlEntry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTargetsPerAccessControlEntryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.TargetsPerAccessControlEntry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl TargetsPerAccessControlEntry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11766,6 +12863,11 @@ class SubscribeAttributeAccessControlTargetsPerAccessControlEntry : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.TargetsPerAccessControlEntry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11799,8 +12901,11 @@ class ReadAccessControlAccessControlEntriesPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAccessControlEntriesPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AccessControlEntriesPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AccessControlEntriesPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11844,6 +12949,11 @@ class SubscribeAttributeAccessControlAccessControlEntriesPerFabric : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AccessControlEntriesPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11877,8 +12987,11 @@ class ReadAccessControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11922,6 +13035,11 @@ class SubscribeAttributeAccessControlGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11955,8 +13073,11 @@ class ReadAccessControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12000,6 +13121,11 @@ class SubscribeAttributeAccessControlAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12035,8 +13161,11 @@ class ReadAccessControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12080,6 +13209,11 @@ class SubscribeAttributeAccessControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12115,8 +13249,11 @@ class ReadAccessControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12160,6 +13297,11 @@ class SubscribeAttributeAccessControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12193,8 +13335,11 @@ class ReadAccessControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12238,6 +13383,11 @@ class SubscribeAttributeAccessControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12271,8 +13421,11 @@ class ReadAccessControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12316,6 +13469,11 @@ class SubscribeAttributeAccessControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12391,17 +13549,19 @@ class ActionsInstantAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster instantActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + instantActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12453,6 +13613,8 @@ class ActionsInstantActionWithTransition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12501,17 +13663,19 @@ class ActionsStartAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster startActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + startActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12563,6 +13727,8 @@ class ActionsStartActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12611,17 +13777,19 @@ class ActionsStopAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12665,17 +13833,19 @@ class ActionsPauseAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster pauseActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + pauseActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12727,6 +13897,8 @@ class ActionsPauseActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12775,17 +13947,19 @@ class ActionsResumeAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resumeActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resumeActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12829,17 +14003,19 @@ class ActionsEnableAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster enableActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + enableActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12891,6 +14067,8 @@ class ActionsEnableActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12939,17 +14117,19 @@ class ActionsDisableAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster disableActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + disableActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -13001,6 +14181,8 @@ class ActionsDisableActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -13038,8 +14220,11 @@ class ReadActionsActionList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeActionListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ActionList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions ActionList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13081,6 +14266,11 @@ class SubscribeAttributeActionsActionList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ActionList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13112,8 +14302,11 @@ class ReadActionsEndpointLists : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEndpointListsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EndpointLists response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions EndpointLists read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13155,6 +14348,11 @@ class SubscribeAttributeActionsEndpointLists : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EndpointLists response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13186,8 +14384,11 @@ class ReadActionsSetupURL : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSetupURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.SetupURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions SetupURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13229,6 +14430,11 @@ class SubscribeAttributeActionsSetupURL : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.SetupURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13260,8 +14466,11 @@ class ReadActionsGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13303,6 +14512,11 @@ class SubscribeAttributeActionsGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13334,8 +14548,11 @@ class ReadActionsAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13377,6 +14594,11 @@ class SubscribeAttributeActionsAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13410,8 +14632,11 @@ class ReadActionsEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13453,6 +14678,11 @@ class SubscribeAttributeActionsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13486,8 +14716,11 @@ class ReadActionsAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13529,6 +14762,11 @@ class SubscribeAttributeActionsAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13560,8 +14798,11 @@ class ReadActionsFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13603,6 +14844,11 @@ class SubscribeAttributeActionsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13634,8 +14880,11 @@ class ReadActionsClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13677,6 +14926,11 @@ class SubscribeAttributeActionsClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13752,8 +15006,11 @@ class ReadBasicInformationDataModelRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDataModelRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.DataModelRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation DataModelRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13797,6 +15054,11 @@ class SubscribeAttributeBasicInformationDataModelRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.DataModelRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13830,8 +15092,11 @@ class ReadBasicInformationVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13875,6 +15140,11 @@ class SubscribeAttributeBasicInformationVendorName : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13908,8 +15178,11 @@ class ReadBasicInformationVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13953,6 +15226,11 @@ class SubscribeAttributeBasicInformationVendorID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13986,8 +15264,11 @@ class ReadBasicInformationProductName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14031,6 +15312,11 @@ class SubscribeAttributeBasicInformationProductName : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14064,8 +15350,11 @@ class ReadBasicInformationProductID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14109,6 +15398,11 @@ class SubscribeAttributeBasicInformationProductID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14142,8 +15436,11 @@ class ReadBasicInformationNodeLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNodeLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.NodeLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation NodeLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14187,6 +15484,8 @@ class WriteBasicInformationNodeLabel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation NodeLabel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14233,6 +15532,11 @@ class SubscribeAttributeBasicInformationNodeLabel : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.NodeLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14266,8 +15570,11 @@ class ReadBasicInformationLocation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Location response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation Location read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14311,6 +15618,8 @@ class WriteBasicInformationLocation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation Location write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14357,6 +15666,11 @@ class SubscribeAttributeBasicInformationLocation : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Location response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14390,8 +15704,11 @@ class ReadBasicInformationHardwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation HardwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14435,6 +15752,11 @@ class SubscribeAttributeBasicInformationHardwareVersion : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14468,8 +15790,11 @@ class ReadBasicInformationHardwareVersionString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation HardwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14513,6 +15838,11 @@ class SubscribeAttributeBasicInformationHardwareVersionString : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14546,8 +15876,11 @@ class ReadBasicInformationSoftwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SoftwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14591,6 +15924,11 @@ class SubscribeAttributeBasicInformationSoftwareVersion : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14624,8 +15962,11 @@ class ReadBasicInformationSoftwareVersionString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SoftwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14669,6 +16010,11 @@ class SubscribeAttributeBasicInformationSoftwareVersionString : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14702,8 +16048,11 @@ class ReadBasicInformationManufacturingDate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeManufacturingDateWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ManufacturingDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ManufacturingDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14747,6 +16096,11 @@ class SubscribeAttributeBasicInformationManufacturingDate : public SubscribeAttr } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ManufacturingDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14780,8 +16134,11 @@ class ReadBasicInformationPartNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.PartNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation PartNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14825,6 +16182,11 @@ class SubscribeAttributeBasicInformationPartNumber : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.PartNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14858,8 +16220,11 @@ class ReadBasicInformationProductURL : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14903,6 +16268,11 @@ class SubscribeAttributeBasicInformationProductURL : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14936,8 +16306,11 @@ class ReadBasicInformationProductLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14981,6 +16354,11 @@ class SubscribeAttributeBasicInformationProductLabel : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15014,8 +16392,11 @@ class ReadBasicInformationSerialNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSerialNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SerialNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SerialNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15059,6 +16440,11 @@ class SubscribeAttributeBasicInformationSerialNumber : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15092,8 +16478,11 @@ class ReadBasicInformationLocalConfigDisabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalConfigDisabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.LocalConfigDisabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation LocalConfigDisabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15135,6 +16524,8 @@ class WriteBasicInformationLocalConfigDisabled : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation LocalConfigDisabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15181,6 +16572,11 @@ class SubscribeAttributeBasicInformationLocalConfigDisabled : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.LocalConfigDisabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15214,8 +16610,11 @@ class ReadBasicInformationReachable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReachableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Reachable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation Reachable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15259,6 +16658,11 @@ class SubscribeAttributeBasicInformationReachable : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Reachable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15292,8 +16696,11 @@ class ReadBasicInformationUniqueID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUniqueIDWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.UniqueID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation UniqueID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15337,6 +16744,11 @@ class SubscribeAttributeBasicInformationUniqueID : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.UniqueID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15371,8 +16783,11 @@ class ReadBasicInformationCapabilityMinima : public ReadAttribute { [cluster readAttributeCapabilityMinimaWithCompletion:^( MTRBasicInformationClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.CapabilityMinima response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation CapabilityMinima read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15416,6 +16831,11 @@ class SubscribeAttributeBasicInformationCapabilityMinima : public SubscribeAttri } reportHandler:^(MTRBasicInformationClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.CapabilityMinima response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15450,8 +16870,11 @@ class ReadBasicInformationProductAppearance : public ReadAttribute { [cluster readAttributeProductAppearanceWithCompletion:^( MTRBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductAppearance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductAppearance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15495,6 +16918,11 @@ class SubscribeAttributeBasicInformationProductAppearance : public SubscribeAttr } reportHandler:^(MTRBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductAppearance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15528,8 +16956,11 @@ class ReadBasicInformationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15573,6 +17004,11 @@ class SubscribeAttributeBasicInformationGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15606,8 +17042,11 @@ class ReadBasicInformationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15651,6 +17090,11 @@ class SubscribeAttributeBasicInformationAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15686,8 +17130,11 @@ class ReadBasicInformationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15731,6 +17178,11 @@ class SubscribeAttributeBasicInformationEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15766,8 +17218,11 @@ class ReadBasicInformationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15811,6 +17266,11 @@ class SubscribeAttributeBasicInformationAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15844,8 +17304,11 @@ class ReadBasicInformationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15889,6 +17352,11 @@ class SubscribeAttributeBasicInformationFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15922,8 +17390,11 @@ class ReadBasicInformationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15967,6 +17438,11 @@ class SubscribeAttributeBasicInformationClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16066,19 +17542,28 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster queryImageWithParams:params - completion:^(MTROTASoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + queryImageWithParams:params + completion:^(MTROTASoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -16122,19 +17607,30 @@ class OtaSoftwareUpdateProviderApplyUpdateRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster applyUpdateRequestWithParams:params - completion:^(MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + applyUpdateRequestWithParams:params + completion:^(MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -16182,6 +17678,8 @@ class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -16222,8 +17720,11 @@ class ReadOtaSoftwareUpdateProviderGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16268,6 +17769,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderGeneratedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16302,8 +17808,11 @@ class ReadOtaSoftwareUpdateProviderAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16347,6 +17856,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderAcceptedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16382,8 +17896,11 @@ class ReadOtaSoftwareUpdateProviderEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16427,6 +17944,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderEventList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16462,8 +17984,11 @@ class ReadOtaSoftwareUpdateProviderAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16507,6 +18032,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderAttributeList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16540,8 +18070,11 @@ class ReadOtaSoftwareUpdateProviderFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16585,6 +18118,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderFeatureMap : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16618,8 +18156,11 @@ class ReadOtaSoftwareUpdateProviderClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16663,6 +18204,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16744,6 +18290,8 @@ class OtaSoftwareUpdateRequestorAnnounceOTAProvider : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -16791,8 +18339,13 @@ class ReadOtaSoftwareUpdateRequestorDefaultOTAProviders : public ReadAttribute { completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.DefaultOTAProviders response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor DefaultOTAProviders read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16849,6 +18402,8 @@ class WriteOtaSoftwareUpdateRequestorDefaultOTAProviders : public WriteAttribute completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OTASoftwareUpdateRequestor DefaultOTAProviders write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16899,6 +18454,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOTAProviders : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.DefaultOTAProviders response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16932,8 +18492,11 @@ class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdatePossibleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdatePossible response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdatePossible read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16977,6 +18540,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdatePossible response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17010,8 +18578,11 @@ class ReadOtaSoftwareUpdateRequestorUpdateState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdateStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdateState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17055,6 +18626,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17089,8 +18665,11 @@ class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdateStateProgressWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdateStateProgress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17135,6 +18714,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17169,8 +18753,11 @@ class ReadOtaSoftwareUpdateRequestorGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17215,6 +18802,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17249,8 +18841,11 @@ class ReadOtaSoftwareUpdateRequestorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17295,6 +18890,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17330,8 +18930,11 @@ class ReadOtaSoftwareUpdateRequestorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17375,6 +18978,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17410,8 +19018,11 @@ class ReadOtaSoftwareUpdateRequestorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17455,6 +19066,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17488,8 +19104,11 @@ class ReadOtaSoftwareUpdateRequestorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17533,6 +19152,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17566,8 +19190,11 @@ class ReadOtaSoftwareUpdateRequestorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17611,6 +19238,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17662,8 +19294,11 @@ class ReadLocalizationConfigurationActiveLocale : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveLocaleWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration ActiveLocale read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17707,6 +19342,8 @@ class WriteLocalizationConfigurationActiveLocale : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LocalizationConfiguration ActiveLocale write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17753,6 +19390,11 @@ class SubscribeAttributeLocalizationConfigurationActiveLocale : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17786,8 +19428,11 @@ class ReadLocalizationConfigurationSupportedLocales : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedLocalesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration SupportedLocales read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17831,6 +19476,11 @@ class SubscribeAttributeLocalizationConfigurationSupportedLocales : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17865,8 +19515,11 @@ class ReadLocalizationConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17911,6 +19564,11 @@ class SubscribeAttributeLocalizationConfigurationGeneratedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17945,8 +19603,11 @@ class ReadLocalizationConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17990,6 +19651,11 @@ class SubscribeAttributeLocalizationConfigurationAcceptedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18025,8 +19691,11 @@ class ReadLocalizationConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18070,6 +19739,11 @@ class SubscribeAttributeLocalizationConfigurationEventList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18105,8 +19779,11 @@ class ReadLocalizationConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18150,6 +19827,11 @@ class SubscribeAttributeLocalizationConfigurationAttributeList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18183,8 +19865,11 @@ class ReadLocalizationConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18228,6 +19913,11 @@ class SubscribeAttributeLocalizationConfigurationFeatureMap : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18261,8 +19951,11 @@ class ReadLocalizationConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18306,6 +19999,11 @@ class SubscribeAttributeLocalizationConfigurationClusterRevision : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18358,8 +20056,11 @@ class ReadTimeFormatLocalizationHourFormat : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHourFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.HourFormat response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization HourFormat read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18401,6 +20102,8 @@ class WriteTimeFormatLocalizationHourFormat : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("TimeFormatLocalization HourFormat write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18447,6 +20150,11 @@ class SubscribeAttributeTimeFormatLocalizationHourFormat : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.HourFormat response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18480,8 +20188,11 @@ class ReadTimeFormatLocalizationActiveCalendarType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCalendarTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ActiveCalendarType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization ActiveCalendarType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18523,6 +20234,8 @@ class WriteTimeFormatLocalizationActiveCalendarType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("TimeFormatLocalization ActiveCalendarType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18569,6 +20282,11 @@ class SubscribeAttributeTimeFormatLocalizationActiveCalendarType : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ActiveCalendarType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18603,8 +20321,11 @@ class ReadTimeFormatLocalizationSupportedCalendarTypes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedCalendarTypesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.SupportedCalendarTypes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization SupportedCalendarTypes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18648,6 +20369,11 @@ class SubscribeAttributeTimeFormatLocalizationSupportedCalendarTypes : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.SupportedCalendarTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18681,8 +20407,11 @@ class ReadTimeFormatLocalizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18726,6 +20455,11 @@ class SubscribeAttributeTimeFormatLocalizationGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18759,8 +20493,11 @@ class ReadTimeFormatLocalizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18804,6 +20541,11 @@ class SubscribeAttributeTimeFormatLocalizationAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18839,8 +20581,11 @@ class ReadTimeFormatLocalizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18884,6 +20629,11 @@ class SubscribeAttributeTimeFormatLocalizationEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18919,8 +20669,11 @@ class ReadTimeFormatLocalizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18964,6 +20717,11 @@ class SubscribeAttributeTimeFormatLocalizationAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18997,8 +20755,11 @@ class ReadTimeFormatLocalizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19042,6 +20803,11 @@ class SubscribeAttributeTimeFormatLocalizationFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19075,8 +20841,11 @@ class ReadTimeFormatLocalizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19120,6 +20889,11 @@ class SubscribeAttributeTimeFormatLocalizationClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19170,8 +20944,11 @@ class ReadUnitLocalizationTemperatureUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.TemperatureUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization TemperatureUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19213,6 +20990,8 @@ class WriteUnitLocalizationTemperatureUnit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitLocalization TemperatureUnit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19259,6 +21038,11 @@ class SubscribeAttributeUnitLocalizationTemperatureUnit : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.TemperatureUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19292,8 +21076,11 @@ class ReadUnitLocalizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19337,6 +21124,11 @@ class SubscribeAttributeUnitLocalizationGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19370,8 +21162,11 @@ class ReadUnitLocalizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19415,6 +21210,11 @@ class SubscribeAttributeUnitLocalizationAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19450,8 +21250,11 @@ class ReadUnitLocalizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19495,6 +21298,11 @@ class SubscribeAttributeUnitLocalizationEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19530,8 +21338,11 @@ class ReadUnitLocalizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19575,6 +21386,11 @@ class SubscribeAttributeUnitLocalizationAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19608,8 +21424,11 @@ class ReadUnitLocalizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19653,6 +21472,11 @@ class SubscribeAttributeUnitLocalizationFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19686,8 +21510,11 @@ class ReadUnitLocalizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19731,6 +21558,11 @@ class SubscribeAttributeUnitLocalizationClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19781,8 +21613,11 @@ class ReadPowerSourceConfigurationSources : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSourcesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration Sources read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19826,6 +21661,11 @@ class SubscribeAttributePowerSourceConfigurationSources : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19860,8 +21700,11 @@ class ReadPowerSourceConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19905,6 +21748,11 @@ class SubscribeAttributePowerSourceConfigurationGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19939,8 +21787,11 @@ class ReadPowerSourceConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19984,6 +21835,11 @@ class SubscribeAttributePowerSourceConfigurationAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20019,8 +21875,11 @@ class ReadPowerSourceConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20064,6 +21923,11 @@ class SubscribeAttributePowerSourceConfigurationEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20099,8 +21963,11 @@ class ReadPowerSourceConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20144,6 +22011,11 @@ class SubscribeAttributePowerSourceConfigurationAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20177,8 +22049,11 @@ class ReadPowerSourceConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20222,6 +22097,11 @@ class SubscribeAttributePowerSourceConfigurationFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20255,8 +22135,11 @@ class ReadPowerSourceConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20300,6 +22183,11 @@ class SubscribeAttributePowerSourceConfigurationClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20384,8 +22272,11 @@ class ReadPowerSourceStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Status response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Status read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20429,6 +22320,11 @@ class SubscribeAttributePowerSourceStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Status response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20462,8 +22358,11 @@ class ReadPowerSourceOrder : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOrderWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Order response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Order read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20507,6 +22406,11 @@ class SubscribeAttributePowerSourceOrder : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Order response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20540,8 +22444,11 @@ class ReadPowerSourceDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20585,6 +22492,11 @@ class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20618,8 +22530,11 @@ class ReadPowerSourceWiredAssessedInputVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedInputVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedInputVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20663,6 +22578,11 @@ class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20696,8 +22616,11 @@ class ReadPowerSourceWiredAssessedInputFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedInputFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedInputFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20741,6 +22664,11 @@ class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20774,8 +22702,11 @@ class ReadPowerSourceWiredCurrentType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredCurrentTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredCurrentType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20819,6 +22750,11 @@ class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20852,8 +22788,11 @@ class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20897,6 +22836,11 @@ class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20930,8 +22874,11 @@ class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredNominalVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredNominalVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20975,6 +22922,11 @@ class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21008,8 +22960,11 @@ class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredMaximumCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredMaximumCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21053,6 +23008,11 @@ class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21086,8 +23046,11 @@ class ReadPowerSourceWiredPresent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredPresentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredPresent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredPresent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21131,6 +23094,11 @@ class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredPresent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21164,8 +23132,11 @@ class ReadPowerSourceActiveWiredFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveWiredFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveWiredFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21209,6 +23180,11 @@ class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21242,8 +23218,11 @@ class ReadPowerSourceBatVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21287,6 +23266,11 @@ class SubscribeAttributePowerSourceBatVoltage : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21320,8 +23304,11 @@ class ReadPowerSourceBatPercentRemaining : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatPercentRemainingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPercentRemaining response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatPercentRemaining read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21365,6 +23352,11 @@ class SubscribeAttributePowerSourceBatPercentRemaining : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPercentRemaining response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21398,8 +23390,11 @@ class ReadPowerSourceBatTimeRemaining : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatTimeRemainingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeRemaining response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatTimeRemaining read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21443,6 +23438,11 @@ class SubscribeAttributePowerSourceBatTimeRemaining : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeRemaining response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21476,8 +23476,11 @@ class ReadPowerSourceBatChargeLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21521,6 +23524,11 @@ class SubscribeAttributePowerSourceBatChargeLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21554,8 +23562,11 @@ class ReadPowerSourceBatReplacementNeeded : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplacementNeededWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementNeeded response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplacementNeeded read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21599,6 +23610,11 @@ class SubscribeAttributePowerSourceBatReplacementNeeded : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementNeeded response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21632,8 +23648,11 @@ class ReadPowerSourceBatReplaceability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplaceabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplaceability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplaceability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21677,6 +23696,11 @@ class SubscribeAttributePowerSourceBatReplaceability : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplaceability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21710,8 +23734,11 @@ class ReadPowerSourceBatPresent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatPresentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPresent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatPresent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21755,6 +23782,11 @@ class SubscribeAttributePowerSourceBatPresent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPresent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21788,8 +23820,11 @@ class ReadPowerSourceActiveBatFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveBatFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveBatFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21833,6 +23868,11 @@ class SubscribeAttributePowerSourceActiveBatFaults : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21866,8 +23906,11 @@ class ReadPowerSourceBatReplacementDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplacementDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementDescription response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplacementDescription read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21911,6 +23954,11 @@ class SubscribeAttributePowerSourceBatReplacementDescription : public SubscribeA } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementDescription response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21944,8 +23992,11 @@ class ReadPowerSourceBatCommonDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatCommonDesignationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCommonDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatCommonDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21989,6 +24040,11 @@ class SubscribeAttributePowerSourceBatCommonDesignation : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCommonDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22022,8 +24078,11 @@ class ReadPowerSourceBatANSIDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatANSIDesignationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatANSIDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatANSIDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22067,6 +24126,11 @@ class SubscribeAttributePowerSourceBatANSIDesignation : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatANSIDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22100,8 +24164,11 @@ class ReadPowerSourceBatIECDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatIECDesignationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatIECDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatIECDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22145,6 +24212,11 @@ class SubscribeAttributePowerSourceBatIECDesignation : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatIECDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22178,8 +24250,11 @@ class ReadPowerSourceBatApprovedChemistry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatApprovedChemistryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatApprovedChemistry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatApprovedChemistry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22223,6 +24298,11 @@ class SubscribeAttributePowerSourceBatApprovedChemistry : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatApprovedChemistry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22256,8 +24336,11 @@ class ReadPowerSourceBatCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22301,6 +24384,11 @@ class SubscribeAttributePowerSourceBatCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22334,8 +24422,11 @@ class ReadPowerSourceBatQuantity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatQuantityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatQuantity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatQuantity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22379,6 +24470,11 @@ class SubscribeAttributePowerSourceBatQuantity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatQuantity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22412,8 +24508,11 @@ class ReadPowerSourceBatChargeState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargeState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22457,6 +24556,11 @@ class SubscribeAttributePowerSourceBatChargeState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22490,8 +24594,11 @@ class ReadPowerSourceBatTimeToFullCharge : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatTimeToFullChargeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeToFullCharge response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatTimeToFullCharge read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22535,6 +24642,11 @@ class SubscribeAttributePowerSourceBatTimeToFullCharge : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeToFullCharge response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22568,8 +24680,11 @@ class ReadPowerSourceBatFunctionalWhileCharging : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatFunctionalWhileChargingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatFunctionalWhileCharging response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatFunctionalWhileCharging read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22613,6 +24728,11 @@ class SubscribeAttributePowerSourceBatFunctionalWhileCharging : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatFunctionalWhileCharging response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22646,8 +24766,11 @@ class ReadPowerSourceBatChargingCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargingCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargingCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargingCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22691,6 +24814,11 @@ class SubscribeAttributePowerSourceBatChargingCurrent : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargingCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22724,8 +24852,11 @@ class ReadPowerSourceActiveBatChargeFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveBatChargeFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatChargeFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveBatChargeFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22769,6 +24900,11 @@ class SubscribeAttributePowerSourceActiveBatChargeFaults : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatChargeFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22804,8 +24940,11 @@ class ReadPowerSourceEndpointList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndpointListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EndpointList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource EndpointList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22849,6 +24988,11 @@ class SubscribeAttributePowerSourceEndpointList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EndpointList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22884,8 +25028,11 @@ class ReadPowerSourceGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22929,6 +25076,11 @@ class SubscribeAttributePowerSourceGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22962,8 +25114,11 @@ class ReadPowerSourceAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23007,6 +25162,11 @@ class SubscribeAttributePowerSourceAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23042,8 +25202,11 @@ class ReadPowerSourceEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23087,6 +25250,11 @@ class SubscribeAttributePowerSourceEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23122,8 +25290,11 @@ class ReadPowerSourceAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23167,6 +25338,11 @@ class SubscribeAttributePowerSourceAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23200,8 +25376,11 @@ class ReadPowerSourceFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23245,6 +25424,11 @@ class SubscribeAttributePowerSourceFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23278,8 +25462,11 @@ class ReadPowerSourceClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23323,6 +25510,11 @@ class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23387,19 +25579,28 @@ class GeneralCommissioningArmFailSafe : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster armFailSafeWithParams:params - completion:^(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + armFailSafeWithParams:params + completion:^(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -23450,10 +25651,20 @@ class GeneralCommissioningSetRegulatoryConfig : public ClusterCommand { completion:^(MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::SetRegulatoryConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::SetRegulatoryConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -23501,10 +25712,20 @@ class GeneralCommissioningCommissioningComplete : public ClusterCommand { MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::CommissioningCompleteResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::CommissioningCompleteResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -23543,8 +25764,11 @@ class ReadGeneralCommissioningBreadcrumb : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBreadcrumbWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning Breadcrumb read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23586,6 +25810,8 @@ class WriteGeneralCommissioningBreadcrumb : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("GeneralCommissioning Breadcrumb write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23632,6 +25858,11 @@ class SubscribeAttributeGeneralCommissioningBreadcrumb : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23666,8 +25897,11 @@ class ReadGeneralCommissioningBasicCommissioningInfo : public ReadAttribute { [cluster readAttributeBasicCommissioningInfoWithCompletion:^( MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning BasicCommissioningInfo read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23711,6 +25945,11 @@ class SubscribeAttributeGeneralCommissioningBasicCommissioningInfo : public Subs } reportHandler:^(MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23744,8 +25983,11 @@ class ReadGeneralCommissioningRegulatoryConfig : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRegulatoryConfigWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning RegulatoryConfig read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23789,6 +26031,11 @@ class SubscribeAttributeGeneralCommissioningRegulatoryConfig : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23822,8 +26069,11 @@ class ReadGeneralCommissioningLocationCapability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocationCapabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning LocationCapability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23867,6 +26117,11 @@ class SubscribeAttributeGeneralCommissioningLocationCapability : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23901,8 +26156,11 @@ class ReadGeneralCommissioningSupportsConcurrentConnection : public ReadAttribut queue:callbackQueue]; [cluster readAttributeSupportsConcurrentConnectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning SupportsConcurrentConnection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23947,6 +26205,11 @@ class SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23980,8 +26243,11 @@ class ReadGeneralCommissioningGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24025,6 +26291,11 @@ class SubscribeAttributeGeneralCommissioningGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24058,8 +26329,11 @@ class ReadGeneralCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24103,6 +26377,11 @@ class SubscribeAttributeGeneralCommissioningAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24138,8 +26417,11 @@ class ReadGeneralCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24183,6 +26465,11 @@ class SubscribeAttributeGeneralCommissioningEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24218,8 +26505,11 @@ class ReadGeneralCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24263,6 +26553,11 @@ class SubscribeAttributeGeneralCommissioningAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24296,8 +26591,11 @@ class ReadGeneralCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24341,6 +26639,11 @@ class SubscribeAttributeGeneralCommissioningFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24374,8 +26677,11 @@ class ReadGeneralCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24419,6 +26725,11 @@ class SubscribeAttributeGeneralCommissioningClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24502,19 +26813,28 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster scanNetworksWithParams:params - completion:^(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + scanNetworksWithParams:params + completion:^(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24567,10 +26887,20 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -24627,10 +26957,20 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::NetworkCommissioning:: + Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::NetworkCommissioning:: + Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -24681,19 +27021,29 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24739,19 +27089,29 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster connectNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + connectNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24799,19 +27159,29 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster reorderNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + reorderNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24846,8 +27216,11 @@ class ReadNetworkCommissioningMaxNetworks : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxNetworksWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning MaxNetworks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24891,6 +27264,11 @@ class SubscribeAttributeNetworkCommissioningMaxNetworks : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24924,8 +27302,11 @@ class ReadNetworkCommissioningNetworks : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworksWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.Networks response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning Networks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24969,6 +27350,11 @@ class SubscribeAttributeNetworkCommissioningNetworks : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.Networks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25002,8 +27388,11 @@ class ReadNetworkCommissioningScanMaxTimeSeconds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScanMaxTimeSecondsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ScanMaxTimeSeconds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25047,6 +27436,11 @@ class SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25080,8 +27474,11 @@ class ReadNetworkCommissioningConnectMaxTimeSeconds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConnectMaxTimeSecondsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ConnectMaxTimeSeconds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25125,6 +27522,11 @@ class SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25158,8 +27560,11 @@ class ReadNetworkCommissioningInterfaceEnabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterfaceEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning InterfaceEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25201,6 +27606,8 @@ class WriteNetworkCommissioningInterfaceEnabled : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("NetworkCommissioning InterfaceEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25247,6 +27654,11 @@ class SubscribeAttributeNetworkCommissioningInterfaceEnabled : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25280,8 +27692,11 @@ class ReadNetworkCommissioningLastNetworkingStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastNetworkingStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastNetworkingStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25325,6 +27740,11 @@ class SubscribeAttributeNetworkCommissioningLastNetworkingStatus : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25358,8 +27778,11 @@ class ReadNetworkCommissioningLastNetworkID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastNetworkIDWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastNetworkID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25403,6 +27826,11 @@ class SubscribeAttributeNetworkCommissioningLastNetworkID : public SubscribeAttr } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25436,8 +27864,11 @@ class ReadNetworkCommissioningLastConnectErrorValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastConnectErrorValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastConnectErrorValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25481,6 +27912,11 @@ class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25514,8 +27950,11 @@ class ReadNetworkCommissioningGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25559,6 +27998,11 @@ class SubscribeAttributeNetworkCommissioningGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25592,8 +28036,11 @@ class ReadNetworkCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25637,6 +28084,11 @@ class SubscribeAttributeNetworkCommissioningAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25672,8 +28124,11 @@ class ReadNetworkCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25717,6 +28172,11 @@ class SubscribeAttributeNetworkCommissioningEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25752,8 +28212,11 @@ class ReadNetworkCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25797,6 +28260,11 @@ class SubscribeAttributeNetworkCommissioningAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25830,8 +28298,11 @@ class ReadNetworkCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25875,6 +28346,11 @@ class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25908,8 +28384,11 @@ class ReadNetworkCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25953,6 +28432,11 @@ class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26022,10 +28506,20 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand { completion:^(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -26065,8 +28559,11 @@ class ReadDiagnosticLogsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26110,6 +28607,11 @@ class SubscribeAttributeDiagnosticLogsGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26143,8 +28645,11 @@ class ReadDiagnosticLogsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26188,6 +28693,11 @@ class SubscribeAttributeDiagnosticLogsAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26223,8 +28733,11 @@ class ReadDiagnosticLogsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26268,6 +28781,11 @@ class SubscribeAttributeDiagnosticLogsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26303,8 +28821,11 @@ class ReadDiagnosticLogsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26348,6 +28869,11 @@ class SubscribeAttributeDiagnosticLogsAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26381,8 +28907,11 @@ class ReadDiagnosticLogsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26426,6 +28955,11 @@ class SubscribeAttributeDiagnosticLogsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26459,8 +28993,11 @@ class ReadDiagnosticLogsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26504,6 +29041,11 @@ class SubscribeAttributeDiagnosticLogsClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26580,6 +29122,8 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -26619,8 +29163,11 @@ class ReadGeneralDiagnosticsNetworkInterfaces : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworkInterfacesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics NetworkInterfaces read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26664,6 +29211,11 @@ class SubscribeAttributeGeneralDiagnosticsNetworkInterfaces : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26697,8 +29249,11 @@ class ReadGeneralDiagnosticsRebootCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRebootCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics RebootCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26742,6 +29297,11 @@ class SubscribeAttributeGeneralDiagnosticsRebootCount : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26775,8 +29335,11 @@ class ReadGeneralDiagnosticsUpTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics UpTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26820,6 +29383,11 @@ class SubscribeAttributeGeneralDiagnosticsUpTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26853,8 +29421,11 @@ class ReadGeneralDiagnosticsTotalOperationalHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalOperationalHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics TotalOperationalHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26898,6 +29469,11 @@ class SubscribeAttributeGeneralDiagnosticsTotalOperationalHours : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26931,8 +29507,11 @@ class ReadGeneralDiagnosticsBootReason : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBootReasonWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.BootReason response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics BootReason read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26976,6 +29555,11 @@ class SubscribeAttributeGeneralDiagnosticsBootReason : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.BootReason response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27009,8 +29593,11 @@ class ReadGeneralDiagnosticsActiveHardwareFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveHardwareFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveHardwareFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27054,6 +29641,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27087,8 +29679,11 @@ class ReadGeneralDiagnosticsActiveRadioFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveRadioFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveRadioFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27132,6 +29727,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveRadioFaults : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27165,8 +29765,11 @@ class ReadGeneralDiagnosticsActiveNetworkFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveNetworkFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveNetworkFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27210,6 +29813,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27243,8 +29851,11 @@ class ReadGeneralDiagnosticsTestEventTriggersEnabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTestEventTriggersEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TestEventTriggersEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics TestEventTriggersEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27288,6 +29899,11 @@ class SubscribeAttributeGeneralDiagnosticsTestEventTriggersEnabled : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TestEventTriggersEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27321,8 +29937,11 @@ class ReadGeneralDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27366,6 +29985,11 @@ class SubscribeAttributeGeneralDiagnosticsGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27399,8 +30023,11 @@ class ReadGeneralDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27444,6 +30071,11 @@ class SubscribeAttributeGeneralDiagnosticsAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27479,8 +30111,11 @@ class ReadGeneralDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27524,6 +30159,11 @@ class SubscribeAttributeGeneralDiagnosticsEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27559,8 +30199,11 @@ class ReadGeneralDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27604,6 +30247,11 @@ class SubscribeAttributeGeneralDiagnosticsAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27637,8 +30285,11 @@ class ReadGeneralDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27682,6 +30333,11 @@ class SubscribeAttributeGeneralDiagnosticsFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27715,8 +30371,11 @@ class ReadGeneralDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27760,6 +30419,11 @@ class SubscribeAttributeGeneralDiagnosticsClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27824,6 +30488,8 @@ class SoftwareDiagnosticsResetWatermarks : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -27862,8 +30528,11 @@ class ReadSoftwareDiagnosticsThreadMetrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThreadMetricsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics ThreadMetrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27907,6 +30576,11 @@ class SubscribeAttributeSoftwareDiagnosticsThreadMetrics : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27940,8 +30614,11 @@ class ReadSoftwareDiagnosticsCurrentHeapFree : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapFreeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapFree read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27985,6 +30662,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28018,8 +30700,11 @@ class ReadSoftwareDiagnosticsCurrentHeapUsed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapUsedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapUsed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28063,6 +30748,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28097,8 +30787,11 @@ class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapHighWatermarkWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapHighWatermark read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28142,6 +30835,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28175,8 +30873,11 @@ class ReadSoftwareDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28220,6 +30921,11 @@ class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28253,8 +30959,11 @@ class ReadSoftwareDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28298,6 +31007,11 @@ class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28333,8 +31047,11 @@ class ReadSoftwareDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28378,6 +31095,11 @@ class SubscribeAttributeSoftwareDiagnosticsEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28413,8 +31135,11 @@ class ReadSoftwareDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28458,6 +31183,11 @@ class SubscribeAttributeSoftwareDiagnosticsAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28491,8 +31221,11 @@ class ReadSoftwareDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28536,6 +31269,11 @@ class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28569,8 +31307,11 @@ class ReadSoftwareDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28614,6 +31355,11 @@ class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28732,17 +31478,19 @@ class ThreadNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -28776,8 +31524,11 @@ class ReadThreadNetworkDiagnosticsChannel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Channel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Channel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28821,6 +31572,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChannel : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Channel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28854,8 +31610,11 @@ class ReadThreadNetworkDiagnosticsRoutingRole : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRoutingRoleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RoutingRole response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RoutingRole read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28899,6 +31658,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRoutingRole : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RoutingRole response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28932,8 +31696,11 @@ class ReadThreadNetworkDiagnosticsNetworkName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworkNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NetworkName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics NetworkName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28977,6 +31744,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsNetworkName : public SubscribeAt } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NetworkName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29010,8 +31782,11 @@ class ReadThreadNetworkDiagnosticsPanId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePanIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PanId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PanId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29055,6 +31830,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPanId : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PanId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29088,8 +31868,11 @@ class ReadThreadNetworkDiagnosticsExtendedPanId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExtendedPanIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ExtendedPanId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ExtendedPanId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29133,6 +31916,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsExtendedPanId : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ExtendedPanId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29166,8 +31954,11 @@ class ReadThreadNetworkDiagnosticsMeshLocalPrefix : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeshLocalPrefixWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.MeshLocalPrefix response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics MeshLocalPrefix read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29211,6 +32002,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsMeshLocalPrefix : public Subscri } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.MeshLocalPrefix response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29244,8 +32040,11 @@ class ReadThreadNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29289,6 +32088,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsOverrunCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29322,8 +32126,11 @@ class ReadThreadNetworkDiagnosticsNeighborTable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNeighborTableWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NeighborTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics NeighborTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29367,6 +32174,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsNeighborTable : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NeighborTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29400,8 +32212,11 @@ class ReadThreadNetworkDiagnosticsRouteTable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRouteTableWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouteTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RouteTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29445,6 +32260,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRouteTable : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouteTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29478,8 +32298,11 @@ class ReadThreadNetworkDiagnosticsPartitionId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartitionIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PartitionId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29523,6 +32346,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPartitionId : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29556,8 +32384,11 @@ class ReadThreadNetworkDiagnosticsWeighting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWeightingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Weighting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Weighting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29601,6 +32432,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsWeighting : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Weighting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29634,8 +32470,11 @@ class ReadThreadNetworkDiagnosticsDataVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDataVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DataVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics DataVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29679,6 +32518,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDataVersion : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DataVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29712,8 +32556,11 @@ class ReadThreadNetworkDiagnosticsStableDataVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStableDataVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.StableDataVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics StableDataVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29757,6 +32604,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsStableDataVersion : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.StableDataVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29790,8 +32642,11 @@ class ReadThreadNetworkDiagnosticsLeaderRouterId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLeaderRouterIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRouterId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics LeaderRouterId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29835,6 +32690,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsLeaderRouterId : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRouterId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29868,8 +32728,11 @@ class ReadThreadNetworkDiagnosticsDetachedRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDetachedRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DetachedRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics DetachedRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29913,6 +32776,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDetachedRoleCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DetachedRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29946,8 +32814,11 @@ class ReadThreadNetworkDiagnosticsChildRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChildRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChildRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ChildRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29991,6 +32862,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChildRoleCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChildRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30024,8 +32900,11 @@ class ReadThreadNetworkDiagnosticsRouterRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRouterRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouterRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RouterRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30069,6 +32948,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRouterRoleCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouterRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30102,8 +32986,11 @@ class ReadThreadNetworkDiagnosticsLeaderRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLeaderRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics LeaderRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30147,6 +33034,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsLeaderRoleCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30180,8 +33072,11 @@ class ReadThreadNetworkDiagnosticsAttachAttemptCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttachAttemptCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttachAttemptCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AttachAttemptCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30225,6 +33120,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAttachAttemptCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttachAttemptCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30259,8 +33159,11 @@ class ReadThreadNetworkDiagnosticsPartitionIdChangeCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributePartitionIdChangeCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionIdChangeCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PartitionIdChangeCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30305,6 +33208,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPartitionIdChangeCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionIdChangeCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30340,8 +33248,11 @@ class ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount : public Rea [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.BetterPartitionAttachAttemptCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics BetterPartitionAttachAttemptCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30386,6 +33297,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsBetterPartitionAttachAttemptCoun } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.BetterPartitionAttachAttemptCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30419,8 +33335,11 @@ class ReadThreadNetworkDiagnosticsParentChangeCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeParentChangeCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ParentChangeCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ParentChangeCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30464,6 +33383,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsParentChangeCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ParentChangeCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30497,8 +33421,11 @@ class ReadThreadNetworkDiagnosticsTxTotalCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxTotalCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxTotalCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxTotalCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30542,6 +33469,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxTotalCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxTotalCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30575,8 +33507,11 @@ class ReadThreadNetworkDiagnosticsTxUnicastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxUnicastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxUnicastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxUnicastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30620,6 +33555,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxUnicastCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxUnicastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30653,8 +33593,11 @@ class ReadThreadNetworkDiagnosticsTxBroadcastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBroadcastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBroadcastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBroadcastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30698,6 +33641,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBroadcastCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBroadcastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30732,8 +33680,11 @@ class ReadThreadNetworkDiagnosticsTxAckRequestedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxAckRequestedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckRequestedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxAckRequestedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30777,6 +33728,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxAckRequestedCount : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckRequestedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30810,8 +33766,11 @@ class ReadThreadNetworkDiagnosticsTxAckedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxAckedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxAckedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30855,6 +33814,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxAckedCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30889,8 +33853,11 @@ class ReadThreadNetworkDiagnosticsTxNoAckRequestedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxNoAckRequestedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxNoAckRequestedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxNoAckRequestedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30935,6 +33902,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxNoAckRequestedCount : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxNoAckRequestedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30968,8 +33940,11 @@ class ReadThreadNetworkDiagnosticsTxDataCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxDataCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDataCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31013,6 +33988,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDataCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31046,8 +34026,11 @@ class ReadThreadNetworkDiagnosticsTxDataPollCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxDataPollCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataPollCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDataPollCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31091,6 +34074,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDataPollCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataPollCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31124,8 +34112,11 @@ class ReadThreadNetworkDiagnosticsTxBeaconCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBeaconCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBeaconCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31169,6 +34160,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBeaconCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31203,8 +34199,11 @@ class ReadThreadNetworkDiagnosticsTxBeaconRequestCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBeaconRequestCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconRequestCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBeaconRequestCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31248,6 +34247,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBeaconRequestCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconRequestCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31281,8 +34285,11 @@ class ReadThreadNetworkDiagnosticsTxOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31326,6 +34333,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxOtherCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31359,8 +34371,11 @@ class ReadThreadNetworkDiagnosticsTxRetryCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxRetryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxRetryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxRetryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31404,6 +34419,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxRetryCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxRetryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31438,8 +34458,11 @@ class ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount : public ReadAttri queue:callbackQueue]; [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDirectMaxRetryExpiryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDirectMaxRetryExpiryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31484,6 +34507,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDirectMaxRetryExpiryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31518,8 +34546,11 @@ class ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount : public ReadAtt queue:callbackQueue]; [cluster readAttributeTxIndirectMaxRetryExpiryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxIndirectMaxRetryExpiryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxIndirectMaxRetryExpiryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31564,6 +34595,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxIndirectMaxRetryExpiryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31597,8 +34633,11 @@ class ReadThreadNetworkDiagnosticsTxErrCcaCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrCcaCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrCcaCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrCcaCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31642,6 +34681,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrCcaCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrCcaCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31675,8 +34719,11 @@ class ReadThreadNetworkDiagnosticsTxErrAbortCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrAbortCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrAbortCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrAbortCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31720,6 +34767,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrAbortCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrAbortCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31754,8 +34806,11 @@ class ReadThreadNetworkDiagnosticsTxErrBusyChannelCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrBusyChannelCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrBusyChannelCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrBusyChannelCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31800,6 +34855,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrBusyChannelCount : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrBusyChannelCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31833,8 +34893,11 @@ class ReadThreadNetworkDiagnosticsRxTotalCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxTotalCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxTotalCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxTotalCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31878,6 +34941,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxTotalCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxTotalCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31911,8 +34979,11 @@ class ReadThreadNetworkDiagnosticsRxUnicastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxUnicastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxUnicastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxUnicastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31956,6 +35027,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxUnicastCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxUnicastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31989,8 +35065,11 @@ class ReadThreadNetworkDiagnosticsRxBroadcastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBroadcastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBroadcastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBroadcastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32034,6 +35113,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBroadcastCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBroadcastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32067,8 +35151,11 @@ class ReadThreadNetworkDiagnosticsRxDataCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDataCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDataCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32112,6 +35199,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDataCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32145,8 +35237,11 @@ class ReadThreadNetworkDiagnosticsRxDataPollCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDataPollCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataPollCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDataPollCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32190,6 +35285,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDataPollCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataPollCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32223,8 +35323,11 @@ class ReadThreadNetworkDiagnosticsRxBeaconCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBeaconCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBeaconCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32268,6 +35371,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBeaconCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32302,8 +35410,11 @@ class ReadThreadNetworkDiagnosticsRxBeaconRequestCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBeaconRequestCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconRequestCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBeaconRequestCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32347,6 +35458,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBeaconRequestCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconRequestCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32380,8 +35496,11 @@ class ReadThreadNetworkDiagnosticsRxOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32425,6 +35544,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxOtherCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32459,8 +35583,11 @@ class ReadThreadNetworkDiagnosticsRxAddressFilteredCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRxAddressFilteredCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxAddressFilteredCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxAddressFilteredCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32505,6 +35632,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxAddressFilteredCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxAddressFilteredCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32539,8 +35671,11 @@ class ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRxDestAddrFilteredCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDestAddrFilteredCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDestAddrFilteredCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32585,6 +35720,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDestAddrFilteredCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDestAddrFilteredCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32618,8 +35758,11 @@ class ReadThreadNetworkDiagnosticsRxDuplicatedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDuplicatedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDuplicatedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDuplicatedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32663,6 +35806,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDuplicatedCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDuplicatedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32696,8 +35844,11 @@ class ReadThreadNetworkDiagnosticsRxErrNoFrameCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrNoFrameCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrNoFrameCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrNoFrameCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32741,6 +35892,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrNoFrameCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrNoFrameCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32775,8 +35931,11 @@ class ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount : public ReadAttribu queue:callbackQueue]; [cluster readAttributeRxErrUnknownNeighborCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrUnknownNeighborCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrUnknownNeighborCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32821,6 +35980,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrUnknownNeighborCount : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrUnknownNeighborCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32855,8 +36019,11 @@ class ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrInvalidSrcAddrCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrInvalidSrcAddrCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32901,6 +36068,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrInvalidSrcAddrCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32934,8 +36106,11 @@ class ReadThreadNetworkDiagnosticsRxErrSecCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrSecCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrSecCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrSecCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32979,6 +36154,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrSecCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrSecCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33012,8 +36192,11 @@ class ReadThreadNetworkDiagnosticsRxErrFcsCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrFcsCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrFcsCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrFcsCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33057,6 +36240,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrFcsCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrFcsCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33090,8 +36278,11 @@ class ReadThreadNetworkDiagnosticsRxErrOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33135,6 +36326,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrOtherCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33168,8 +36364,11 @@ class ReadThreadNetworkDiagnosticsActiveTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ActiveTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33213,6 +36412,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsActiveTimestamp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33246,8 +36450,11 @@ class ReadThreadNetworkDiagnosticsPendingTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePendingTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PendingTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PendingTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33291,6 +36498,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPendingTimestamp : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PendingTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33324,8 +36536,11 @@ class ReadThreadNetworkDiagnosticsDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Delay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Delay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33369,6 +36584,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDelay : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Delay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33403,8 +36623,11 @@ class ReadThreadNetworkDiagnosticsSecurityPolicy : public ReadAttribute { [cluster readAttributeSecurityPolicyWithCompletion:^( MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.SecurityPolicy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics SecurityPolicy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33448,6 +36671,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsSecurityPolicy : public Subscrib } reportHandler:^(MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.SecurityPolicy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33481,8 +36709,11 @@ class ReadThreadNetworkDiagnosticsChannelPage0Mask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelPage0MaskWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChannelPage0Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ChannelPage0Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33526,6 +36757,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChannelPage0Mask : public Subscr } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChannelPage0Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33561,8 +36797,11 @@ class ReadThreadNetworkDiagnosticsOperationalDatasetComponents : public ReadAttr [cluster readAttributeOperationalDatasetComponentsWithCompletion:^( MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OperationalDatasetComponents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics OperationalDatasetComponents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33608,6 +36847,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsOperationalDatasetComponents : p reportHandler:^( MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OperationalDatasetComponents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33642,8 +36886,11 @@ class ReadThreadNetworkDiagnosticsActiveNetworkFaultsList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeActiveNetworkFaultsListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveNetworkFaultsList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ActiveNetworkFaultsList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33688,6 +36935,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsActiveNetworkFaultsList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveNetworkFaultsList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33722,8 +36974,11 @@ class ReadThreadNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33767,6 +37022,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33801,8 +37061,11 @@ class ReadThreadNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33846,6 +37109,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33881,8 +37149,11 @@ class ReadThreadNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33926,6 +37197,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33961,8 +37237,11 @@ class ReadThreadNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34006,6 +37285,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34039,8 +37323,11 @@ class ReadThreadNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34084,6 +37371,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34117,8 +37409,11 @@ class ReadThreadNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34162,6 +37457,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34231,17 +37531,19 @@ class WiFiNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -34275,8 +37577,11 @@ class ReadWiFiNetworkDiagnosticsBssid : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBSSIDWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BSSID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BSSID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34320,6 +37625,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBssid : public SubscribeAttribute } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BSSID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34353,8 +37663,11 @@ class ReadWiFiNetworkDiagnosticsSecurityType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSecurityTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.SecurityType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics SecurityType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34398,6 +37711,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsSecurityType : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.SecurityType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34431,8 +37749,11 @@ class ReadWiFiNetworkDiagnosticsWiFiVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiFiVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.WiFiVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics WiFiVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34476,6 +37797,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsWiFiVersion : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.WiFiVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34509,8 +37835,11 @@ class ReadWiFiNetworkDiagnosticsChannelNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelNumberWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ChannelNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics ChannelNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34554,6 +37883,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsChannelNumber : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ChannelNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34587,8 +37921,11 @@ class ReadWiFiNetworkDiagnosticsRssi : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRSSIWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.RSSI response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics RSSI read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34632,6 +37969,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsRssi : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.RSSI response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34665,8 +38007,11 @@ class ReadWiFiNetworkDiagnosticsBeaconLostCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBeaconLostCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconLostCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BeaconLostCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34710,6 +38055,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBeaconLostCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconLostCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34743,8 +38093,11 @@ class ReadWiFiNetworkDiagnosticsBeaconRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBeaconRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BeaconRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34788,6 +38141,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBeaconRxCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34822,8 +38180,11 @@ class ReadWiFiNetworkDiagnosticsPacketMulticastRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketMulticastRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketMulticastRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34867,6 +38228,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketMulticastRxCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34901,8 +38267,11 @@ class ReadWiFiNetworkDiagnosticsPacketMulticastTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketMulticastTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketMulticastTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34946,6 +38315,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketMulticastTxCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34979,8 +38353,11 @@ class ReadWiFiNetworkDiagnosticsPacketUnicastRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketUnicastRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketUnicastRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35024,6 +38401,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketUnicastRxCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35057,8 +38439,11 @@ class ReadWiFiNetworkDiagnosticsPacketUnicastTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketUnicastTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketUnicastTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35102,6 +38487,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketUnicastTxCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35135,8 +38525,11 @@ class ReadWiFiNetworkDiagnosticsCurrentMaxRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentMaxRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.CurrentMaxRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics CurrentMaxRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35180,6 +38573,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsCurrentMaxRate : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.CurrentMaxRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35213,8 +38611,11 @@ class ReadWiFiNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35258,6 +38659,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsOverrunCount : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35291,8 +38697,11 @@ class ReadWiFiNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35336,6 +38745,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35369,8 +38783,11 @@ class ReadWiFiNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35414,6 +38831,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35449,8 +38871,11 @@ class ReadWiFiNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35494,6 +38919,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35529,8 +38959,11 @@ class ReadWiFiNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35574,6 +39007,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35607,8 +39045,11 @@ class ReadWiFiNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35652,6 +39093,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35685,8 +39131,11 @@ class ReadWiFiNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35730,6 +39179,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35792,17 +39246,19 @@ class EthernetNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -35836,8 +39292,11 @@ class ReadEthernetNetworkDiagnosticsPHYRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePHYRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PHYRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35881,6 +39340,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPHYRate : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35914,8 +39378,11 @@ class ReadEthernetNetworkDiagnosticsFullDuplex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFullDuplexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics FullDuplex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35959,6 +39426,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35992,8 +39464,11 @@ class ReadEthernetNetworkDiagnosticsPacketRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PacketRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36037,6 +39512,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36070,8 +39550,11 @@ class ReadEthernetNetworkDiagnosticsPacketTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PacketTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36115,6 +39598,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36148,8 +39636,11 @@ class ReadEthernetNetworkDiagnosticsTxErrCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics TxErrCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36193,6 +39684,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36226,8 +39722,11 @@ class ReadEthernetNetworkDiagnosticsCollisionCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCollisionCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics CollisionCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36271,6 +39770,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36304,8 +39808,11 @@ class ReadEthernetNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36349,6 +39856,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36382,8 +39894,11 @@ class ReadEthernetNetworkDiagnosticsCarrierDetect : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCarrierDetectWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics CarrierDetect read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36427,6 +39942,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36460,8 +39980,11 @@ class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeSinceResetWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics TimeSinceReset read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36505,6 +40028,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36539,8 +40067,11 @@ class ReadEthernetNetworkDiagnosticsGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36585,6 +40116,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36619,8 +40155,11 @@ class ReadEthernetNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36665,6 +40204,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36700,8 +40244,11 @@ class ReadEthernetNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36745,6 +40292,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36780,8 +40332,11 @@ class ReadEthernetNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36825,6 +40380,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36858,8 +40418,11 @@ class ReadEthernetNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36903,6 +40466,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36936,8 +40504,11 @@ class ReadEthernetNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36981,6 +40552,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37068,17 +40644,19 @@ class TimeSynchronizationSetUTCTime : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setUTCTimeWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setUTCTimeWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37133,6 +40711,8 @@ class TimeSynchronizationSetTrustedTimeSource : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -37200,19 +40780,28 @@ class TimeSynchronizationSetTimeZone : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setTimeZoneWithParams:params - completion:^(MTRTimeSynchronizationClusterSetTimeZoneResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setTimeZoneWithParams:params + completion:^(MTRTimeSynchronizationClusterSetTimeZoneResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37272,17 +40861,19 @@ class TimeSynchronizationSetDSTOffset : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setDSTOffsetWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setDSTOffsetWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37332,17 +40923,19 @@ class TimeSynchronizationSetDefaultNTP : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setDefaultNTPWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setDefaultNTPWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37381,8 +40974,11 @@ class ReadTimeSynchronizationUTCTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUTCTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.UTCTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization UTCTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37426,6 +41022,11 @@ class SubscribeAttributeTimeSynchronizationUTCTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.UTCTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37462,8 +41063,11 @@ class ReadTimeSynchronizationGranularity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGranularityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.Granularity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization Granularity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37507,6 +41111,11 @@ class SubscribeAttributeTimeSynchronizationGranularity : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.Granularity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37543,8 +41152,11 @@ class ReadTimeSynchronizationTimeSource : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeSourceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37588,6 +41200,11 @@ class SubscribeAttributeTimeSynchronizationTimeSource : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37625,8 +41242,11 @@ class ReadTimeSynchronizationTrustedTimeSource : public ReadAttribute { [cluster readAttributeTrustedTimeSourceWithCompletion:^( MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TrustedTimeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TrustedTimeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37670,6 +41290,11 @@ class SubscribeAttributeTimeSynchronizationTrustedTimeSource : public SubscribeA } reportHandler:^(MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TrustedTimeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37706,8 +41331,11 @@ class ReadTimeSynchronizationDefaultNTP : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDefaultNTPWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DefaultNTP response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DefaultNTP read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37751,6 +41379,11 @@ class SubscribeAttributeTimeSynchronizationDefaultNTP : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DefaultNTP response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37787,8 +41420,11 @@ class ReadTimeSynchronizationTimeZone : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZone response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZone read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37832,6 +41468,11 @@ class SubscribeAttributeTimeSynchronizationTimeZone : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZone response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37868,8 +41509,11 @@ class ReadTimeSynchronizationDSTOffset : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDSTOffsetWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffset response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DSTOffset read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37913,6 +41557,11 @@ class SubscribeAttributeTimeSynchronizationDSTOffset : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffset response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37949,8 +41598,11 @@ class ReadTimeSynchronizationLocalTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.LocalTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization LocalTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37994,6 +41646,11 @@ class SubscribeAttributeTimeSynchronizationLocalTime : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.LocalTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38030,8 +41687,11 @@ class ReadTimeSynchronizationTimeZoneDatabase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneDatabaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneDatabase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZoneDatabase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38075,6 +41735,11 @@ class SubscribeAttributeTimeSynchronizationTimeZoneDatabase : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneDatabase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38111,8 +41776,11 @@ class ReadTimeSynchronizationNTPServerAvailable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNTPServerAvailableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.NTPServerAvailable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization NTPServerAvailable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38156,6 +41824,11 @@ class SubscribeAttributeTimeSynchronizationNTPServerAvailable : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.NTPServerAvailable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38192,8 +41865,11 @@ class ReadTimeSynchronizationTimeZoneListMaxSize : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneListMaxSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneListMaxSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZoneListMaxSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38237,6 +41913,11 @@ class SubscribeAttributeTimeSynchronizationTimeZoneListMaxSize : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneListMaxSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38273,8 +41954,11 @@ class ReadTimeSynchronizationDSTOffsetListMaxSize : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDSTOffsetListMaxSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffsetListMaxSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DSTOffsetListMaxSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38318,6 +42002,11 @@ class SubscribeAttributeTimeSynchronizationDSTOffsetListMaxSize : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffsetListMaxSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38354,8 +42043,11 @@ class ReadTimeSynchronizationSupportsDNSResolve : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportsDNSResolveWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.SupportsDNSResolve response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization SupportsDNSResolve read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38399,6 +42091,11 @@ class SubscribeAttributeTimeSynchronizationSupportsDNSResolve : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.SupportsDNSResolve response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38435,8 +42132,11 @@ class ReadTimeSynchronizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38480,6 +42180,11 @@ class SubscribeAttributeTimeSynchronizationGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38516,8 +42221,11 @@ class ReadTimeSynchronizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38561,6 +42269,11 @@ class SubscribeAttributeTimeSynchronizationAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38597,8 +42310,11 @@ class ReadTimeSynchronizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38642,6 +42358,11 @@ class SubscribeAttributeTimeSynchronizationEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38678,8 +42399,11 @@ class ReadTimeSynchronizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38723,6 +42447,11 @@ class SubscribeAttributeTimeSynchronizationAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38759,8 +42488,11 @@ class ReadTimeSynchronizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38804,6 +42536,11 @@ class SubscribeAttributeTimeSynchronizationFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38840,8 +42577,11 @@ class ReadTimeSynchronizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38885,6 +42625,11 @@ class SubscribeAttributeTimeSynchronizationClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38956,8 +42701,11 @@ class ReadBridgedDeviceBasicInformationVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39001,6 +42749,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationVendorName : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39034,8 +42787,11 @@ class ReadBridgedDeviceBasicInformationVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39079,6 +42835,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationVendorID : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39112,8 +42873,11 @@ class ReadBridgedDeviceBasicInformationProductName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39157,6 +42921,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductName : public Subscr } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39190,8 +42959,11 @@ class ReadBridgedDeviceBasicInformationNodeLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNodeLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.NodeLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation NodeLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39235,6 +43007,8 @@ class WriteBridgedDeviceBasicInformationNodeLabel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BridgedDeviceBasicInformation NodeLabel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39281,6 +43055,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationNodeLabel : public Subscrib } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.NodeLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39315,8 +43094,11 @@ class ReadBridgedDeviceBasicInformationHardwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation HardwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39360,6 +43142,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationHardwareVersion : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39394,8 +43181,11 @@ class ReadBridgedDeviceBasicInformationHardwareVersionString : public ReadAttrib queue:callbackQueue]; [cluster readAttributeHardwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation HardwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39440,6 +43230,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationHardwareVersionString : pub } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39474,8 +43269,11 @@ class ReadBridgedDeviceBasicInformationSoftwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SoftwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39519,6 +43317,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSoftwareVersion : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39553,8 +43356,11 @@ class ReadBridgedDeviceBasicInformationSoftwareVersionString : public ReadAttrib queue:callbackQueue]; [cluster readAttributeSoftwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SoftwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39599,6 +43405,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSoftwareVersionString : pub } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39633,8 +43444,11 @@ class ReadBridgedDeviceBasicInformationManufacturingDate : public ReadAttribute queue:callbackQueue]; [cluster readAttributeManufacturingDateWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ManufacturingDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ManufacturingDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39679,6 +43493,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationManufacturingDate : public } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ManufacturingDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39712,8 +43531,11 @@ class ReadBridgedDeviceBasicInformationPartNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.PartNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation PartNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39757,6 +43579,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationPartNumber : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.PartNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39790,8 +43617,11 @@ class ReadBridgedDeviceBasicInformationProductURL : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39835,6 +43665,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductURL : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39868,8 +43703,11 @@ class ReadBridgedDeviceBasicInformationProductLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39913,6 +43751,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductLabel : public Subsc } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39946,8 +43789,11 @@ class ReadBridgedDeviceBasicInformationSerialNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSerialNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SerialNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SerialNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39991,6 +43837,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSerialNumber : public Subsc } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40024,8 +43875,11 @@ class ReadBridgedDeviceBasicInformationReachable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReachableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.Reachable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation Reachable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40069,6 +43923,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationReachable : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.Reachable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40102,8 +43961,11 @@ class ReadBridgedDeviceBasicInformationUniqueID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUniqueIDWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.UniqueID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation UniqueID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40147,6 +44009,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationUniqueID : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.UniqueID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40182,8 +44049,11 @@ class ReadBridgedDeviceBasicInformationProductAppearance : public ReadAttribute [cluster readAttributeProductAppearanceWithCompletion:^( MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductAppearance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductAppearance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40229,6 +44099,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductAppearance : public reportHandler:^( MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductAppearance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40263,8 +44138,11 @@ class ReadBridgedDeviceBasicInformationGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40309,6 +44187,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40343,8 +44226,11 @@ class ReadBridgedDeviceBasicInformationAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40389,6 +44275,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40424,8 +44315,11 @@ class ReadBridgedDeviceBasicInformationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40469,6 +44363,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40504,8 +44403,11 @@ class ReadBridgedDeviceBasicInformationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40549,6 +44451,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40582,8 +44489,11 @@ class ReadBridgedDeviceBasicInformationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40627,6 +44537,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40661,8 +44576,11 @@ class ReadBridgedDeviceBasicInformationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40706,6 +44624,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40763,8 +44686,11 @@ class ReadSwitchNumberOfPositions : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfPositionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.NumberOfPositions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch NumberOfPositions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40806,6 +44732,11 @@ class SubscribeAttributeSwitchNumberOfPositions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.NumberOfPositions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40837,8 +44768,11 @@ class ReadSwitchCurrentPosition : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.CurrentPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch CurrentPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40880,6 +44814,11 @@ class SubscribeAttributeSwitchCurrentPosition : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.CurrentPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40911,8 +44850,11 @@ class ReadSwitchMultiPressMax : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMultiPressMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.MultiPressMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch MultiPressMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40954,6 +44896,11 @@ class SubscribeAttributeSwitchMultiPressMax : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.MultiPressMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40985,8 +44932,11 @@ class ReadSwitchGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41028,6 +44978,11 @@ class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41059,8 +45014,11 @@ class ReadSwitchAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41102,6 +45060,11 @@ class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41135,8 +45098,11 @@ class ReadSwitchEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41178,6 +45144,11 @@ class SubscribeAttributeSwitchEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41211,8 +45182,11 @@ class ReadSwitchAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41254,6 +45228,11 @@ class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41285,8 +45264,11 @@ class ReadSwitchFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41328,6 +45310,11 @@ class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41359,8 +45346,11 @@ class ReadSwitchClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41402,6 +45392,11 @@ class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41478,6 +45473,8 @@ class AdministratorCommissioningOpenCommissioningWindow : public ClusterCommand if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41529,6 +45526,8 @@ class AdministratorCommissioningOpenBasicCommissioningWindow : public ClusterCom if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41577,6 +45576,8 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41615,8 +45616,11 @@ class ReadAdministratorCommissioningWindowStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindowStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.WindowStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning WindowStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41660,6 +45664,11 @@ class SubscribeAttributeAdministratorCommissioningWindowStatus : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.WindowStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41693,8 +45702,11 @@ class ReadAdministratorCommissioningAdminFabricIndex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAdminFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminFabricIndex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AdminFabricIndex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41738,6 +45750,11 @@ class SubscribeAttributeAdministratorCommissioningAdminFabricIndex : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminFabricIndex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41771,8 +45788,11 @@ class ReadAdministratorCommissioningAdminVendorId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAdminVendorIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminVendorId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AdminVendorId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41816,6 +45836,11 @@ class SubscribeAttributeAdministratorCommissioningAdminVendorId : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminVendorId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41850,8 +45875,11 @@ class ReadAdministratorCommissioningGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41896,6 +45924,11 @@ class SubscribeAttributeAdministratorCommissioningGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41930,8 +45963,11 @@ class ReadAdministratorCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41976,6 +46012,11 @@ class SubscribeAttributeAdministratorCommissioningAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42011,8 +46052,11 @@ class ReadAdministratorCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42056,6 +46100,11 @@ class SubscribeAttributeAdministratorCommissioningEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42091,8 +46140,11 @@ class ReadAdministratorCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42136,6 +46188,11 @@ class SubscribeAttributeAdministratorCommissioningAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42169,8 +46226,11 @@ class ReadAdministratorCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42214,6 +46274,11 @@ class SubscribeAttributeAdministratorCommissioningFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42247,8 +46312,11 @@ class ReadAdministratorCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42292,6 +46360,11 @@ class SubscribeAttributeAdministratorCommissioningClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42364,10 +46437,20 @@ class OperationalCredentialsAttestationRequest : public ClusterCommand { completion:^(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42417,10 +46500,20 @@ class OperationalCredentialsCertificateChainRequest : public ClusterCommand { MTROperationalCredentialsClusterCertificateChainResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + OperationalCredentials::Commands::CertificateChainResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + OperationalCredentials::Commands::CertificateChainResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42471,19 +46564,28 @@ class OperationalCredentialsCSRRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster CSRRequestWithParams:params - completion:^(MTROperationalCredentialsClusterCSRResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + CSRRequestWithParams:params + completion:^( + MTROperationalCredentialsClusterCSRResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42539,10 +46641,18 @@ class OperationalCredentialsAddNOC : public ClusterCommand { completion:^( MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42593,19 +46703,28 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster updateNOCWithParams:params - completion:^( - MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + updateNOCWithParams:params + completion:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42651,10 +46770,20 @@ class OperationalCredentialsUpdateFabricLabel : public ClusterCommand { completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42699,19 +46828,28 @@ class OperationalCredentialsRemoveFabric : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeFabricWithParams:params - completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeFabricWithParams:params + completion:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42758,6 +46896,8 @@ class OperationalCredentialsAddTrustedRootCertificate : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42799,14 +46939,19 @@ class ReadOperationalCredentialsNOCs : public ReadAttribute { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } - [cluster readAttributeNOCsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.NOCs response %@", [value description]); - if (error != nil) { - LogNSError("OperationalCredentials NOCs read Error", error); - } - SetCommandExitStatus(error); - }]; + [cluster + readAttributeNOCsWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("OperationalCredentials NOCs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; return CHIP_NO_ERROR; } }; @@ -42847,6 +46992,11 @@ class SubscribeAttributeOperationalCredentialsNOCs : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42885,8 +47035,13 @@ class ReadOperationalCredentialsFabrics : public ReadAttribute { [cluster readAttributeFabricsWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials Fabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42930,6 +47085,11 @@ class SubscribeAttributeOperationalCredentialsFabrics : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42963,8 +47123,11 @@ class ReadOperationalCredentialsSupportedFabrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedFabricsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials SupportedFabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43008,6 +47171,11 @@ class SubscribeAttributeOperationalCredentialsSupportedFabrics : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43041,8 +47209,11 @@ class ReadOperationalCredentialsCommissionedFabrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCommissionedFabricsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials CommissionedFabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43086,6 +47257,11 @@ class SubscribeAttributeOperationalCredentialsCommissionedFabrics : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43120,8 +47296,11 @@ class ReadOperationalCredentialsTrustedRootCertificates : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTrustedRootCertificatesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials TrustedRootCertificates read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43166,6 +47345,11 @@ class SubscribeAttributeOperationalCredentialsTrustedRootCertificates : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43199,8 +47383,11 @@ class ReadOperationalCredentialsCurrentFabricIndex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials CurrentFabricIndex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43244,6 +47431,11 @@ class SubscribeAttributeOperationalCredentialsCurrentFabricIndex : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43277,8 +47469,11 @@ class ReadOperationalCredentialsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43322,6 +47517,11 @@ class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43355,8 +47555,11 @@ class ReadOperationalCredentialsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43400,6 +47603,11 @@ class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43435,8 +47643,11 @@ class ReadOperationalCredentialsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43480,6 +47691,11 @@ class SubscribeAttributeOperationalCredentialsEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43515,8 +47731,11 @@ class ReadOperationalCredentialsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43560,6 +47779,11 @@ class SubscribeAttributeOperationalCredentialsAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43593,8 +47817,11 @@ class ReadOperationalCredentialsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43638,6 +47865,11 @@ class SubscribeAttributeOperationalCredentialsFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43671,8 +47903,11 @@ class ReadOperationalCredentialsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43716,6 +47951,11 @@ class SubscribeAttributeOperationalCredentialsClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43815,17 +48055,19 @@ class GroupKeyManagementKeySetWrite : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetWriteWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43866,19 +48108,28 @@ class GroupKeyManagementKeySetRead : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetReadWithParams:params - completion:^(MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetReadWithParams:params + completion:^( + MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43918,17 +48169,19 @@ class GroupKeyManagementKeySetRemove : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetRemoveWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetRemoveWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43971,10 +48224,20 @@ class GroupKeyManagementKeySetReadAllIndices : public ClusterCommand { completion:^(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GroupKeyManagement:: + Commands::KeySetReadAllIndicesResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GroupKeyManagement:: + Commands::KeySetReadAllIndicesResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -44018,8 +48281,13 @@ class ReadGroupKeyManagementGroupKeyMap : public ReadAttribute { [cluster readAttributeGroupKeyMapWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GroupKeyMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44074,6 +48342,8 @@ class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("GroupKeyManagement GroupKeyMap write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44123,6 +48393,11 @@ class SubscribeAttributeGroupKeyManagementGroupKeyMap : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44161,8 +48436,13 @@ class ReadGroupKeyManagementGroupTable : public ReadAttribute { [cluster readAttributeGroupTableWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GroupTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44206,6 +48486,11 @@ class SubscribeAttributeGroupKeyManagementGroupTable : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44239,8 +48524,11 @@ class ReadGroupKeyManagementMaxGroupsPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxGroupsPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement MaxGroupsPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44284,6 +48572,11 @@ class SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44317,8 +48610,11 @@ class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxGroupKeysPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement MaxGroupKeysPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44362,6 +48658,11 @@ class SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44395,8 +48696,11 @@ class ReadGroupKeyManagementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44440,6 +48744,11 @@ class SubscribeAttributeGroupKeyManagementGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44473,8 +48782,11 @@ class ReadGroupKeyManagementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44518,6 +48830,11 @@ class SubscribeAttributeGroupKeyManagementAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44553,8 +48870,11 @@ class ReadGroupKeyManagementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44598,6 +48918,11 @@ class SubscribeAttributeGroupKeyManagementEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44633,8 +48958,11 @@ class ReadGroupKeyManagementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44678,6 +49006,11 @@ class SubscribeAttributeGroupKeyManagementAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44711,8 +49044,11 @@ class ReadGroupKeyManagementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44756,6 +49092,11 @@ class SubscribeAttributeGroupKeyManagementFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44789,8 +49130,11 @@ class ReadGroupKeyManagementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44834,6 +49178,11 @@ class SubscribeAttributeGroupKeyManagementClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44884,8 +49233,11 @@ class ReadFixedLabelLabelList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLabelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.LabelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel LabelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44929,6 +49281,11 @@ class SubscribeAttributeFixedLabelLabelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.LabelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44962,8 +49319,11 @@ class ReadFixedLabelGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45007,6 +49367,11 @@ class SubscribeAttributeFixedLabelGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45040,8 +49405,11 @@ class ReadFixedLabelAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45085,6 +49453,11 @@ class SubscribeAttributeFixedLabelAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45120,8 +49493,11 @@ class ReadFixedLabelEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45165,6 +49541,11 @@ class SubscribeAttributeFixedLabelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45200,8 +49581,11 @@ class ReadFixedLabelAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45245,6 +49629,11 @@ class SubscribeAttributeFixedLabelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45278,8 +49667,11 @@ class ReadFixedLabelFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45323,6 +49715,11 @@ class SubscribeAttributeFixedLabelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45356,8 +49753,11 @@ class ReadFixedLabelClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45401,6 +49801,11 @@ class SubscribeAttributeFixedLabelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45451,8 +49856,11 @@ class ReadUserLabelLabelList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLabelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.LabelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel LabelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45510,6 +49918,8 @@ class WriteUserLabelLabelList : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UserLabel LabelList write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45557,6 +49967,11 @@ class SubscribeAttributeUserLabelLabelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.LabelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45590,8 +50005,11 @@ class ReadUserLabelGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45635,6 +50053,11 @@ class SubscribeAttributeUserLabelGeneratedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45668,8 +50091,11 @@ class ReadUserLabelAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45713,6 +50139,11 @@ class SubscribeAttributeUserLabelAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45748,8 +50179,11 @@ class ReadUserLabelEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45793,6 +50227,11 @@ class SubscribeAttributeUserLabelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45828,8 +50267,11 @@ class ReadUserLabelAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45873,6 +50315,11 @@ class SubscribeAttributeUserLabelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45906,8 +50353,11 @@ class ReadUserLabelFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45951,6 +50401,11 @@ class SubscribeAttributeUserLabelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45984,8 +50439,11 @@ class ReadUserLabelClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46029,6 +50487,11 @@ class SubscribeAttributeUserLabelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46080,8 +50543,11 @@ class ReadBooleanStateStateValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.StateValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState StateValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46125,6 +50591,11 @@ class SubscribeAttributeBooleanStateStateValue : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.StateValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46158,8 +50629,11 @@ class ReadBooleanStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46203,6 +50677,11 @@ class SubscribeAttributeBooleanStateGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46236,8 +50715,11 @@ class ReadBooleanStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46281,6 +50763,11 @@ class SubscribeAttributeBooleanStateAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46316,8 +50803,11 @@ class ReadBooleanStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46361,6 +50851,11 @@ class SubscribeAttributeBooleanStateEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46396,8 +50891,11 @@ class ReadBooleanStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46441,6 +50939,11 @@ class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46474,8 +50977,11 @@ class ReadBooleanStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46519,6 +51025,11 @@ class SubscribeAttributeBooleanStateFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46552,8 +51063,11 @@ class ReadBooleanStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46597,6 +51111,11 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46673,19 +51192,29 @@ class IcdManagementRegisterClient : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster registerClientWithParams:params - completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + registerClientWithParams:params + completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -46740,6 +51269,8 @@ class IcdManagementUnregisterClient : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -46790,6 +51321,8 @@ class IcdManagementStayActiveRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -46832,8 +51365,11 @@ class ReadIcdManagementIdleModeInterval : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeIdleModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement IdleModeInterval read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46877,6 +51413,11 @@ class SubscribeAttributeIcdManagementIdleModeInterval : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46913,8 +51454,11 @@ class ReadIcdManagementActiveModeInterval : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ActiveModeInterval read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46958,6 +51502,11 @@ class SubscribeAttributeIcdManagementActiveModeInterval : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46994,8 +51543,11 @@ class ReadIcdManagementActiveModeThreshold : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveModeThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ActiveModeThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47039,6 +51591,11 @@ class SubscribeAttributeIcdManagementActiveModeThreshold : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47080,8 +51637,13 @@ class ReadIcdManagementRegisteredClients : public ReadAttribute { [cluster readAttributeRegisteredClientsWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement RegisteredClients read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47125,6 +51687,11 @@ class SubscribeAttributeIcdManagementRegisteredClients : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47161,8 +51728,11 @@ class ReadIcdManagementICDCounter : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeICDCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ICDCounter response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ICDCounter read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47206,6 +51776,11 @@ class SubscribeAttributeIcdManagementICDCounter : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ICDCounter response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47242,8 +51817,11 @@ class ReadIcdManagementClientsSupportedPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClientsSupportedPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ClientsSupportedPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47287,6 +51865,11 @@ class SubscribeAttributeIcdManagementClientsSupportedPerFabric : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47323,8 +51906,11 @@ class ReadIcdManagementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47368,6 +51954,11 @@ class SubscribeAttributeIcdManagementGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47404,8 +51995,11 @@ class ReadIcdManagementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47449,6 +52043,11 @@ class SubscribeAttributeIcdManagementAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47485,8 +52084,11 @@ class ReadIcdManagementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47530,6 +52132,11 @@ class SubscribeAttributeIcdManagementEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47566,8 +52173,11 @@ class ReadIcdManagementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47611,6 +52221,11 @@ class SubscribeAttributeIcdManagementAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47647,8 +52262,11 @@ class ReadIcdManagementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47692,6 +52310,11 @@ class SubscribeAttributeIcdManagementFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47728,8 +52351,11 @@ class ReadIcdManagementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47773,6 +52399,11 @@ class SubscribeAttributeIcdManagementClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47836,17 +52467,19 @@ class ModeSelectChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -47881,8 +52514,11 @@ class ReadModeSelectDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47926,6 +52562,11 @@ class SubscribeAttributeModeSelectDescription : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47959,8 +52600,11 @@ class ReadModeSelectStandardNamespace : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStandardNamespaceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect StandardNamespace read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48004,6 +52648,11 @@ class SubscribeAttributeModeSelectStandardNamespace : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48037,8 +52686,11 @@ class ReadModeSelectSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48082,6 +52734,11 @@ class SubscribeAttributeModeSelectSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48115,8 +52772,11 @@ class ReadModeSelectCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48160,6 +52820,11 @@ class SubscribeAttributeModeSelectCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48193,8 +52858,11 @@ class ReadModeSelectStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48229,13 +52897,18 @@ class WriteModeSelectStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ModeSelect StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48243,7 +52916,7 @@ class WriteModeSelectStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { @@ -48282,6 +52955,11 @@ class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48315,8 +52993,11 @@ class ReadModeSelectOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48351,13 +53032,18 @@ class WriteModeSelectOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ModeSelect OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48365,7 +53051,7 @@ class WriteModeSelectOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { @@ -48404,6 +53090,11 @@ class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48437,8 +53128,11 @@ class ReadModeSelectGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48482,6 +53176,11 @@ class SubscribeAttributeModeSelectGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48515,8 +53214,11 @@ class ReadModeSelectAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48560,6 +53262,11 @@ class SubscribeAttributeModeSelectAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48595,8 +53302,11 @@ class ReadModeSelectEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48640,6 +53350,11 @@ class SubscribeAttributeModeSelectEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48675,8 +53390,11 @@ class ReadModeSelectAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48720,6 +53438,11 @@ class SubscribeAttributeModeSelectAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48753,8 +53476,11 @@ class ReadModeSelectFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48798,6 +53524,11 @@ class SubscribeAttributeModeSelectFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48831,8 +53562,11 @@ class ReadModeSelectClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48876,6 +53610,11 @@ class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48937,19 +53676,28 @@ class LaundryWasherModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -48988,8 +53736,11 @@ class ReadLaundryWasherModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49033,6 +53784,11 @@ class SubscribeAttributeLaundryWasherModeSupportedModes : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49069,8 +53825,11 @@ class ReadLaundryWasherModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49114,6 +53873,11 @@ class SubscribeAttributeLaundryWasherModeCurrentMode : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49150,8 +53914,11 @@ class ReadLaundryWasherModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49186,13 +53953,18 @@ class WriteLaundryWasherModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49200,7 +53972,7 @@ class WriteLaundryWasherModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherModeStartUpMode : public SubscribeAttribute { @@ -49239,6 +54011,11 @@ class SubscribeAttributeLaundryWasherModeStartUpMode : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49275,8 +54052,11 @@ class ReadLaundryWasherModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49311,13 +54091,18 @@ class WriteLaundryWasherModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49325,7 +54110,7 @@ class WriteLaundryWasherModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherModeOnMode : public SubscribeAttribute { @@ -49364,6 +54149,11 @@ class SubscribeAttributeLaundryWasherModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49400,8 +54190,11 @@ class ReadLaundryWasherModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49445,6 +54238,11 @@ class SubscribeAttributeLaundryWasherModeGeneratedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49481,8 +54279,11 @@ class ReadLaundryWasherModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49526,6 +54327,11 @@ class SubscribeAttributeLaundryWasherModeAcceptedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49562,8 +54368,11 @@ class ReadLaundryWasherModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49607,6 +54416,11 @@ class SubscribeAttributeLaundryWasherModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49643,8 +54457,11 @@ class ReadLaundryWasherModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49688,6 +54505,11 @@ class SubscribeAttributeLaundryWasherModeAttributeList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49724,8 +54546,11 @@ class ReadLaundryWasherModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49769,6 +54594,11 @@ class SubscribeAttributeLaundryWasherModeFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49805,8 +54635,11 @@ class ReadLaundryWasherModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49850,6 +54683,11 @@ class SubscribeAttributeLaundryWasherModeClusterRevision : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49921,10 +54759,18 @@ class RefrigeratorAndTemperatureControlledCabinetModeChangeToMode : public Clust MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -49970,8 +54816,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeSupportedModes : public queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50017,6 +54866,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeSupported } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50055,8 +54909,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeCurrentMode : public Re queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50102,6 +54959,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeCurrentMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50140,8 +55002,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public Re queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50178,7 +55043,10 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value @@ -50187,6 +55055,8 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W if (error != nil) { LogNSError( "RefrigeratorAndTemperatureControlledCabinetMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50194,7 +55064,7 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public SubscribeAttribute { @@ -50235,6 +55105,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeStartUpMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50273,8 +55148,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeOnMode : public ReadAtt queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50311,13 +55189,18 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeOnMode : public WriteA params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50325,7 +55208,7 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeOnMode : public WriteA } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeOnMode : public SubscribeAttribute { @@ -50366,6 +55249,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeOnMode : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50404,8 +55292,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandList : queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50451,6 +55342,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeGenerated } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50489,8 +55385,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandList : p queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50536,6 +55435,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeAcceptedC } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50574,8 +55478,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeEventList : public Read queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50621,6 +55528,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeEventList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50659,8 +55571,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeAttributeList : public queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50706,6 +55621,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50744,8 +55664,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeFeatureMap : public Rea queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50791,6 +55714,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeFeatureMa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50829,8 +55757,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeClusterRevision : publi queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50876,6 +55807,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeClusterRe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50934,8 +55870,11 @@ class ReadLaundryWasherControlsSpinSpeeds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpinSpeedsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeeds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SpinSpeeds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50979,6 +55918,11 @@ class SubscribeAttributeLaundryWasherControlsSpinSpeeds : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeeds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51015,8 +55959,11 @@ class ReadLaundryWasherControlsSpinSpeedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpinSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SpinSpeedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51051,13 +55998,18 @@ class WriteLaundryWasherControlsSpinSpeedCurrent : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeSpinSpeedCurrentWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherControls SpinSpeedCurrent write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51065,7 +56017,7 @@ class WriteLaundryWasherControlsSpinSpeedCurrent : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherControlsSpinSpeedCurrent : public SubscribeAttribute { @@ -51104,6 +56056,11 @@ class SubscribeAttributeLaundryWasherControlsSpinSpeedCurrent : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51140,8 +56097,11 @@ class ReadLaundryWasherControlsNumberOfRinses : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfRinsesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.NumberOfRinses response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls NumberOfRinses read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51183,6 +56143,8 @@ class WriteLaundryWasherControlsNumberOfRinses : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherControls NumberOfRinses write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51229,6 +56191,11 @@ class SubscribeAttributeLaundryWasherControlsNumberOfRinses : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.NumberOfRinses response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51265,8 +56232,11 @@ class ReadLaundryWasherControlsSupportedRinses : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedRinsesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SupportedRinses response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SupportedRinses read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51310,6 +56280,11 @@ class SubscribeAttributeLaundryWasherControlsSupportedRinses : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SupportedRinses response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51346,8 +56321,11 @@ class ReadLaundryWasherControlsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51391,6 +56369,11 @@ class SubscribeAttributeLaundryWasherControlsGeneratedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51427,8 +56410,11 @@ class ReadLaundryWasherControlsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51472,6 +56458,11 @@ class SubscribeAttributeLaundryWasherControlsAcceptedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51508,8 +56499,11 @@ class ReadLaundryWasherControlsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51553,6 +56547,11 @@ class SubscribeAttributeLaundryWasherControlsEventList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51589,8 +56588,11 @@ class ReadLaundryWasherControlsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51634,6 +56636,11 @@ class SubscribeAttributeLaundryWasherControlsAttributeList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51670,8 +56677,11 @@ class ReadLaundryWasherControlsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51715,6 +56725,11 @@ class SubscribeAttributeLaundryWasherControlsFeatureMap : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51751,8 +56766,11 @@ class ReadLaundryWasherControlsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51796,6 +56814,11 @@ class SubscribeAttributeLaundryWasherControlsClusterRevision : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51859,19 +56882,28 @@ class RvcRunModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^( - MTRRVCRunModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRRVCRunModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -51910,8 +56942,11 @@ class ReadRvcRunModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51955,6 +56990,11 @@ class SubscribeAttributeRvcRunModeSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51991,8 +57031,11 @@ class ReadRvcRunModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52036,6 +57079,11 @@ class SubscribeAttributeRvcRunModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52072,8 +57120,11 @@ class ReadRvcRunModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52108,13 +57159,18 @@ class WriteRvcRunModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCRunMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52122,7 +57178,7 @@ class WriteRvcRunModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcRunModeStartUpMode : public SubscribeAttribute { @@ -52161,6 +57217,11 @@ class SubscribeAttributeRvcRunModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52197,8 +57258,11 @@ class ReadRvcRunModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52233,13 +57297,18 @@ class WriteRvcRunModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCRunMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52247,7 +57316,7 @@ class WriteRvcRunModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcRunModeOnMode : public SubscribeAttribute { @@ -52286,6 +57355,11 @@ class SubscribeAttributeRvcRunModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52322,8 +57396,11 @@ class ReadRvcRunModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52367,6 +57444,11 @@ class SubscribeAttributeRvcRunModeGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52403,8 +57485,11 @@ class ReadRvcRunModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52448,6 +57533,11 @@ class SubscribeAttributeRvcRunModeAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52484,8 +57574,11 @@ class ReadRvcRunModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52529,6 +57622,11 @@ class SubscribeAttributeRvcRunModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52565,8 +57663,11 @@ class ReadRvcRunModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52610,6 +57711,11 @@ class SubscribeAttributeRvcRunModeAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52646,8 +57752,11 @@ class ReadRvcRunModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52691,6 +57800,11 @@ class SubscribeAttributeRvcRunModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52727,8 +57841,11 @@ class ReadRvcRunModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52772,6 +57889,11 @@ class SubscribeAttributeRvcRunModeClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52835,19 +57957,28 @@ class RvcCleanModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -52886,8 +58017,11 @@ class ReadRvcCleanModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52931,6 +58065,11 @@ class SubscribeAttributeRvcCleanModeSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52967,8 +58106,11 @@ class ReadRvcCleanModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53012,6 +58154,11 @@ class SubscribeAttributeRvcCleanModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53048,8 +58195,11 @@ class ReadRvcCleanModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53084,13 +58234,18 @@ class WriteRvcCleanModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCCleanMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53098,7 +58253,7 @@ class WriteRvcCleanModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcCleanModeStartUpMode : public SubscribeAttribute { @@ -53137,6 +58292,11 @@ class SubscribeAttributeRvcCleanModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53173,8 +58333,11 @@ class ReadRvcCleanModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53209,13 +58372,18 @@ class WriteRvcCleanModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCCleanMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53223,7 +58391,7 @@ class WriteRvcCleanModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcCleanModeOnMode : public SubscribeAttribute { @@ -53262,6 +58430,11 @@ class SubscribeAttributeRvcCleanModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53298,8 +58471,11 @@ class ReadRvcCleanModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53343,6 +58519,11 @@ class SubscribeAttributeRvcCleanModeGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53379,8 +58560,11 @@ class ReadRvcCleanModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53424,6 +58608,11 @@ class SubscribeAttributeRvcCleanModeAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53460,8 +58649,11 @@ class ReadRvcCleanModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53505,6 +58697,11 @@ class SubscribeAttributeRvcCleanModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53541,8 +58738,11 @@ class ReadRvcCleanModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53586,6 +58786,11 @@ class SubscribeAttributeRvcCleanModeAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53622,8 +58827,11 @@ class ReadRvcCleanModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53667,6 +58875,11 @@ class SubscribeAttributeRvcCleanModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53703,8 +58916,11 @@ class ReadRvcCleanModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53748,6 +58964,11 @@ class SubscribeAttributeRvcCleanModeClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53829,6 +59050,8 @@ class TemperatureControlSetTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -53872,8 +59095,11 @@ class ReadTemperatureControlTemperatureSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.TemperatureSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl TemperatureSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53917,6 +59143,11 @@ class SubscribeAttributeTemperatureControlTemperatureSetpoint : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.TemperatureSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53953,8 +59184,11 @@ class ReadTemperatureControlMinTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MinTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl MinTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53998,6 +59232,11 @@ class SubscribeAttributeTemperatureControlMinTemperature : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MinTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54034,8 +59273,11 @@ class ReadTemperatureControlMaxTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MaxTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl MaxTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54079,6 +59321,11 @@ class SubscribeAttributeTemperatureControlMaxTemperature : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MaxTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54115,8 +59362,11 @@ class ReadTemperatureControlStep : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStepWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.Step response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl Step read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54160,6 +59410,11 @@ class SubscribeAttributeTemperatureControlStep : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.Step response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54196,8 +59451,11 @@ class ReadTemperatureControlSelectedTemperatureLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSelectedTemperatureLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SelectedTemperatureLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl SelectedTemperatureLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54241,6 +59499,11 @@ class SubscribeAttributeTemperatureControlSelectedTemperatureLevel : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SelectedTemperatureLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54278,8 +59541,11 @@ class ReadTemperatureControlSupportedTemperatureLevels : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedTemperatureLevelsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SupportedTemperatureLevels response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl SupportedTemperatureLevels read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54323,6 +59589,11 @@ class SubscribeAttributeTemperatureControlSupportedTemperatureLevels : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SupportedTemperatureLevels response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54359,8 +59630,11 @@ class ReadTemperatureControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54404,6 +59678,11 @@ class SubscribeAttributeTemperatureControlGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54440,8 +59719,11 @@ class ReadTemperatureControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54485,6 +59767,11 @@ class SubscribeAttributeTemperatureControlAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54521,8 +59808,11 @@ class ReadTemperatureControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54566,6 +59856,11 @@ class SubscribeAttributeTemperatureControlEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54602,8 +59897,11 @@ class ReadTemperatureControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54647,6 +59945,11 @@ class SubscribeAttributeTemperatureControlAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54683,8 +59986,11 @@ class ReadTemperatureControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54728,6 +60034,11 @@ class SubscribeAttributeTemperatureControlFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54764,8 +60075,11 @@ class ReadTemperatureControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54809,6 +60123,11 @@ class SubscribeAttributeTemperatureControlClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54867,8 +60186,11 @@ class ReadRefrigeratorAlarmMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54912,6 +60234,11 @@ class SubscribeAttributeRefrigeratorAlarmMask : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54948,8 +60275,11 @@ class ReadRefrigeratorAlarmState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.State response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm State read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54993,6 +60323,11 @@ class SubscribeAttributeRefrigeratorAlarmState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.State response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55029,8 +60364,11 @@ class ReadRefrigeratorAlarmSupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Supported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm Supported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55074,6 +60412,11 @@ class SubscribeAttributeRefrigeratorAlarmSupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Supported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55110,8 +60453,11 @@ class ReadRefrigeratorAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55155,6 +60501,11 @@ class SubscribeAttributeRefrigeratorAlarmGeneratedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55191,8 +60542,11 @@ class ReadRefrigeratorAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55236,6 +60590,11 @@ class SubscribeAttributeRefrigeratorAlarmAcceptedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55272,8 +60631,11 @@ class ReadRefrigeratorAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55317,6 +60679,11 @@ class SubscribeAttributeRefrigeratorAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55353,8 +60720,11 @@ class ReadRefrigeratorAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55398,6 +60768,11 @@ class SubscribeAttributeRefrigeratorAlarmAttributeList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55434,8 +60809,11 @@ class ReadRefrigeratorAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55479,6 +60857,11 @@ class SubscribeAttributeRefrigeratorAlarmFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55515,8 +60898,11 @@ class ReadRefrigeratorAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55560,6 +60946,11 @@ class SubscribeAttributeRefrigeratorAlarmClusterRevision : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55623,19 +61014,28 @@ class DishwasherModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRDishwasherModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRDishwasherModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -55674,8 +61074,11 @@ class ReadDishwasherModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55719,6 +61122,11 @@ class SubscribeAttributeDishwasherModeSupportedModes : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55755,8 +61163,11 @@ class ReadDishwasherModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55800,6 +61211,11 @@ class SubscribeAttributeDishwasherModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55836,8 +61252,11 @@ class ReadDishwasherModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55872,13 +61291,18 @@ class WriteDishwasherModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DishwasherMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55886,7 +61310,7 @@ class WriteDishwasherModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeDishwasherModeStartUpMode : public SubscribeAttribute { @@ -55925,6 +61349,11 @@ class SubscribeAttributeDishwasherModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55961,8 +61390,11 @@ class ReadDishwasherModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55997,13 +61429,18 @@ class WriteDishwasherModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DishwasherMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56011,7 +61448,7 @@ class WriteDishwasherModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeDishwasherModeOnMode : public SubscribeAttribute { @@ -56050,6 +61487,11 @@ class SubscribeAttributeDishwasherModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56086,8 +61528,11 @@ class ReadDishwasherModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56131,6 +61576,11 @@ class SubscribeAttributeDishwasherModeGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56167,8 +61617,11 @@ class ReadDishwasherModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56212,6 +61665,11 @@ class SubscribeAttributeDishwasherModeAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56248,8 +61706,11 @@ class ReadDishwasherModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56293,6 +61754,11 @@ class SubscribeAttributeDishwasherModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56329,8 +61795,11 @@ class ReadDishwasherModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56374,6 +61843,11 @@ class SubscribeAttributeDishwasherModeAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56410,8 +61884,11 @@ class ReadDishwasherModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56455,6 +61932,11 @@ class SubscribeAttributeDishwasherModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56491,8 +61973,11 @@ class ReadDishwasherModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56536,6 +62021,11 @@ class SubscribeAttributeDishwasherModeClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56591,8 +62081,11 @@ class ReadAirQualityAirQuality : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAirQualityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AirQuality response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AirQuality read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56636,6 +62129,11 @@ class SubscribeAttributeAirQualityAirQuality : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AirQuality response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56672,8 +62170,11 @@ class ReadAirQualityGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56717,6 +62218,11 @@ class SubscribeAttributeAirQualityGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56753,8 +62259,11 @@ class ReadAirQualityAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56798,6 +62307,11 @@ class SubscribeAttributeAirQualityAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56834,8 +62348,11 @@ class ReadAirQualityEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56879,6 +62396,11 @@ class SubscribeAttributeAirQualityEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56915,8 +62437,11 @@ class ReadAirQualityAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56960,6 +62485,11 @@ class SubscribeAttributeAirQualityAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56996,8 +62526,11 @@ class ReadAirQualityFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57041,6 +62574,11 @@ class SubscribeAttributeAirQualityFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57077,8 +62615,11 @@ class ReadAirQualityClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57122,6 +62663,11 @@ class SubscribeAttributeAirQualityClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57209,6 +62755,8 @@ class SmokeCoAlarmSelfTestRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -57251,8 +62799,11 @@ class ReadSmokeCoAlarmExpressedState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExpressedStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ExpressedState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57296,6 +62847,11 @@ class SubscribeAttributeSmokeCoAlarmExpressedState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57332,8 +62888,11 @@ class ReadSmokeCoAlarmSmokeState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSmokeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm SmokeState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57377,6 +62936,11 @@ class SubscribeAttributeSmokeCoAlarmSmokeState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57413,8 +62977,11 @@ class ReadSmokeCoAlarmCOState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCOStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.COState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm COState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57458,6 +63025,11 @@ class SubscribeAttributeSmokeCoAlarmCOState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.COState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57494,8 +63066,11 @@ class ReadSmokeCoAlarmBatteryAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatteryAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm BatteryAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57539,6 +63114,11 @@ class SubscribeAttributeSmokeCoAlarmBatteryAlert : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57575,8 +63155,11 @@ class ReadSmokeCoAlarmDeviceMuted : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDeviceMutedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm DeviceMuted read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57620,6 +63203,11 @@ class SubscribeAttributeSmokeCoAlarmDeviceMuted : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57656,8 +63244,11 @@ class ReadSmokeCoAlarmTestInProgress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTestInProgressWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm TestInProgress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57701,6 +63292,11 @@ class SubscribeAttributeSmokeCoAlarmTestInProgress : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57737,8 +63333,11 @@ class ReadSmokeCoAlarmHardwareFaultAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareFaultAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm HardwareFaultAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57782,6 +63381,11 @@ class SubscribeAttributeSmokeCoAlarmHardwareFaultAlert : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57818,8 +63422,11 @@ class ReadSmokeCoAlarmEndOfServiceAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndOfServiceAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm EndOfServiceAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57863,6 +63470,11 @@ class SubscribeAttributeSmokeCoAlarmEndOfServiceAlert : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57899,8 +63511,11 @@ class ReadSmokeCoAlarmInterconnectSmokeAlarm : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterconnectSmokeAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm InterconnectSmokeAlarm read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57944,6 +63559,11 @@ class SubscribeAttributeSmokeCoAlarmInterconnectSmokeAlarm : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57980,8 +63600,11 @@ class ReadSmokeCoAlarmInterconnectCOAlarm : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterconnectCOAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm InterconnectCOAlarm read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58025,6 +63648,11 @@ class SubscribeAttributeSmokeCoAlarmInterconnectCOAlarm : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58061,8 +63689,11 @@ class ReadSmokeCoAlarmContaminationState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeContaminationStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ContaminationState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58106,6 +63737,11 @@ class SubscribeAttributeSmokeCoAlarmContaminationState : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58142,8 +63778,11 @@ class ReadSmokeCoAlarmSmokeSensitivityLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSmokeSensitivityLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeSensitivityLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm SmokeSensitivityLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58185,6 +63824,8 @@ class WriteSmokeCoAlarmSmokeSensitivityLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("SmokeCOAlarm SmokeSensitivityLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58231,6 +63872,11 @@ class SubscribeAttributeSmokeCoAlarmSmokeSensitivityLevel : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeSensitivityLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58267,8 +63913,11 @@ class ReadSmokeCoAlarmExpiryDate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExpiryDateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpiryDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ExpiryDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58312,6 +63961,11 @@ class SubscribeAttributeSmokeCoAlarmExpiryDate : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpiryDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58348,8 +64002,11 @@ class ReadSmokeCoAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58393,6 +64050,11 @@ class SubscribeAttributeSmokeCoAlarmGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58429,8 +64091,11 @@ class ReadSmokeCoAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58474,6 +64139,11 @@ class SubscribeAttributeSmokeCoAlarmAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58510,8 +64180,11 @@ class ReadSmokeCoAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58555,6 +64228,11 @@ class SubscribeAttributeSmokeCoAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58591,8 +64269,11 @@ class ReadSmokeCoAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58636,6 +64317,11 @@ class SubscribeAttributeSmokeCoAlarmAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58672,8 +64358,11 @@ class ReadSmokeCoAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58717,6 +64406,11 @@ class SubscribeAttributeSmokeCoAlarmFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58753,8 +64447,11 @@ class ReadSmokeCoAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58798,6 +64495,11 @@ class SubscribeAttributeSmokeCoAlarmClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58869,6 +64571,7 @@ class DishwasherAlarmReset : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -58921,6 +64624,8 @@ class DishwasherAlarmModifyEnabledAlarms : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -58964,8 +64669,11 @@ class ReadDishwasherAlarmMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59009,6 +64717,11 @@ class SubscribeAttributeDishwasherAlarmMask : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59045,8 +64758,11 @@ class ReadDishwasherAlarmLatch : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLatchWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Latch response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Latch read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59090,6 +64806,11 @@ class SubscribeAttributeDishwasherAlarmLatch : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Latch response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59126,8 +64847,11 @@ class ReadDishwasherAlarmState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.State response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm State read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59171,6 +64895,11 @@ class SubscribeAttributeDishwasherAlarmState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.State response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59207,8 +64936,11 @@ class ReadDishwasherAlarmSupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Supported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Supported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59252,6 +64984,11 @@ class SubscribeAttributeDishwasherAlarmSupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Supported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59288,8 +65025,11 @@ class ReadDishwasherAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59333,6 +65073,11 @@ class SubscribeAttributeDishwasherAlarmGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59369,8 +65114,11 @@ class ReadDishwasherAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59414,6 +65162,11 @@ class SubscribeAttributeDishwasherAlarmAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59450,8 +65203,11 @@ class ReadDishwasherAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59495,6 +65251,11 @@ class SubscribeAttributeDishwasherAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59531,8 +65292,11 @@ class ReadDishwasherAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59576,6 +65340,11 @@ class SubscribeAttributeDishwasherAlarmAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59612,8 +65381,11 @@ class ReadDishwasherAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59657,6 +65429,11 @@ class SubscribeAttributeDishwasherAlarmFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59693,8 +65470,11 @@ class ReadDishwasherAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59738,6 +65518,11 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59810,10 +65595,18 @@ class OperationalStatePause : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59861,10 +65654,18 @@ class OperationalStateStop : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59912,10 +65713,18 @@ class OperationalStateStart : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59963,10 +65772,18 @@ class OperationalStateResume : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -60009,8 +65826,11 @@ class ReadOperationalStatePhaseList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.PhaseList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState PhaseList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60054,6 +65874,11 @@ class SubscribeAttributeOperationalStatePhaseList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.PhaseList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60090,8 +65915,11 @@ class ReadOperationalStateCurrentPhase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CurrentPhase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState CurrentPhase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60135,6 +65963,11 @@ class SubscribeAttributeOperationalStateCurrentPhase : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CurrentPhase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60171,8 +66004,11 @@ class ReadOperationalStateCountdownTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CountdownTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState CountdownTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60216,6 +66052,11 @@ class SubscribeAttributeOperationalStateCountdownTime : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CountdownTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60252,8 +66093,11 @@ class ReadOperationalStateOperationalStateList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalStateList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalStateList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60297,6 +66141,11 @@ class SubscribeAttributeOperationalStateOperationalStateList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalStateList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60333,8 +66182,11 @@ class ReadOperationalStateOperationalState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60378,6 +66230,11 @@ class SubscribeAttributeOperationalStateOperationalState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60415,8 +66272,11 @@ class ReadOperationalStateOperationalError : public ReadAttribute { [cluster readAttributeOperationalErrorWithCompletion:^( MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalError response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalError read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60460,6 +66320,11 @@ class SubscribeAttributeOperationalStateOperationalError : public SubscribeAttri } reportHandler:^(MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalError response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60496,8 +66361,11 @@ class ReadOperationalStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60541,6 +66409,11 @@ class SubscribeAttributeOperationalStateGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60577,8 +66450,11 @@ class ReadOperationalStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60622,6 +66498,11 @@ class SubscribeAttributeOperationalStateAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60658,8 +66539,11 @@ class ReadOperationalStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60703,6 +66587,11 @@ class SubscribeAttributeOperationalStateEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60739,8 +66628,11 @@ class ReadOperationalStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60784,6 +66676,11 @@ class SubscribeAttributeOperationalStateAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60820,8 +66717,11 @@ class ReadOperationalStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60865,6 +66765,11 @@ class SubscribeAttributeOperationalStateFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60901,8 +66806,11 @@ class ReadOperationalStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60946,6 +66854,11 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61018,10 +66931,18 @@ class RvcOperationalStatePause : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61069,10 +66990,18 @@ class RvcOperationalStateStop : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61120,10 +67049,18 @@ class RvcOperationalStateStart : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61171,10 +67108,18 @@ class RvcOperationalStateResume : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61217,8 +67162,11 @@ class ReadRvcOperationalStatePhaseList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState PhaseList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61262,6 +67210,11 @@ class SubscribeAttributeRvcOperationalStatePhaseList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61298,8 +67251,11 @@ class ReadRvcOperationalStateCurrentPhase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState CurrentPhase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61343,6 +67299,11 @@ class SubscribeAttributeRvcOperationalStateCurrentPhase : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61379,8 +67340,11 @@ class ReadRvcOperationalStateCountdownTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState CountdownTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61424,6 +67388,11 @@ class SubscribeAttributeRvcOperationalStateCountdownTime : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61460,8 +67429,11 @@ class ReadRvcOperationalStateOperationalStateList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalStateList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61505,6 +67477,11 @@ class SubscribeAttributeRvcOperationalStateOperationalStateList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61541,8 +67518,11 @@ class ReadRvcOperationalStateOperationalState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61586,6 +67566,11 @@ class SubscribeAttributeRvcOperationalStateOperationalState : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61623,8 +67608,11 @@ class ReadRvcOperationalStateOperationalError : public ReadAttribute { [cluster readAttributeOperationalErrorWithCompletion:^( MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalError read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61668,6 +67656,11 @@ class SubscribeAttributeRvcOperationalStateOperationalError : public SubscribeAt } reportHandler:^(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61704,8 +67697,11 @@ class ReadRvcOperationalStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61749,6 +67745,11 @@ class SubscribeAttributeRvcOperationalStateGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61785,8 +67786,11 @@ class ReadRvcOperationalStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61830,6 +67834,11 @@ class SubscribeAttributeRvcOperationalStateAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61866,8 +67875,11 @@ class ReadRvcOperationalStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61911,6 +67923,11 @@ class SubscribeAttributeRvcOperationalStateEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61947,8 +67964,11 @@ class ReadRvcOperationalStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61992,6 +68012,11 @@ class SubscribeAttributeRvcOperationalStateAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62028,8 +68053,11 @@ class ReadRvcOperationalStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62073,6 +68101,11 @@ class SubscribeAttributeRvcOperationalStateFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62109,8 +68142,11 @@ class ReadRvcOperationalStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62154,6 +68190,11 @@ class SubscribeAttributeRvcOperationalStateClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62223,6 +68264,8 @@ class HepaFilterMonitoringResetCondition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -62265,8 +68308,11 @@ class ReadHepaFilterMonitoringCondition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.Condition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring Condition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62310,6 +68356,11 @@ class SubscribeAttributeHepaFilterMonitoringCondition : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.Condition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62346,8 +68397,11 @@ class ReadHepaFilterMonitoringDegradationDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.DegradationDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring DegradationDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62391,6 +68445,11 @@ class SubscribeAttributeHepaFilterMonitoringDegradationDirection : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.DegradationDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62427,8 +68486,11 @@ class ReadHepaFilterMonitoringChangeIndication : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ChangeIndication response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ChangeIndication read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62472,6 +68534,11 @@ class SubscribeAttributeHepaFilterMonitoringChangeIndication : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ChangeIndication response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62508,8 +68575,11 @@ class ReadHepaFilterMonitoringInPlaceIndicator : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.InPlaceIndicator response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring InPlaceIndicator read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62553,6 +68623,11 @@ class SubscribeAttributeHepaFilterMonitoringInPlaceIndicator : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.InPlaceIndicator response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62589,8 +68664,11 @@ class ReadHepaFilterMonitoringLastChangedTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.LastChangedTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring LastChangedTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62625,13 +68703,18 @@ class WriteHepaFilterMonitoringLastChangedTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLastChangedTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("HEPAFilterMonitoring LastChangedTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62639,7 +68722,7 @@ class WriteHepaFilterMonitoringLastChangedTime : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeHepaFilterMonitoringLastChangedTime : public SubscribeAttribute { @@ -62678,6 +68761,11 @@ class SubscribeAttributeHepaFilterMonitoringLastChangedTime : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.LastChangedTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62714,8 +68802,11 @@ class ReadHepaFilterMonitoringReplacementProductList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ReplacementProductList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ReplacementProductList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62759,6 +68850,11 @@ class SubscribeAttributeHepaFilterMonitoringReplacementProductList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ReplacementProductList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62795,8 +68891,11 @@ class ReadHepaFilterMonitoringGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62840,6 +68939,11 @@ class SubscribeAttributeHepaFilterMonitoringGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62876,8 +68980,11 @@ class ReadHepaFilterMonitoringAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62921,6 +69028,11 @@ class SubscribeAttributeHepaFilterMonitoringAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62957,8 +69069,11 @@ class ReadHepaFilterMonitoringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63002,6 +69117,11 @@ class SubscribeAttributeHepaFilterMonitoringEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63038,8 +69158,11 @@ class ReadHepaFilterMonitoringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63083,6 +69206,11 @@ class SubscribeAttributeHepaFilterMonitoringAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63119,8 +69247,11 @@ class ReadHepaFilterMonitoringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63164,6 +69295,11 @@ class SubscribeAttributeHepaFilterMonitoringFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63200,8 +69336,11 @@ class ReadHepaFilterMonitoringClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63245,6 +69384,11 @@ class SubscribeAttributeHepaFilterMonitoringClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63314,6 +69458,8 @@ class ActivatedCarbonFilterMonitoringResetCondition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -63356,8 +69502,11 @@ class ReadActivatedCarbonFilterMonitoringCondition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.Condition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring Condition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63401,6 +69550,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringCondition : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.Condition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63438,8 +69592,11 @@ class ReadActivatedCarbonFilterMonitoringDegradationDirection : public ReadAttri queue:callbackQueue]; [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.DegradationDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring DegradationDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63484,6 +69641,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringDegradationDirection : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.DegradationDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63521,8 +69683,11 @@ class ReadActivatedCarbonFilterMonitoringChangeIndication : public ReadAttribute queue:callbackQueue]; [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ChangeIndication response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ChangeIndication read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63567,6 +69732,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringChangeIndication : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ChangeIndication response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63604,8 +69774,11 @@ class ReadActivatedCarbonFilterMonitoringInPlaceIndicator : public ReadAttribute queue:callbackQueue]; [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.InPlaceIndicator response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring InPlaceIndicator read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63650,6 +69823,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringInPlaceIndicator : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.InPlaceIndicator response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63687,8 +69865,11 @@ class ReadActivatedCarbonFilterMonitoringLastChangedTime : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.LastChangedTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring LastChangedTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63724,7 +69905,10 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLastChangedTimeWithValue:value @@ -63732,6 +69916,8 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ActivatedCarbonFilterMonitoring LastChangedTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63739,7 +69925,7 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeActivatedCarbonFilterMonitoringLastChangedTime : public SubscribeAttribute { @@ -63779,6 +69965,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringLastChangedTime : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.LastChangedTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63816,8 +70007,11 @@ class ReadActivatedCarbonFilterMonitoringReplacementProductList : public ReadAtt queue:callbackQueue]; [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ReplacementProductList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ReplacementProductList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63862,6 +70056,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringReplacementProductList : } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ReplacementProductList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63899,8 +70098,11 @@ class ReadActivatedCarbonFilterMonitoringGeneratedCommandList : public ReadAttri queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63945,6 +70147,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringGeneratedCommandList : pu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63982,8 +70189,11 @@ class ReadActivatedCarbonFilterMonitoringAcceptedCommandList : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64028,6 +70238,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringAcceptedCommandList : pub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64064,8 +70279,11 @@ class ReadActivatedCarbonFilterMonitoringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64109,6 +70327,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringEventList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64146,8 +70369,11 @@ class ReadActivatedCarbonFilterMonitoringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64191,6 +70417,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringAttributeList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64227,8 +70458,11 @@ class ReadActivatedCarbonFilterMonitoringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64272,6 +70506,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringFeatureMap : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64309,8 +70548,11 @@ class ReadActivatedCarbonFilterMonitoringClusterRevision : public ReadAttribute queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64355,6 +70597,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringClusterRevision : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64479,6 +70726,7 @@ class DoorLockLockDoor : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64525,17 +70773,19 @@ class DoorLockUnlockDoor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unlockDoorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + unlockDoorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -64585,6 +70835,8 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64645,6 +70897,8 @@ class DoorLockSetWeekDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64693,10 +70947,20 @@ class DoorLockGetWeekDaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64747,6 +71011,8 @@ class DoorLockClearWeekDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64801,6 +71067,8 @@ class DoorLockSetYearDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64849,10 +71117,20 @@ class DoorLockGetYearDaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64903,6 +71181,8 @@ class DoorLockClearYearDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64957,6 +71237,8 @@ class DoorLockSetHolidaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65003,10 +71285,20 @@ class DoorLockGetHolidaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65055,6 +71347,8 @@ class DoorLockClearHolidaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65137,6 +71431,7 @@ class DoorLockSetUser : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65179,18 +71474,25 @@ class DoorLockGetUser : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getUserWithParams:params - completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + getUserWithParams:params + completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65228,17 +71530,19 @@ class DoorLockClearUser : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearUserWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + clearUserWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65302,19 +71606,29 @@ class DoorLockSetCredential : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setCredentialWithParams:params - completion:^( - MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setCredentialWithParams:params + completion:^( + MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65361,10 +71675,20 @@ class DoorLockGetCredentialStatus : public ClusterCommand { completion:^(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65422,6 +71746,8 @@ class DoorLockClearCredential : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65471,17 +71797,19 @@ class DoorLockUnboltDoor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unboltDoorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + unboltDoorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65516,8 +71844,11 @@ class ReadDoorLockLockState : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLockStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LockState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65559,6 +71890,11 @@ class SubscribeAttributeDoorLockLockState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65590,8 +71926,11 @@ class ReadDoorLockLockType : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLockTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LockType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65633,6 +71972,11 @@ class SubscribeAttributeDoorLockLockType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65664,8 +72008,11 @@ class ReadDoorLockActuatorEnabled : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeActuatorEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ActuatorEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65707,6 +72054,11 @@ class SubscribeAttributeDoorLockActuatorEnabled : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65738,8 +72090,11 @@ class ReadDoorLockDoorState : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65781,6 +72136,11 @@ class SubscribeAttributeDoorLockDoorState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65812,8 +72172,11 @@ class ReadDoorLockDoorOpenEvents : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65853,6 +72216,8 @@ class WriteDoorLockDoorOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock DoorOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65897,6 +72262,11 @@ class SubscribeAttributeDoorLockDoorOpenEvents : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65928,8 +72298,11 @@ class ReadDoorLockDoorClosedEvents : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorClosedEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorClosedEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65969,6 +72342,8 @@ class WriteDoorLockDoorClosedEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock DoorClosedEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66013,6 +72388,11 @@ class SubscribeAttributeDoorLockDoorClosedEvents : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66044,8 +72424,11 @@ class ReadDoorLockOpenPeriod : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOpenPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OpenPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock OpenPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66085,6 +72468,8 @@ class WriteDoorLockOpenPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock OpenPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66129,6 +72514,11 @@ class SubscribeAttributeDoorLockOpenPeriod : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OpenPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66160,8 +72550,11 @@ class ReadDoorLockNumberOfTotalUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfTotalUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfTotalUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66203,6 +72596,11 @@ class SubscribeAttributeDoorLockNumberOfTotalUsersSupported : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66234,8 +72632,11 @@ class ReadDoorLockNumberOfPINUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfPINUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfPINUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66277,6 +72678,11 @@ class SubscribeAttributeDoorLockNumberOfPINUsersSupported : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66308,8 +72714,11 @@ class ReadDoorLockNumberOfRFIDUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfRFIDUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfRFIDUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66351,6 +72760,11 @@ class SubscribeAttributeDoorLockNumberOfRFIDUsersSupported : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66384,8 +72798,11 @@ class ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public ReadAttribut [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfWeekDaySchedulesSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66428,6 +72845,11 @@ class SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66461,8 +72883,11 @@ class ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser : public ReadAttribut [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfYearDaySchedulesSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66505,6 +72930,11 @@ class SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66537,8 +72967,11 @@ class ReadDoorLockNumberOfHolidaySchedulesSupported : public ReadAttribute { [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfHolidaySchedulesSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66580,6 +73013,11 @@ class SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66611,8 +73049,11 @@ class ReadDoorLockMaxPINCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMaxPINCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MaxPINCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66654,6 +73095,11 @@ class SubscribeAttributeDoorLockMaxPINCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66685,8 +73131,11 @@ class ReadDoorLockMinPINCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMinPINCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MinPINCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66728,6 +73177,11 @@ class SubscribeAttributeDoorLockMinPINCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66759,8 +73213,11 @@ class ReadDoorLockMaxRFIDCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMaxRFIDCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MaxRFIDCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66802,6 +73259,11 @@ class SubscribeAttributeDoorLockMaxRFIDCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66833,8 +73295,11 @@ class ReadDoorLockMinRFIDCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMinRFIDCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MinRFIDCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66876,6 +73341,11 @@ class SubscribeAttributeDoorLockMinRFIDCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66907,8 +73377,11 @@ class ReadDoorLockCredentialRulesSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCredentialRulesSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.CredentialRulesSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock CredentialRulesSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66950,6 +73423,11 @@ class SubscribeAttributeDoorLockCredentialRulesSupport : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.CredentialRulesSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66983,8 +73461,11 @@ class ReadDoorLockNumberOfCredentialsSupportedPerUser : public ReadAttribute { [cluster readAttributeNumberOfCredentialsSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfCredentialsSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfCredentialsSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67026,6 +73507,11 @@ class SubscribeAttributeDoorLockNumberOfCredentialsSupportedPerUser : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfCredentialsSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67057,8 +73543,11 @@ class ReadDoorLockLanguage : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLanguageWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.Language response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock Language read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67100,6 +73589,8 @@ class WriteDoorLockLanguage : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock Language write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67144,6 +73635,11 @@ class SubscribeAttributeDoorLockLanguage : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.Language response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67175,8 +73671,11 @@ class ReadDoorLockLEDSettings : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLEDSettingsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LEDSettings response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LEDSettings read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67216,6 +73715,8 @@ class WriteDoorLockLEDSettings : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock LEDSettings write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67260,6 +73761,11 @@ class SubscribeAttributeDoorLockLEDSettings : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LEDSettings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67291,8 +73797,11 @@ class ReadDoorLockAutoRelockTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAutoRelockTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AutoRelockTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67332,6 +73841,8 @@ class WriteDoorLockAutoRelockTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock AutoRelockTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67376,6 +73887,11 @@ class SubscribeAttributeDoorLockAutoRelockTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67407,8 +73923,11 @@ class ReadDoorLockSoundVolume : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSoundVolumeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SoundVolume response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SoundVolume read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67448,6 +73967,8 @@ class WriteDoorLockSoundVolume : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock SoundVolume write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67492,6 +74013,11 @@ class SubscribeAttributeDoorLockSoundVolume : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SoundVolume response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67523,8 +74049,11 @@ class ReadDoorLockOperatingMode : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOperatingModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OperatingMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock OperatingMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67564,6 +74093,8 @@ class WriteDoorLockOperatingMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock OperatingMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67608,6 +74139,11 @@ class SubscribeAttributeDoorLockOperatingMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OperatingMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67639,8 +74175,11 @@ class ReadDoorLockSupportedOperatingModes : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSupportedOperatingModesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SupportedOperatingModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67682,6 +74221,11 @@ class SubscribeAttributeDoorLockSupportedOperatingModes : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67713,8 +74257,11 @@ class ReadDoorLockDefaultConfigurationRegister : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDefaultConfigurationRegisterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DefaultConfigurationRegister response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DefaultConfigurationRegister read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67756,6 +74303,11 @@ class SubscribeAttributeDoorLockDefaultConfigurationRegister : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DefaultConfigurationRegister response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67787,8 +74339,11 @@ class ReadDoorLockEnableLocalProgramming : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableLocalProgrammingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableLocalProgramming response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableLocalProgramming read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67828,6 +74383,8 @@ class WriteDoorLockEnableLocalProgramming : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableLocalProgramming write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67872,6 +74429,11 @@ class SubscribeAttributeDoorLockEnableLocalProgramming : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableLocalProgramming response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67903,8 +74465,11 @@ class ReadDoorLockEnableOneTouchLocking : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableOneTouchLockingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableOneTouchLocking read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67944,6 +74509,8 @@ class WriteDoorLockEnableOneTouchLocking : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableOneTouchLocking write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67988,6 +74555,11 @@ class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68019,8 +74591,11 @@ class ReadDoorLockEnableInsideStatusLED : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableInsideStatusLEDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableInsideStatusLED read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68060,6 +74635,8 @@ class WriteDoorLockEnableInsideStatusLED : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableInsideStatusLED write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68104,6 +74681,11 @@ class SubscribeAttributeDoorLockEnableInsideStatusLED : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68135,8 +74717,11 @@ class ReadDoorLockEnablePrivacyModeButton : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnablePrivacyModeButtonWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnablePrivacyModeButton read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68176,6 +74761,8 @@ class WriteDoorLockEnablePrivacyModeButton : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnablePrivacyModeButton write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68220,6 +74807,11 @@ class SubscribeAttributeDoorLockEnablePrivacyModeButton : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68251,8 +74843,11 @@ class ReadDoorLockLocalProgrammingFeatures : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLocalProgrammingFeaturesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LocalProgrammingFeatures read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68292,6 +74887,8 @@ class WriteDoorLockLocalProgrammingFeatures : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock LocalProgrammingFeatures write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68336,6 +74933,11 @@ class SubscribeAttributeDoorLockLocalProgrammingFeatures : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68367,8 +74969,11 @@ class ReadDoorLockWrongCodeEntryLimit : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeWrongCodeEntryLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock WrongCodeEntryLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68408,6 +75013,8 @@ class WriteDoorLockWrongCodeEntryLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock WrongCodeEntryLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68452,6 +75059,11 @@ class SubscribeAttributeDoorLockWrongCodeEntryLimit : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68483,8 +75095,11 @@ class ReadDoorLockUserCodeTemporaryDisableTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeUserCodeTemporaryDisableTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock UserCodeTemporaryDisableTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68525,6 +75140,8 @@ class WriteDoorLockUserCodeTemporaryDisableTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock UserCodeTemporaryDisableTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68569,6 +75186,11 @@ class SubscribeAttributeDoorLockUserCodeTemporaryDisableTime : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68600,8 +75222,11 @@ class ReadDoorLockSendPINOverTheAir : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSendPINOverTheAirWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SendPINOverTheAir read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68641,6 +75266,8 @@ class WriteDoorLockSendPINOverTheAir : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock SendPINOverTheAir write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68685,6 +75312,11 @@ class SubscribeAttributeDoorLockSendPINOverTheAir : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68716,8 +75348,11 @@ class ReadDoorLockRequirePINforRemoteOperation : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeRequirePINforRemoteOperationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock RequirePINforRemoteOperation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68758,6 +75393,8 @@ class WriteDoorLockRequirePINforRemoteOperation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock RequirePINforRemoteOperation write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68802,6 +75439,11 @@ class SubscribeAttributeDoorLockRequirePINforRemoteOperation : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68833,8 +75475,11 @@ class ReadDoorLockExpiringUserTimeout : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeExpiringUserTimeoutWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ExpiringUserTimeout read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68874,6 +75519,8 @@ class WriteDoorLockExpiringUserTimeout : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock ExpiringUserTimeout write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68918,6 +75565,11 @@ class SubscribeAttributeDoorLockExpiringUserTimeout : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68949,8 +75601,11 @@ class ReadDoorLockGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68992,6 +75647,11 @@ class SubscribeAttributeDoorLockGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69023,8 +75683,11 @@ class ReadDoorLockAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69066,6 +75729,11 @@ class SubscribeAttributeDoorLockAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69099,8 +75767,11 @@ class ReadDoorLockEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69142,6 +75813,11 @@ class SubscribeAttributeDoorLockEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69175,8 +75851,11 @@ class ReadDoorLockAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69218,6 +75897,11 @@ class SubscribeAttributeDoorLockAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69249,8 +75933,11 @@ class ReadDoorLockFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69292,6 +75979,11 @@ class SubscribeAttributeDoorLockFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69323,8 +76015,11 @@ class ReadDoorLockClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69366,6 +76061,11 @@ class SubscribeAttributeDoorLockClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69453,6 +76153,7 @@ class WindowCoveringUpOrOpen : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69494,17 +76195,19 @@ class WindowCoveringDownOrClose : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster downOrCloseWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + downOrCloseWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69541,17 +76244,19 @@ class WindowCoveringStopMotion : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopMotionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopMotionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69590,17 +76295,19 @@ class WindowCoveringGoToLiftValue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToLiftValueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + goToLiftValueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69646,6 +76353,8 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69690,17 +76399,19 @@ class WindowCoveringGoToTiltValue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToTiltValueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + goToTiltValueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69746,6 +76457,8 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69785,8 +76498,11 @@ class ReadWindowCoveringType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Type response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering Type read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69830,6 +76546,11 @@ class SubscribeAttributeWindowCoveringType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Type response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69863,8 +76584,11 @@ class ReadWindowCoveringPhysicalClosedLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalClosedLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering PhysicalClosedLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69908,6 +76632,11 @@ class SubscribeAttributeWindowCoveringPhysicalClosedLimitLift : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69941,8 +76670,11 @@ class ReadWindowCoveringPhysicalClosedLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalClosedLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering PhysicalClosedLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69986,6 +76718,11 @@ class SubscribeAttributeWindowCoveringPhysicalClosedLimitTilt : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70019,8 +76756,11 @@ class ReadWindowCoveringCurrentPositionLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70064,6 +76804,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLift : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70097,8 +76842,11 @@ class ReadWindowCoveringCurrentPositionTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70142,6 +76890,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTilt : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70175,8 +76928,11 @@ class ReadWindowCoveringNumberOfActuationsLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfActuationsLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering NumberOfActuationsLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70220,6 +76976,11 @@ class SubscribeAttributeWindowCoveringNumberOfActuationsLift : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70253,8 +77014,11 @@ class ReadWindowCoveringNumberOfActuationsTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfActuationsTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering NumberOfActuationsTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70298,6 +77062,11 @@ class SubscribeAttributeWindowCoveringNumberOfActuationsTilt : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70331,8 +77100,11 @@ class ReadWindowCoveringConfigStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConfigStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ConfigStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering ConfigStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70376,6 +77148,11 @@ class SubscribeAttributeWindowCoveringConfigStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ConfigStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70410,8 +77187,11 @@ class ReadWindowCoveringCurrentPositionLiftPercentage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionLiftPercentageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercentage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLiftPercentage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70455,6 +77235,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLiftPercentage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70489,8 +77274,11 @@ class ReadWindowCoveringCurrentPositionTiltPercentage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionTiltPercentageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercentage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTiltPercentage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70534,6 +77322,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTiltPercentage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70567,8 +77360,11 @@ class ReadWindowCoveringOperationalStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.OperationalStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering OperationalStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70612,6 +77408,11 @@ class SubscribeAttributeWindowCoveringOperationalStatus : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.OperationalStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70647,8 +77448,11 @@ class ReadWindowCoveringTargetPositionLiftPercent100ths : public ReadAttribute { [cluster readAttributeTargetPositionLiftPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionLiftPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering TargetPositionLiftPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70693,6 +77497,11 @@ class SubscribeAttributeWindowCoveringTargetPositionLiftPercent100ths : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionLiftPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70728,8 +77537,11 @@ class ReadWindowCoveringTargetPositionTiltPercent100ths : public ReadAttribute { [cluster readAttributeTargetPositionTiltPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionTiltPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering TargetPositionTiltPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70774,6 +77586,11 @@ class SubscribeAttributeWindowCoveringTargetPositionTiltPercent100ths : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionTiltPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70807,8 +77624,11 @@ class ReadWindowCoveringEndProductType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndProductTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EndProductType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering EndProductType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70852,6 +77672,11 @@ class SubscribeAttributeWindowCoveringEndProductType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EndProductType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70887,8 +77712,11 @@ class ReadWindowCoveringCurrentPositionLiftPercent100ths : public ReadAttribute [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLiftPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70933,6 +77761,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLiftPercent100ths : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70968,8 +77801,11 @@ class ReadWindowCoveringCurrentPositionTiltPercent100ths : public ReadAttribute [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTiltPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71014,6 +77850,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTiltPercent100ths : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71047,8 +77888,11 @@ class ReadWindowCoveringInstalledOpenLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledOpenLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledOpenLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71092,6 +77936,11 @@ class SubscribeAttributeWindowCoveringInstalledOpenLimitLift : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71125,8 +77974,11 @@ class ReadWindowCoveringInstalledClosedLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledClosedLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledClosedLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71170,6 +78022,11 @@ class SubscribeAttributeWindowCoveringInstalledClosedLimitLift : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71203,8 +78060,11 @@ class ReadWindowCoveringInstalledOpenLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledOpenLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledOpenLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71248,6 +78108,11 @@ class SubscribeAttributeWindowCoveringInstalledOpenLimitTilt : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71281,8 +78146,11 @@ class ReadWindowCoveringInstalledClosedLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledClosedLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledClosedLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71326,6 +78194,11 @@ class SubscribeAttributeWindowCoveringInstalledClosedLimitTilt : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71359,8 +78232,11 @@ class ReadWindowCoveringMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Mode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering Mode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71402,6 +78278,8 @@ class WriteWindowCoveringMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("WindowCovering Mode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71448,6 +78326,11 @@ class SubscribeAttributeWindowCoveringMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Mode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71481,8 +78364,11 @@ class ReadWindowCoveringSafetyStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSafetyStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.SafetyStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering SafetyStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71526,6 +78412,11 @@ class SubscribeAttributeWindowCoveringSafetyStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.SafetyStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71559,8 +78450,11 @@ class ReadWindowCoveringGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71604,6 +78498,11 @@ class SubscribeAttributeWindowCoveringGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71637,8 +78536,11 @@ class ReadWindowCoveringAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71682,6 +78584,11 @@ class SubscribeAttributeWindowCoveringAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71717,8 +78624,11 @@ class ReadWindowCoveringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71762,6 +78672,11 @@ class SubscribeAttributeWindowCoveringEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71797,8 +78712,11 @@ class ReadWindowCoveringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71842,6 +78760,11 @@ class SubscribeAttributeWindowCoveringAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71875,8 +78798,11 @@ class ReadWindowCoveringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71920,6 +78846,11 @@ class SubscribeAttributeWindowCoveringFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71953,8 +78884,11 @@ class ReadWindowCoveringClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71998,6 +78932,11 @@ class SubscribeAttributeWindowCoveringClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72070,6 +79009,8 @@ class BarrierControlBarrierControlGoToPercent : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -72118,6 +79059,8 @@ class BarrierControlBarrierControlStop : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -72156,8 +79099,11 @@ class ReadBarrierControlBarrierMovingState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierMovingStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierMovingState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierMovingState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72201,6 +79147,11 @@ class SubscribeAttributeBarrierControlBarrierMovingState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierMovingState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72234,8 +79185,11 @@ class ReadBarrierControlBarrierSafetyStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierSafetyStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierSafetyStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierSafetyStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72279,6 +79233,11 @@ class SubscribeAttributeBarrierControlBarrierSafetyStatus : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierSafetyStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72312,8 +79271,11 @@ class ReadBarrierControlBarrierCapabilities : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCapabilitiesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCapabilities response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72357,6 +79319,11 @@ class SubscribeAttributeBarrierControlBarrierCapabilities : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72390,8 +79357,11 @@ class ReadBarrierControlBarrierOpenEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72433,6 +79403,8 @@ class WriteBarrierControlBarrierOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72479,6 +79451,11 @@ class SubscribeAttributeBarrierControlBarrierOpenEvents : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72512,8 +79489,11 @@ class ReadBarrierControlBarrierCloseEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCloseEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCloseEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72555,6 +79535,8 @@ class WriteBarrierControlBarrierCloseEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCloseEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72601,6 +79583,11 @@ class SubscribeAttributeBarrierControlBarrierCloseEvents : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72634,8 +79621,11 @@ class ReadBarrierControlBarrierCommandOpenEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCommandOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCommandOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72678,6 +79668,8 @@ class WriteBarrierControlBarrierCommandOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCommandOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72724,6 +79716,11 @@ class SubscribeAttributeBarrierControlBarrierCommandOpenEvents : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72757,8 +79754,11 @@ class ReadBarrierControlBarrierCommandCloseEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCommandCloseEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCommandCloseEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72801,6 +79801,8 @@ class WriteBarrierControlBarrierCommandCloseEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCommandCloseEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72847,6 +79849,11 @@ class SubscribeAttributeBarrierControlBarrierCommandCloseEvents : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72880,8 +79887,11 @@ class ReadBarrierControlBarrierOpenPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierOpenPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierOpenPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72923,6 +79933,8 @@ class WriteBarrierControlBarrierOpenPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierOpenPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72969,6 +79981,11 @@ class SubscribeAttributeBarrierControlBarrierOpenPeriod : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73002,8 +80019,11 @@ class ReadBarrierControlBarrierClosePeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierClosePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierClosePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73045,6 +80065,8 @@ class WriteBarrierControlBarrierClosePeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierClosePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73091,6 +80113,11 @@ class SubscribeAttributeBarrierControlBarrierClosePeriod : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73124,8 +80151,11 @@ class ReadBarrierControlBarrierPosition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73169,6 +80199,11 @@ class SubscribeAttributeBarrierControlBarrierPosition : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73202,8 +80237,11 @@ class ReadBarrierControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73247,6 +80285,11 @@ class SubscribeAttributeBarrierControlGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73280,8 +80323,11 @@ class ReadBarrierControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73325,6 +80371,11 @@ class SubscribeAttributeBarrierControlAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73360,8 +80411,11 @@ class ReadBarrierControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73405,6 +80459,11 @@ class SubscribeAttributeBarrierControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73440,8 +80499,11 @@ class ReadBarrierControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73485,6 +80547,11 @@ class SubscribeAttributeBarrierControlAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73518,8 +80585,11 @@ class ReadBarrierControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73563,6 +80633,11 @@ class SubscribeAttributeBarrierControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73596,8 +80671,11 @@ class ReadBarrierControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73641,6 +80719,11 @@ class SubscribeAttributeBarrierControlClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73730,8 +80813,11 @@ class ReadPumpConfigurationAndControlMaxPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73775,6 +80861,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxPressure : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73808,8 +80899,11 @@ class ReadPumpConfigurationAndControlMaxSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73853,6 +80947,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxSpeed : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73886,8 +80985,11 @@ class ReadPumpConfigurationAndControlMaxFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73931,6 +81033,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxFlow : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73965,8 +81072,11 @@ class ReadPumpConfigurationAndControlMinConstPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74010,6 +81120,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstPressure : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74044,8 +81159,11 @@ class ReadPumpConfigurationAndControlMaxConstPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74089,6 +81207,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstPressure : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74122,8 +81245,11 @@ class ReadPumpConfigurationAndControlMinCompPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinCompPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinCompPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74167,6 +81293,11 @@ class SubscribeAttributePumpConfigurationAndControlMinCompPressure : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74200,8 +81331,11 @@ class ReadPumpConfigurationAndControlMaxCompPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxCompPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxCompPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74245,6 +81379,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxCompPressure : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74278,8 +81417,11 @@ class ReadPumpConfigurationAndControlMinConstSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74323,6 +81465,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstSpeed : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74356,8 +81503,11 @@ class ReadPumpConfigurationAndControlMaxConstSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74401,6 +81551,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstSpeed : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74434,8 +81589,11 @@ class ReadPumpConfigurationAndControlMinConstFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74479,6 +81637,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstFlow : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74512,8 +81675,11 @@ class ReadPumpConfigurationAndControlMaxConstFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74557,6 +81723,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstFlow : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74590,8 +81761,11 @@ class ReadPumpConfigurationAndControlMinConstTemp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstTempWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstTemp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74635,6 +81809,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstTemp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74668,8 +81847,11 @@ class ReadPumpConfigurationAndControlMaxConstTemp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstTempWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstTemp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74713,6 +81895,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstTemp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74746,8 +81933,11 @@ class ReadPumpConfigurationAndControlPumpStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePumpStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl PumpStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74791,6 +81981,11 @@ class SubscribeAttributePumpConfigurationAndControlPumpStatus : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74825,8 +82020,11 @@ class ReadPumpConfigurationAndControlEffectiveOperationMode : public ReadAttribu queue:callbackQueue]; [cluster readAttributeEffectiveOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EffectiveOperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74871,6 +82069,11 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74905,8 +82108,11 @@ class ReadPumpConfigurationAndControlEffectiveControlMode : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEffectiveControlModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EffectiveControlMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74951,6 +82157,11 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveControlMode : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74984,8 +82195,11 @@ class ReadPumpConfigurationAndControlCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Capacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75029,6 +82243,11 @@ class SubscribeAttributePumpConfigurationAndControlCapacity : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75062,8 +82281,11 @@ class ReadPumpConfigurationAndControlSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Speed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75107,6 +82329,11 @@ class SubscribeAttributePumpConfigurationAndControlSpeed : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75141,8 +82368,11 @@ class ReadPumpConfigurationAndControlLifetimeRunningHours : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLifetimeRunningHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl LifetimeRunningHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75178,7 +82408,10 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLifetimeRunningHoursWithValue:value params:params @@ -75186,6 +82419,8 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu if (error != nil) { LogNSError("PumpConfigurationAndControl LifetimeRunningHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75193,7 +82428,7 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public SubscribeAttribute { @@ -75233,6 +82468,11 @@ class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75266,8 +82506,11 @@ class ReadPumpConfigurationAndControlPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Power read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75311,6 +82554,11 @@ class SubscribeAttributePumpConfigurationAndControlPower : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75345,8 +82593,11 @@ class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ReadAttribu queue:callbackQueue]; [cluster readAttributeLifetimeEnergyConsumedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl LifetimeEnergyConsumed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75382,7 +82633,10 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLifetimeEnergyConsumedWithValue:value @@ -75391,6 +82645,8 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri if (error != nil) { LogNSError( "PumpConfigurationAndControl LifetimeEnergyConsumed write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75398,7 +82654,7 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : public SubscribeAttribute { @@ -75438,6 +82694,11 @@ class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75471,8 +82732,11 @@ class ReadPumpConfigurationAndControlOperationMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl OperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75514,6 +82778,8 @@ class WritePumpConfigurationAndControlOperationMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("PumpConfigurationAndControl OperationMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75560,6 +82826,11 @@ class SubscribeAttributePumpConfigurationAndControlOperationMode : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75593,8 +82864,11 @@ class ReadPumpConfigurationAndControlControlMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeControlModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl ControlMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75636,6 +82910,8 @@ class WritePumpConfigurationAndControlControlMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("PumpConfigurationAndControl ControlMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75682,6 +82958,11 @@ class SubscribeAttributePumpConfigurationAndControlControlMode : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75716,8 +82997,11 @@ class ReadPumpConfigurationAndControlGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75762,6 +83046,11 @@ class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75796,8 +83085,11 @@ class ReadPumpConfigurationAndControlAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75842,6 +83134,11 @@ class SubscribeAttributePumpConfigurationAndControlAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75877,8 +83174,11 @@ class ReadPumpConfigurationAndControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75922,6 +83222,11 @@ class SubscribeAttributePumpConfigurationAndControlEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75957,8 +83262,11 @@ class ReadPumpConfigurationAndControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76002,6 +83310,11 @@ class SubscribeAttributePumpConfigurationAndControlAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76035,8 +83348,11 @@ class ReadPumpConfigurationAndControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76080,6 +83396,11 @@ class SubscribeAttributePumpConfigurationAndControlFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76113,8 +83434,11 @@ class ReadPumpConfigurationAndControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76158,6 +83482,11 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76273,6 +83602,8 @@ class ThermostatSetpointRaiseLower : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76349,6 +83680,8 @@ class ThermostatSetWeeklySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76402,10 +83735,20 @@ class ThermostatGetWeeklySchedule : public ClusterCommand { completion:^(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76454,6 +83797,8 @@ class ThermostatClearWeeklySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76492,8 +83837,11 @@ class ReadThermostatLocalTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat LocalTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76537,6 +83885,11 @@ class SubscribeAttributeThermostatLocalTemperature : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76570,8 +83923,11 @@ class ReadThermostatOutdoorTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutdoorTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OutdoorTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76615,6 +83971,11 @@ class SubscribeAttributeThermostatOutdoorTemperature : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76648,8 +84009,11 @@ class ReadThermostatOccupancy : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.Occupancy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat Occupancy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76693,6 +84057,11 @@ class SubscribeAttributeThermostatOccupancy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.Occupancy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76726,8 +84095,11 @@ class ReadThermostatAbsMinHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMinHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMinHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76771,6 +84143,11 @@ class SubscribeAttributeThermostatAbsMinHeatSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76804,8 +84181,11 @@ class ReadThermostatAbsMaxHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMaxHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76849,6 +84229,11 @@ class SubscribeAttributeThermostatAbsMaxHeatSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76882,8 +84267,11 @@ class ReadThermostatAbsMinCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMinCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMinCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76927,6 +84315,11 @@ class SubscribeAttributeThermostatAbsMinCoolSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76960,8 +84353,11 @@ class ReadThermostatAbsMaxCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMaxCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77005,6 +84401,11 @@ class SubscribeAttributeThermostatAbsMaxCoolSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77038,8 +84439,11 @@ class ReadThermostatPICoolingDemand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePICoolingDemandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PICoolingDemand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat PICoolingDemand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77083,6 +84487,11 @@ class SubscribeAttributeThermostatPICoolingDemand : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PICoolingDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77116,8 +84525,11 @@ class ReadThermostatPIHeatingDemand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIHeatingDemandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PIHeatingDemand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat PIHeatingDemand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77161,6 +84573,11 @@ class SubscribeAttributeThermostatPIHeatingDemand : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PIHeatingDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77194,8 +84611,11 @@ class ReadThermostatHVACSystemTypeConfiguration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHVACSystemTypeConfigurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.HVACSystemTypeConfiguration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat HVACSystemTypeConfiguration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77238,6 +84658,8 @@ class WriteThermostatHVACSystemTypeConfiguration : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat HVACSystemTypeConfiguration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77284,6 +84706,11 @@ class SubscribeAttributeThermostatHVACSystemTypeConfiguration : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.HVACSystemTypeConfiguration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77317,8 +84744,11 @@ class ReadThermostatLocalTemperatureCalibration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTemperatureCalibrationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperatureCalibration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat LocalTemperatureCalibration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77361,6 +84791,8 @@ class WriteThermostatLocalTemperatureCalibration : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat LocalTemperatureCalibration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77407,6 +84839,11 @@ class SubscribeAttributeThermostatLocalTemperatureCalibration : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperatureCalibration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77440,8 +84877,11 @@ class ReadThermostatOccupiedCoolingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedCoolingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedCoolingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77483,6 +84923,8 @@ class WriteThermostatOccupiedCoolingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedCoolingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77529,6 +84971,11 @@ class SubscribeAttributeThermostatOccupiedCoolingSetpoint : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77562,8 +85009,11 @@ class ReadThermostatOccupiedHeatingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedHeatingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedHeatingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77605,6 +85055,8 @@ class WriteThermostatOccupiedHeatingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedHeatingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77651,6 +85103,11 @@ class SubscribeAttributeThermostatOccupiedHeatingSetpoint : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77684,8 +85141,11 @@ class ReadThermostatUnoccupiedCoolingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedCoolingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedCoolingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77728,6 +85188,8 @@ class WriteThermostatUnoccupiedCoolingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedCoolingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77774,6 +85236,11 @@ class SubscribeAttributeThermostatUnoccupiedCoolingSetpoint : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77807,8 +85274,11 @@ class ReadThermostatUnoccupiedHeatingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedHeatingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedHeatingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77851,6 +85321,8 @@ class WriteThermostatUnoccupiedHeatingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedHeatingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77897,6 +85369,11 @@ class SubscribeAttributeThermostatUnoccupiedHeatingSetpoint : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77930,8 +85407,11 @@ class ReadThermostatMinHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77973,6 +85453,8 @@ class WriteThermostatMinHeatSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinHeatSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78019,6 +85501,11 @@ class SubscribeAttributeThermostatMinHeatSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78052,8 +85539,11 @@ class ReadThermostatMaxHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MaxHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78095,6 +85585,8 @@ class WriteThermostatMaxHeatSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MaxHeatSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78141,6 +85633,11 @@ class SubscribeAttributeThermostatMaxHeatSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78174,8 +85671,11 @@ class ReadThermostatMinCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78217,6 +85717,8 @@ class WriteThermostatMinCoolSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinCoolSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78263,6 +85765,11 @@ class SubscribeAttributeThermostatMinCoolSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78296,8 +85803,11 @@ class ReadThermostatMaxCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MaxCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78339,6 +85849,8 @@ class WriteThermostatMaxCoolSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MaxCoolSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78385,6 +85897,11 @@ class SubscribeAttributeThermostatMaxCoolSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78418,8 +85935,11 @@ class ReadThermostatMinSetpointDeadBand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinSetpointDeadBandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinSetpointDeadBand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78461,6 +85981,8 @@ class WriteThermostatMinSetpointDeadBand : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinSetpointDeadBand write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78507,6 +86029,11 @@ class SubscribeAttributeThermostatMinSetpointDeadBand : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78540,8 +86067,11 @@ class ReadThermostatRemoteSensing : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemoteSensingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.RemoteSensing response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat RemoteSensing read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78583,6 +86113,8 @@ class WriteThermostatRemoteSensing : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat RemoteSensing write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78629,6 +86161,11 @@ class SubscribeAttributeThermostatRemoteSensing : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.RemoteSensing response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78662,8 +86199,11 @@ class ReadThermostatControlSequenceOfOperation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeControlSequenceOfOperationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ControlSequenceOfOperation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78706,6 +86246,8 @@ class WriteThermostatControlSequenceOfOperation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ControlSequenceOfOperation write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78752,6 +86294,11 @@ class SubscribeAttributeThermostatControlSequenceOfOperation : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78785,8 +86332,11 @@ class ReadThermostatSystemMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSystemModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SystemMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SystemMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78828,6 +86378,8 @@ class WriteThermostatSystemMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat SystemMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78874,6 +86426,11 @@ class SubscribeAttributeThermostatSystemMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SystemMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78907,8 +86464,11 @@ class ReadThermostatThermostatRunningMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThermostatRunningModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatRunningMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78952,6 +86512,11 @@ class SubscribeAttributeThermostatThermostatRunningMode : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78985,8 +86550,11 @@ class ReadThermostatStartOfWeek : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartOfWeekWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.StartOfWeek response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat StartOfWeek read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79030,6 +86598,11 @@ class SubscribeAttributeThermostatStartOfWeek : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.StartOfWeek response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79063,8 +86636,11 @@ class ReadThermostatNumberOfWeeklyTransitions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfWeeklyTransitionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat NumberOfWeeklyTransitions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79108,6 +86684,11 @@ class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79141,8 +86722,11 @@ class ReadThermostatNumberOfDailyTransitions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfDailyTransitionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat NumberOfDailyTransitions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79186,6 +86770,11 @@ class SubscribeAttributeThermostatNumberOfDailyTransitions : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79219,8 +86808,11 @@ class ReadThermostatTemperatureSetpointHold : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureSetpointHoldWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat TemperatureSetpointHold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79262,6 +86854,8 @@ class WriteThermostatTemperatureSetpointHold : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat TemperatureSetpointHold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79308,6 +86902,11 @@ class SubscribeAttributeThermostatTemperatureSetpointHold : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79342,8 +86941,11 @@ class ReadThermostatTemperatureSetpointHoldDuration : public ReadAttribute { [cluster readAttributeTemperatureSetpointHoldDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat TemperatureSetpointHoldDuration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79378,7 +86980,10 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeTemperatureSetpointHoldDurationWithValue:value @@ -79387,6 +86992,8 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { if (error != nil) { LogNSError("Thermostat TemperatureSetpointHoldDuration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79394,7 +87001,7 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatTemperatureSetpointHoldDuration : public SubscribeAttribute { @@ -79433,6 +87040,11 @@ class SubscribeAttributeThermostatTemperatureSetpointHoldDuration : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79468,8 +87080,11 @@ class ReadThermostatThermostatProgrammingOperationMode : public ReadAttribute { [cluster readAttributeThermostatProgrammingOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatProgrammingOperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatProgrammingOperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79515,6 +87130,8 @@ class WriteThermostatThermostatProgrammingOperationMode : public WriteAttribute LogNSError( "Thermostat ThermostatProgrammingOperationMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79561,6 +87178,11 @@ class SubscribeAttributeThermostatThermostatProgrammingOperationMode : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatProgrammingOperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79594,8 +87216,11 @@ class ReadThermostatThermostatRunningState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThermostatRunningStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatRunningState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79639,6 +87264,11 @@ class SubscribeAttributeThermostatThermostatRunningState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79672,8 +87302,11 @@ class ReadThermostatSetpointChangeSource : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeSourceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79717,6 +87350,11 @@ class SubscribeAttributeThermostatSetpointChangeSource : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79750,8 +87388,11 @@ class ReadThermostatSetpointChangeAmount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeAmountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeAmount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79795,6 +87436,11 @@ class SubscribeAttributeThermostatSetpointChangeAmount : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79828,8 +87474,11 @@ class ReadThermostatSetpointChangeSourceTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeSourceTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeSourceTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79873,6 +87522,11 @@ class SubscribeAttributeThermostatSetpointChangeSourceTimestamp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79906,8 +87560,11 @@ class ReadThermostatOccupiedSetback : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetback response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetback read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79942,13 +87599,18 @@ class WriteThermostatOccupiedSetback : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOccupiedSetbackWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedSetback write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79956,7 +87618,7 @@ class WriteThermostatOccupiedSetback : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatOccupiedSetback : public SubscribeAttribute { @@ -79995,6 +87657,11 @@ class SubscribeAttributeThermostatOccupiedSetback : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetback response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80028,8 +87695,11 @@ class ReadThermostatOccupiedSetbackMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetbackMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80073,6 +87743,11 @@ class SubscribeAttributeThermostatOccupiedSetbackMin : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80106,8 +87781,11 @@ class ReadThermostatOccupiedSetbackMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetbackMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80151,6 +87829,11 @@ class SubscribeAttributeThermostatOccupiedSetbackMax : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80184,8 +87867,11 @@ class ReadThermostatUnoccupiedSetback : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetback response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetback read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80220,13 +87906,18 @@ class WriteThermostatUnoccupiedSetback : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeUnoccupiedSetbackWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedSetback write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80234,7 +87925,7 @@ class WriteThermostatUnoccupiedSetback : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatUnoccupiedSetback : public SubscribeAttribute { @@ -80273,6 +87964,11 @@ class SubscribeAttributeThermostatUnoccupiedSetback : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetback response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80306,8 +88002,11 @@ class ReadThermostatUnoccupiedSetbackMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetbackMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80351,6 +88050,11 @@ class SubscribeAttributeThermostatUnoccupiedSetbackMin : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80384,8 +88088,11 @@ class ReadThermostatUnoccupiedSetbackMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetbackMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80429,6 +88136,11 @@ class SubscribeAttributeThermostatUnoccupiedSetbackMax : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80462,8 +88174,11 @@ class ReadThermostatEmergencyHeatDelta : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEmergencyHeatDeltaWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EmergencyHeatDelta response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat EmergencyHeatDelta read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80505,6 +88220,8 @@ class WriteThermostatEmergencyHeatDelta : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat EmergencyHeatDelta write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80551,6 +88268,11 @@ class SubscribeAttributeThermostatEmergencyHeatDelta : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EmergencyHeatDelta response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80584,8 +88306,11 @@ class ReadThermostatACType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80627,6 +88352,8 @@ class WriteThermostatACType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80673,6 +88400,11 @@ class SubscribeAttributeThermostatACType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80706,8 +88438,11 @@ class ReadThermostatACCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80749,6 +88484,8 @@ class WriteThermostatACCapacity : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCapacity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80795,6 +88532,11 @@ class SubscribeAttributeThermostatACCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80828,8 +88570,11 @@ class ReadThermostatACRefrigerantType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACRefrigerantTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACRefrigerantType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACRefrigerantType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80871,6 +88616,8 @@ class WriteThermostatACRefrigerantType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACRefrigerantType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80917,6 +88664,11 @@ class SubscribeAttributeThermostatACRefrigerantType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACRefrigerantType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80950,8 +88702,11 @@ class ReadThermostatACCompressorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCompressorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCompressorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCompressorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80993,6 +88748,8 @@ class WriteThermostatACCompressorType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCompressorType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81039,6 +88796,11 @@ class SubscribeAttributeThermostatACCompressorType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCompressorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81072,8 +88834,11 @@ class ReadThermostatACErrorCode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACErrorCodeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACErrorCode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACErrorCode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81115,6 +88880,8 @@ class WriteThermostatACErrorCode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACErrorCode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81161,6 +88928,11 @@ class SubscribeAttributeThermostatACErrorCode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACErrorCode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81194,8 +88966,11 @@ class ReadThermostatACLouverPosition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACLouverPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACLouverPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACLouverPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81237,6 +89012,8 @@ class WriteThermostatACLouverPosition : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACLouverPosition write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81283,6 +89060,11 @@ class SubscribeAttributeThermostatACLouverPosition : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACLouverPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81316,8 +89098,11 @@ class ReadThermostatACCoilTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCoilTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCoilTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCoilTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81361,6 +89146,11 @@ class SubscribeAttributeThermostatACCoilTemperature : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCoilTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81394,8 +89184,11 @@ class ReadThermostatACCapacityformat : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCapacityformatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCapacityformat read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81437,6 +89230,8 @@ class WriteThermostatACCapacityformat : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCapacityformat write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81483,6 +89278,11 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81516,8 +89316,11 @@ class ReadThermostatGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81561,6 +89364,11 @@ class SubscribeAttributeThermostatGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81594,8 +89402,11 @@ class ReadThermostatAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81639,6 +89450,11 @@ class SubscribeAttributeThermostatAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81674,8 +89490,11 @@ class ReadThermostatEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81719,6 +89538,11 @@ class SubscribeAttributeThermostatEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81754,8 +89578,11 @@ class ReadThermostatAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81799,6 +89626,11 @@ class SubscribeAttributeThermostatAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81832,8 +89664,11 @@ class ReadThermostatFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81877,6 +89712,11 @@ class SubscribeAttributeThermostatFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81910,8 +89750,11 @@ class ReadThermostatClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81955,6 +89798,11 @@ class SubscribeAttributeThermostatClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82041,6 +89889,7 @@ class FanControlStep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -82082,8 +89931,11 @@ class ReadFanControlFanMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFanModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FanMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82125,6 +89977,8 @@ class WriteFanControlFanMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl FanMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82171,6 +90025,11 @@ class SubscribeAttributeFanControlFanMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82204,8 +90063,11 @@ class ReadFanControlFanModeSequence : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFanModeSequenceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanModeSequence response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FanModeSequence read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82247,6 +90109,8 @@ class WriteFanControlFanModeSequence : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl FanModeSequence write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82293,6 +90157,11 @@ class SubscribeAttributeFanControlFanModeSequence : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanModeSequence response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82326,8 +90195,11 @@ class ReadFanControlPercentSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePercentSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl PercentSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82362,13 +90234,18 @@ class WriteFanControlPercentSetting : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributePercentSettingWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl PercentSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82376,7 +90253,7 @@ class WriteFanControlPercentSetting : public WriteAttribute { } private: - chip::Percent mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { @@ -82415,6 +90292,11 @@ class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82448,8 +90330,11 @@ class ReadFanControlPercentCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePercentCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl PercentCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82493,6 +90378,11 @@ class SubscribeAttributeFanControlPercentCurrent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82526,8 +90416,11 @@ class ReadFanControlSpeedMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82571,6 +90464,11 @@ class SubscribeAttributeFanControlSpeedMax : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82604,8 +90502,11 @@ class ReadFanControlSpeedSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82640,13 +90541,18 @@ class WriteFanControlSpeedSetting : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeSpeedSettingWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl SpeedSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82654,7 +90560,7 @@ class WriteFanControlSpeedSetting : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { @@ -82693,6 +90599,11 @@ class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82726,8 +90637,11 @@ class ReadFanControlSpeedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82771,6 +90685,11 @@ class SubscribeAttributeFanControlSpeedCurrent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82804,8 +90723,11 @@ class ReadFanControlRockSupport : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRockSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl RockSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82849,6 +90771,11 @@ class SubscribeAttributeFanControlRockSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82882,8 +90809,11 @@ class ReadFanControlRockSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRockSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl RockSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82925,6 +90855,8 @@ class WriteFanControlRockSetting : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl RockSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82971,6 +90903,11 @@ class SubscribeAttributeFanControlRockSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83004,8 +90941,11 @@ class ReadFanControlWindSupport : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl WindSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83049,6 +90989,11 @@ class SubscribeAttributeFanControlWindSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83082,8 +91027,11 @@ class ReadFanControlWindSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl WindSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83125,6 +91073,8 @@ class WriteFanControlWindSetting : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl WindSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83171,6 +91121,11 @@ class SubscribeAttributeFanControlWindSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83206,8 +91161,11 @@ class ReadFanControlAirflowDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAirflowDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AirflowDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AirflowDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83249,6 +91207,8 @@ class WriteFanControlAirflowDirection : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl AirflowDirection write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83295,6 +91255,11 @@ class SubscribeAttributeFanControlAirflowDirection : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AirflowDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83330,8 +91295,11 @@ class ReadFanControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83375,6 +91343,11 @@ class SubscribeAttributeFanControlGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83408,8 +91381,11 @@ class ReadFanControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83453,6 +91429,11 @@ class SubscribeAttributeFanControlAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83488,8 +91469,11 @@ class ReadFanControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83533,6 +91517,11 @@ class SubscribeAttributeFanControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83568,8 +91557,11 @@ class ReadFanControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83613,6 +91605,11 @@ class SubscribeAttributeFanControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83646,8 +91643,11 @@ class ReadFanControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83691,6 +91691,11 @@ class SubscribeAttributeFanControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83724,8 +91729,11 @@ class ReadFanControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83769,6 +91777,11 @@ class SubscribeAttributeFanControlClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83822,8 +91835,11 @@ class ReadThermostatUserInterfaceConfigurationTemperatureDisplayMode : public Re queue:callbackQueue]; [cluster readAttributeTemperatureDisplayModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.TemperatureDisplayMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration TemperatureDisplayMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83868,6 +91884,8 @@ class WriteThermostatUserInterfaceConfigurationTemperatureDisplayMode : public W LogNSError("ThermostatUserInterfaceConfiguration " "TemperatureDisplayMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83915,6 +91933,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationTemperatureDisplayMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.TemperatureDisplayMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83949,8 +91972,11 @@ class ReadThermostatUserInterfaceConfigurationKeypadLockout : public ReadAttribu queue:callbackQueue]; [cluster readAttributeKeypadLockoutWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.KeypadLockout response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration KeypadLockout read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83994,6 +92020,8 @@ class WriteThermostatUserInterfaceConfigurationKeypadLockout : public WriteAttri completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ThermostatUserInterfaceConfiguration KeypadLockout write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84041,6 +92069,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationKeypadLockout : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.KeypadLockout response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84075,8 +92108,11 @@ class ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility : pu queue:callbackQueue]; [cluster readAttributeScheduleProgrammingVisibilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84121,6 +92157,8 @@ class WriteThermostatUserInterfaceConfigurationScheduleProgrammingVisibility : p LogNSError("ThermostatUserInterfaceConfiguration " "ScheduleProgrammingVisibility write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84168,6 +92206,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationScheduleProgrammingV } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84202,8 +92245,11 @@ class ReadThermostatUserInterfaceConfigurationGeneratedCommandList : public Read queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84248,6 +92294,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationGeneratedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84282,8 +92333,11 @@ class ReadThermostatUserInterfaceConfigurationAcceptedCommandList : public ReadA queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84328,6 +92382,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84364,8 +92423,11 @@ class ReadThermostatUserInterfaceConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84410,6 +92472,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationEventList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84446,8 +92513,11 @@ class ReadThermostatUserInterfaceConfigurationAttributeList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84492,6 +92562,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationAttributeList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84526,8 +92601,11 @@ class ReadThermostatUserInterfaceConfigurationFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84572,6 +92650,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84606,8 +92689,11 @@ class ReadThermostatUserInterfaceConfigurationClusterRevision : public ReadAttri queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84652,6 +92738,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationClusterRevision : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84785,17 +92876,19 @@ class ColorControlMoveToHue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToHueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToHueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -84847,6 +92940,7 @@ class ColorControlMoveHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -84905,6 +92999,7 @@ class ColorControlStepHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -84961,6 +93056,8 @@ class ColorControlMoveToSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85017,6 +93114,8 @@ class ColorControlMoveSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85075,6 +93174,8 @@ class ColorControlStepSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85133,6 +93234,8 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85185,17 +93288,19 @@ class ColorControlMoveToColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85241,17 +93346,19 @@ class ColorControlMoveColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85299,17 +93406,19 @@ class ColorControlStepColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stepColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85361,6 +93470,8 @@ class ColorControlMoveToColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85419,6 +93530,8 @@ class ColorControlEnhancedMoveToHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85475,6 +93588,8 @@ class ColorControlEnhancedMoveHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85533,6 +93648,8 @@ class ColorControlEnhancedStepHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85591,6 +93708,8 @@ class ColorControlEnhancedMoveToHueAndSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85647,17 +93766,19 @@ class ColorControlColorLoopSet : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster colorLoopSetWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + colorLoopSetWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85699,17 +93820,19 @@ class ColorControlStopMoveStep : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopMoveStepWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopMoveStepWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85765,6 +93888,8 @@ class ColorControlMoveColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85827,6 +93952,8 @@ class ColorControlStepColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85866,8 +93993,11 @@ class ReadColorControlCurrentHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -85911,6 +94041,11 @@ class SubscribeAttributeColorControlCurrentHue : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -85944,8 +94079,11 @@ class ReadColorControlCurrentSaturation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentSaturationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentSaturation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentSaturation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -85989,6 +94127,11 @@ class SubscribeAttributeColorControlCurrentSaturation : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentSaturation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86022,8 +94165,11 @@ class ReadColorControlRemainingTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.RemainingTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl RemainingTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86067,6 +94213,11 @@ class SubscribeAttributeColorControlRemainingTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.RemainingTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86100,8 +94251,11 @@ class ReadColorControlCurrentX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86145,6 +94299,11 @@ class SubscribeAttributeColorControlCurrentX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86178,8 +94337,11 @@ class ReadColorControlCurrentY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86223,6 +94385,11 @@ class SubscribeAttributeColorControlCurrentY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86256,8 +94423,11 @@ class ReadColorControlDriftCompensation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDriftCompensationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.DriftCompensation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl DriftCompensation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86301,6 +94471,11 @@ class SubscribeAttributeColorControlDriftCompensation : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.DriftCompensation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86334,8 +94509,11 @@ class ReadColorControlCompensationText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCompensationTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CompensationText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CompensationText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86379,6 +94557,11 @@ class SubscribeAttributeColorControlCompensationText : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CompensationText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86412,8 +94595,11 @@ class ReadColorControlColorTemperatureMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTemperatureMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTemperatureMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTemperatureMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86457,6 +94643,11 @@ class SubscribeAttributeColorControlColorTemperatureMireds : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTemperatureMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86490,8 +94681,11 @@ class ReadColorControlColorMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86535,6 +94729,11 @@ class SubscribeAttributeColorControlColorMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86568,8 +94767,11 @@ class ReadColorControlOptions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Options response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Options read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86611,6 +94813,8 @@ class WriteColorControlOptions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl Options write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86657,6 +94861,11 @@ class SubscribeAttributeColorControlOptions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Options response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86690,8 +94899,11 @@ class ReadColorControlNumberOfPrimaries : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfPrimariesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.NumberOfPrimaries response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl NumberOfPrimaries read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86735,6 +94947,11 @@ class SubscribeAttributeColorControlNumberOfPrimaries : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.NumberOfPrimaries response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86768,8 +94985,11 @@ class ReadColorControlPrimary1X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86813,6 +95033,11 @@ class SubscribeAttributeColorControlPrimary1X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86846,8 +95071,11 @@ class ReadColorControlPrimary1Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86891,6 +95119,11 @@ class SubscribeAttributeColorControlPrimary1Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86924,8 +95157,11 @@ class ReadColorControlPrimary1Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86969,6 +95205,11 @@ class SubscribeAttributeColorControlPrimary1Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87002,8 +95243,11 @@ class ReadColorControlPrimary2X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87047,6 +95291,11 @@ class SubscribeAttributeColorControlPrimary2X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87080,8 +95329,11 @@ class ReadColorControlPrimary2Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87125,6 +95377,11 @@ class SubscribeAttributeColorControlPrimary2Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87158,8 +95415,11 @@ class ReadColorControlPrimary2Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87203,6 +95463,11 @@ class SubscribeAttributeColorControlPrimary2Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87236,8 +95501,11 @@ class ReadColorControlPrimary3X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87281,6 +95549,11 @@ class SubscribeAttributeColorControlPrimary3X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87314,8 +95587,11 @@ class ReadColorControlPrimary3Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87359,6 +95635,11 @@ class SubscribeAttributeColorControlPrimary3Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87392,8 +95673,11 @@ class ReadColorControlPrimary3Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87437,6 +95721,11 @@ class SubscribeAttributeColorControlPrimary3Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87470,8 +95759,11 @@ class ReadColorControlPrimary4X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87515,6 +95807,11 @@ class SubscribeAttributeColorControlPrimary4X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87548,8 +95845,11 @@ class ReadColorControlPrimary4Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87593,6 +95893,11 @@ class SubscribeAttributeColorControlPrimary4Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87626,8 +95931,11 @@ class ReadColorControlPrimary4Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87671,6 +95979,11 @@ class SubscribeAttributeColorControlPrimary4Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87704,8 +96017,11 @@ class ReadColorControlPrimary5X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87749,6 +96065,11 @@ class SubscribeAttributeColorControlPrimary5X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87782,8 +96103,11 @@ class ReadColorControlPrimary5Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87827,6 +96151,11 @@ class SubscribeAttributeColorControlPrimary5Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87860,8 +96189,11 @@ class ReadColorControlPrimary5Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87905,6 +96237,11 @@ class SubscribeAttributeColorControlPrimary5Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87938,8 +96275,11 @@ class ReadColorControlPrimary6X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87983,6 +96323,11 @@ class SubscribeAttributeColorControlPrimary6X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88016,8 +96361,11 @@ class ReadColorControlPrimary6Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88061,6 +96409,11 @@ class SubscribeAttributeColorControlPrimary6Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88094,8 +96447,11 @@ class ReadColorControlPrimary6Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88139,6 +96495,11 @@ class SubscribeAttributeColorControlPrimary6Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88172,8 +96533,11 @@ class ReadColorControlWhitePointX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWhitePointXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl WhitePointX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88215,6 +96579,8 @@ class WriteColorControlWhitePointX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl WhitePointX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88261,6 +96627,11 @@ class SubscribeAttributeColorControlWhitePointX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88294,8 +96665,11 @@ class ReadColorControlWhitePointY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWhitePointYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl WhitePointY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88337,6 +96711,8 @@ class WriteColorControlWhitePointY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl WhitePointY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88383,6 +96759,11 @@ class SubscribeAttributeColorControlWhitePointY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88416,8 +96797,11 @@ class ReadColorControlColorPointRX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88459,6 +96843,8 @@ class WriteColorControlColorPointRX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88505,6 +96891,11 @@ class SubscribeAttributeColorControlColorPointRX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88538,8 +96929,11 @@ class ReadColorControlColorPointRY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88581,6 +96975,8 @@ class WriteColorControlColorPointRY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88627,6 +97023,11 @@ class SubscribeAttributeColorControlColorPointRY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88660,8 +97061,11 @@ class ReadColorControlColorPointRIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88696,13 +97100,18 @@ class WriteColorControlColorPointRIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointRIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88710,7 +97119,7 @@ class WriteColorControlColorPointRIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointRIntensity : public SubscribeAttribute { @@ -88749,6 +97158,11 @@ class SubscribeAttributeColorControlColorPointRIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88782,8 +97196,11 @@ class ReadColorControlColorPointGX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88825,6 +97242,8 @@ class WriteColorControlColorPointGX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88871,6 +97290,11 @@ class SubscribeAttributeColorControlColorPointGX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88904,8 +97328,11 @@ class ReadColorControlColorPointGY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88947,6 +97374,8 @@ class WriteColorControlColorPointGY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88993,6 +97422,11 @@ class SubscribeAttributeColorControlColorPointGY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89026,8 +97460,11 @@ class ReadColorControlColorPointGIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89062,13 +97499,18 @@ class WriteColorControlColorPointGIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointGIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89076,7 +97518,7 @@ class WriteColorControlColorPointGIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointGIntensity : public SubscribeAttribute { @@ -89115,6 +97557,11 @@ class SubscribeAttributeColorControlColorPointGIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89148,8 +97595,11 @@ class ReadColorControlColorPointBX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89191,6 +97641,8 @@ class WriteColorControlColorPointBX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89237,6 +97689,11 @@ class SubscribeAttributeColorControlColorPointBX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89270,8 +97727,11 @@ class ReadColorControlColorPointBY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89313,6 +97773,8 @@ class WriteColorControlColorPointBY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89359,6 +97821,11 @@ class SubscribeAttributeColorControlColorPointBY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89392,8 +97859,11 @@ class ReadColorControlColorPointBIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89428,13 +97898,18 @@ class WriteColorControlColorPointBIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointBIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89442,7 +97917,7 @@ class WriteColorControlColorPointBIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointBIntensity : public SubscribeAttribute { @@ -89481,6 +97956,11 @@ class SubscribeAttributeColorControlColorPointBIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89514,8 +97994,11 @@ class ReadColorControlEnhancedCurrentHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnhancedCurrentHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedCurrentHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EnhancedCurrentHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89559,6 +98042,11 @@ class SubscribeAttributeColorControlEnhancedCurrentHue : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedCurrentHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89592,8 +98080,11 @@ class ReadColorControlEnhancedColorMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnhancedColorModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedColorMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EnhancedColorMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89637,6 +98128,11 @@ class SubscribeAttributeColorControlEnhancedColorMode : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedColorMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89670,8 +98166,11 @@ class ReadColorControlColorLoopActive : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopActiveWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopActive response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopActive read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89715,6 +98214,11 @@ class SubscribeAttributeColorControlColorLoopActive : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopActive response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89748,8 +98252,11 @@ class ReadColorControlColorLoopDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89793,6 +98300,11 @@ class SubscribeAttributeColorControlColorLoopDirection : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89826,8 +98338,11 @@ class ReadColorControlColorLoopTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89871,6 +98386,11 @@ class SubscribeAttributeColorControlColorLoopTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89904,8 +98424,11 @@ class ReadColorControlColorLoopStartEnhancedHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopStartEnhancedHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStartEnhancedHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopStartEnhancedHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89949,6 +98472,11 @@ class SubscribeAttributeColorControlColorLoopStartEnhancedHue : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStartEnhancedHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89982,8 +98510,11 @@ class ReadColorControlColorLoopStoredEnhancedHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopStoredEnhancedHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStoredEnhancedHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopStoredEnhancedHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90027,6 +98558,11 @@ class SubscribeAttributeColorControlColorLoopStoredEnhancedHue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStoredEnhancedHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90060,8 +98596,11 @@ class ReadColorControlColorCapabilities : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorCapabilitiesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorCapabilities response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90105,6 +98644,11 @@ class SubscribeAttributeColorControlColorCapabilities : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90138,8 +98682,11 @@ class ReadColorControlColorTempPhysicalMinMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTempPhysicalMinMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMinMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTempPhysicalMinMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90183,6 +98730,11 @@ class SubscribeAttributeColorControlColorTempPhysicalMinMireds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMinMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90216,8 +98768,11 @@ class ReadColorControlColorTempPhysicalMaxMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTempPhysicalMaxMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMaxMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTempPhysicalMaxMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90261,6 +98816,11 @@ class SubscribeAttributeColorControlColorTempPhysicalMaxMireds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMaxMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90296,8 +98856,11 @@ class ReadColorControlCoupleColorTempToLevelMinMireds : public ReadAttribute { [cluster readAttributeCoupleColorTempToLevelMinMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CoupleColorTempToLevelMinMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CoupleColorTempToLevelMinMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90341,6 +98904,11 @@ class SubscribeAttributeColorControlCoupleColorTempToLevelMinMireds : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CoupleColorTempToLevelMinMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90374,8 +98942,11 @@ class ReadColorControlStartUpColorTemperatureMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpColorTemperatureMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.StartUpColorTemperatureMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl StartUpColorTemperatureMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90410,7 +98981,10 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value @@ -90419,6 +98993,8 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { if (error != nil) { LogNSError( "ColorControl StartUpColorTemperatureMireds write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90426,7 +99002,7 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlStartUpColorTemperatureMireds : public SubscribeAttribute { @@ -90465,6 +99041,11 @@ class SubscribeAttributeColorControlStartUpColorTemperatureMireds : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.StartUpColorTemperatureMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90498,8 +99079,11 @@ class ReadColorControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90543,6 +99127,11 @@ class SubscribeAttributeColorControlGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90576,8 +99165,11 @@ class ReadColorControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90621,6 +99213,11 @@ class SubscribeAttributeColorControlAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90656,8 +99253,11 @@ class ReadColorControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90701,6 +99301,11 @@ class SubscribeAttributeColorControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90736,8 +99341,11 @@ class ReadColorControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90781,6 +99389,11 @@ class SubscribeAttributeColorControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90814,8 +99427,11 @@ class ReadColorControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90859,6 +99475,11 @@ class SubscribeAttributeColorControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90892,8 +99513,11 @@ class ReadColorControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90937,6 +99561,11 @@ class SubscribeAttributeColorControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91000,8 +99629,11 @@ class ReadBallastConfigurationPhysicalMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration PhysicalMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91045,6 +99677,11 @@ class SubscribeAttributeBallastConfigurationPhysicalMinLevel : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91078,8 +99715,11 @@ class ReadBallastConfigurationPhysicalMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration PhysicalMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91123,6 +99763,11 @@ class SubscribeAttributeBallastConfigurationPhysicalMaxLevel : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91156,8 +99801,11 @@ class ReadBallastConfigurationBallastStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBallastStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration BallastStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91201,6 +99849,11 @@ class SubscribeAttributeBallastConfigurationBallastStatus : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91234,8 +99887,11 @@ class ReadBallastConfigurationMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration MinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91277,6 +99933,8 @@ class WriteBallastConfigurationMinLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration MinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91323,6 +99981,11 @@ class SubscribeAttributeBallastConfigurationMinLevel : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91356,8 +100019,11 @@ class ReadBallastConfigurationMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration MaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91399,6 +100065,8 @@ class WriteBallastConfigurationMaxLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration MaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91445,6 +100113,11 @@ class SubscribeAttributeBallastConfigurationMaxLevel : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91478,8 +100151,11 @@ class ReadBallastConfigurationIntrinsicBallastFactor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeIntrinsicBallastFactorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.IntrinsicBallastFactor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration IntrinsicBallastFactor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91514,7 +100190,10 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeIntrinsicBallastFactorWithValue:value @@ -91522,6 +100201,8 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration IntrinsicBallastFactor write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91529,7 +100210,7 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationIntrinsicBallastFactor : public SubscribeAttribute { @@ -91568,6 +100249,11 @@ class SubscribeAttributeBallastConfigurationIntrinsicBallastFactor : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.IntrinsicBallastFactor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91602,8 +100288,11 @@ class ReadBallastConfigurationBallastFactorAdjustment : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBallastFactorAdjustmentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration BallastFactorAdjustment read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91639,7 +100328,10 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeBallastFactorAdjustmentWithValue:value params:params @@ -91647,6 +100339,8 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { if (error != nil) { LogNSError( "BallastConfiguration BallastFactorAdjustment write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91654,7 +100348,7 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public SubscribeAttribute { @@ -91693,6 +100387,11 @@ class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91726,8 +100425,11 @@ class ReadBallastConfigurationLampQuantity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampQuantityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampQuantity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91771,6 +100473,11 @@ class SubscribeAttributeBallastConfigurationLampQuantity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91804,8 +100511,11 @@ class ReadBallastConfigurationLampType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampTypeWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91849,6 +100559,8 @@ class WriteBallastConfigurationLampType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91895,6 +100607,11 @@ class SubscribeAttributeBallastConfigurationLampType : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91928,8 +100645,11 @@ class ReadBallastConfigurationLampManufacturer : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampManufacturerWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampManufacturer read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91973,6 +100693,8 @@ class WriteBallastConfigurationLampManufacturer : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampManufacturer write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92019,6 +100741,11 @@ class SubscribeAttributeBallastConfigurationLampManufacturer : public SubscribeA } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92052,8 +100779,11 @@ class ReadBallastConfigurationLampRatedHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampRatedHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampRatedHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92088,13 +100818,18 @@ class WriteBallastConfigurationLampRatedHours : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampRatedHoursWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampRatedHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92102,7 +100837,7 @@ class WriteBallastConfigurationLampRatedHours : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAttribute { @@ -92141,6 +100876,11 @@ class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92174,8 +100914,11 @@ class ReadBallastConfigurationLampBurnHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampBurnHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampBurnHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92210,13 +100953,18 @@ class WriteBallastConfigurationLampBurnHours : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampBurnHoursWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampBurnHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92224,7 +100972,7 @@ class WriteBallastConfigurationLampBurnHours : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttribute { @@ -92263,6 +101011,11 @@ class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92296,8 +101049,11 @@ class ReadBallastConfigurationLampAlarmMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampAlarmModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampAlarmMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92339,6 +101095,8 @@ class WriteBallastConfigurationLampAlarmMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampAlarmMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92385,6 +101143,11 @@ class SubscribeAttributeBallastConfigurationLampAlarmMode : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92418,8 +101181,11 @@ class ReadBallastConfigurationLampBurnHoursTripPoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampBurnHoursTripPointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampBurnHoursTripPoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92454,7 +101220,10 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampBurnHoursTripPointWithValue:value @@ -92462,6 +101231,8 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampBurnHoursTripPoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92469,7 +101240,7 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public SubscribeAttribute { @@ -92508,6 +101279,11 @@ class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92541,8 +101317,11 @@ class ReadBallastConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92586,6 +101365,11 @@ class SubscribeAttributeBallastConfigurationGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92619,8 +101403,11 @@ class ReadBallastConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92664,6 +101451,11 @@ class SubscribeAttributeBallastConfigurationAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92699,8 +101491,11 @@ class ReadBallastConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92744,6 +101539,11 @@ class SubscribeAttributeBallastConfigurationEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92779,8 +101579,11 @@ class ReadBallastConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92824,6 +101627,11 @@ class SubscribeAttributeBallastConfigurationAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92857,8 +101665,11 @@ class ReadBallastConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92902,6 +101713,11 @@ class SubscribeAttributeBallastConfigurationFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92935,8 +101751,11 @@ class ReadBallastConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92980,6 +101799,11 @@ class SubscribeAttributeBallastConfigurationClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93034,8 +101858,11 @@ class ReadIlluminanceMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93079,6 +101906,11 @@ class SubscribeAttributeIlluminanceMeasurementMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93112,8 +101944,11 @@ class ReadIlluminanceMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93157,6 +101992,11 @@ class SubscribeAttributeIlluminanceMeasurementMinMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93190,8 +102030,11 @@ class ReadIlluminanceMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93235,6 +102078,11 @@ class SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93268,8 +102116,11 @@ class ReadIlluminanceMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93313,6 +102164,11 @@ class SubscribeAttributeIlluminanceMeasurementTolerance : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93346,8 +102202,11 @@ class ReadIlluminanceMeasurementLightSensorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLightSensorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement LightSensorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93391,6 +102250,11 @@ class SubscribeAttributeIlluminanceMeasurementLightSensorType : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93424,8 +102288,11 @@ class ReadIlluminanceMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93469,6 +102336,11 @@ class SubscribeAttributeIlluminanceMeasurementGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93502,8 +102374,11 @@ class ReadIlluminanceMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93547,6 +102422,11 @@ class SubscribeAttributeIlluminanceMeasurementAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93582,8 +102462,11 @@ class ReadIlluminanceMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93627,6 +102510,11 @@ class SubscribeAttributeIlluminanceMeasurementEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93662,8 +102550,11 @@ class ReadIlluminanceMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93707,6 +102598,11 @@ class SubscribeAttributeIlluminanceMeasurementAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93740,8 +102636,11 @@ class ReadIlluminanceMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93785,6 +102684,11 @@ class SubscribeAttributeIlluminanceMeasurementFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93818,8 +102722,11 @@ class ReadIlluminanceMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93863,6 +102770,11 @@ class SubscribeAttributeIlluminanceMeasurementClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93916,8 +102828,11 @@ class ReadTemperatureMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93961,6 +102876,11 @@ class SubscribeAttributeTemperatureMeasurementMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93994,8 +102914,11 @@ class ReadTemperatureMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94039,6 +102962,11 @@ class SubscribeAttributeTemperatureMeasurementMinMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94072,8 +103000,11 @@ class ReadTemperatureMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94117,6 +103048,11 @@ class SubscribeAttributeTemperatureMeasurementMaxMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94150,8 +103086,11 @@ class ReadTemperatureMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94195,6 +103134,11 @@ class SubscribeAttributeTemperatureMeasurementTolerance : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94228,8 +103172,11 @@ class ReadTemperatureMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94273,6 +103220,11 @@ class SubscribeAttributeTemperatureMeasurementGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94306,8 +103258,11 @@ class ReadTemperatureMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94351,6 +103306,11 @@ class SubscribeAttributeTemperatureMeasurementAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94386,8 +103346,11 @@ class ReadTemperatureMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94431,6 +103394,11 @@ class SubscribeAttributeTemperatureMeasurementEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94466,8 +103434,11 @@ class ReadTemperatureMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94511,6 +103482,11 @@ class SubscribeAttributeTemperatureMeasurementAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94544,8 +103520,11 @@ class ReadTemperatureMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94589,6 +103568,11 @@ class SubscribeAttributeTemperatureMeasurementFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94622,8 +103606,11 @@ class ReadTemperatureMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94667,6 +103654,11 @@ class SubscribeAttributeTemperatureMeasurementClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94725,8 +103717,11 @@ class ReadPressureMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94770,6 +103765,11 @@ class SubscribeAttributePressureMeasurementMeasuredValue : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94803,8 +103803,11 @@ class ReadPressureMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94848,6 +103851,11 @@ class SubscribeAttributePressureMeasurementMinMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94881,8 +103889,11 @@ class ReadPressureMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94926,6 +103937,11 @@ class SubscribeAttributePressureMeasurementMaxMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94959,8 +103975,11 @@ class ReadPressureMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95004,6 +104023,11 @@ class SubscribeAttributePressureMeasurementTolerance : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95037,8 +104061,11 @@ class ReadPressureMeasurementScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95082,6 +104109,11 @@ class SubscribeAttributePressureMeasurementScaledValue : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95115,8 +104147,11 @@ class ReadPressureMeasurementMinScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MinScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95160,6 +104195,11 @@ class SubscribeAttributePressureMeasurementMinScaledValue : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95193,8 +104233,11 @@ class ReadPressureMeasurementMaxScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MaxScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95238,6 +104281,11 @@ class SubscribeAttributePressureMeasurementMaxScaledValue : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95271,8 +104319,11 @@ class ReadPressureMeasurementScaledTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaledToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ScaledTolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95316,6 +104367,11 @@ class SubscribeAttributePressureMeasurementScaledTolerance : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95349,8 +104405,11 @@ class ReadPressureMeasurementScale : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Scale response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement Scale read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95394,6 +104453,11 @@ class SubscribeAttributePressureMeasurementScale : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Scale response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95427,8 +104491,11 @@ class ReadPressureMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95472,6 +104539,11 @@ class SubscribeAttributePressureMeasurementGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95505,8 +104577,11 @@ class ReadPressureMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95550,6 +104625,11 @@ class SubscribeAttributePressureMeasurementAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95585,8 +104665,11 @@ class ReadPressureMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95630,6 +104713,11 @@ class SubscribeAttributePressureMeasurementEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95665,8 +104753,11 @@ class ReadPressureMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95710,6 +104801,11 @@ class SubscribeAttributePressureMeasurementAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95743,8 +104839,11 @@ class ReadPressureMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95788,6 +104887,11 @@ class SubscribeAttributePressureMeasurementFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95821,8 +104925,11 @@ class ReadPressureMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95866,6 +104973,11 @@ class SubscribeAttributePressureMeasurementClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95919,8 +105031,11 @@ class ReadFlowMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95964,6 +105079,11 @@ class SubscribeAttributeFlowMeasurementMeasuredValue : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95997,8 +105117,11 @@ class ReadFlowMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96042,6 +105165,11 @@ class SubscribeAttributeFlowMeasurementMinMeasuredValue : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96075,8 +105203,11 @@ class ReadFlowMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96120,6 +105251,11 @@ class SubscribeAttributeFlowMeasurementMaxMeasuredValue : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96153,8 +105289,11 @@ class ReadFlowMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96198,6 +105337,11 @@ class SubscribeAttributeFlowMeasurementTolerance : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96231,8 +105375,11 @@ class ReadFlowMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96276,6 +105423,11 @@ class SubscribeAttributeFlowMeasurementGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96309,8 +105461,11 @@ class ReadFlowMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96354,6 +105509,11 @@ class SubscribeAttributeFlowMeasurementAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96389,8 +105549,11 @@ class ReadFlowMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96434,6 +105597,11 @@ class SubscribeAttributeFlowMeasurementEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96469,8 +105637,11 @@ class ReadFlowMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96514,6 +105685,11 @@ class SubscribeAttributeFlowMeasurementAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96547,8 +105723,11 @@ class ReadFlowMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96592,6 +105771,11 @@ class SubscribeAttributeFlowMeasurementFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96625,8 +105809,11 @@ class ReadFlowMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96670,6 +105857,11 @@ class SubscribeAttributeFlowMeasurementClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96723,8 +105915,11 @@ class ReadRelativeHumidityMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96768,6 +105963,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMeasuredValue : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96802,8 +106002,11 @@ class ReadRelativeHumidityMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96847,6 +106050,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96881,8 +106089,11 @@ class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96926,6 +106137,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96959,8 +106175,11 @@ class ReadRelativeHumidityMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97004,6 +106223,11 @@ class SubscribeAttributeRelativeHumidityMeasurementTolerance : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97038,8 +106262,11 @@ class ReadRelativeHumidityMeasurementGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97084,6 +106311,11 @@ class SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97118,8 +106350,11 @@ class ReadRelativeHumidityMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97164,6 +106399,11 @@ class SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97199,8 +106439,11 @@ class ReadRelativeHumidityMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97244,6 +106487,11 @@ class SubscribeAttributeRelativeHumidityMeasurementEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97279,8 +106527,11 @@ class ReadRelativeHumidityMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97324,6 +106575,11 @@ class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97357,8 +106613,11 @@ class ReadRelativeHumidityMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97402,6 +106661,11 @@ class SubscribeAttributeRelativeHumidityMeasurementFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97435,8 +106699,11 @@ class ReadRelativeHumidityMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97480,6 +106747,11 @@ class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97541,8 +106813,11 @@ class ReadOccupancySensingOccupancy : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.Occupancy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing Occupancy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97586,6 +106861,11 @@ class SubscribeAttributeOccupancySensingOccupancy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.Occupancy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97619,8 +106899,11 @@ class ReadOccupancySensingOccupancySensorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancySensorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing OccupancySensorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97664,6 +106947,11 @@ class SubscribeAttributeOccupancySensingOccupancySensorType : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97697,8 +106985,11 @@ class ReadOccupancySensingOccupancySensorTypeBitmap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancySensorTypeBitmapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing OccupancySensorTypeBitmap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97742,6 +107033,11 @@ class SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97776,8 +107072,11 @@ class ReadOccupancySensingPIROccupiedToUnoccupiedDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIROccupiedToUnoccupiedDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIROccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIROccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97822,6 +107121,8 @@ class WriteOccupancySensingPIROccupiedToUnoccupiedDelay : public WriteAttribute if (error != nil) { LogNSError("OccupancySensing PIROccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97868,6 +107169,11 @@ class SubscribeAttributeOccupancySensingPIROccupiedToUnoccupiedDelay : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIROccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97902,8 +107208,11 @@ class ReadOccupancySensingPIRUnoccupiedToOccupiedDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIRUnoccupiedToOccupiedDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97948,6 +107257,8 @@ class WriteOccupancySensingPIRUnoccupiedToOccupiedDelay : public WriteAttribute if (error != nil) { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97994,6 +107305,11 @@ class SubscribeAttributeOccupancySensingPIRUnoccupiedToOccupiedDelay : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98029,8 +107345,11 @@ class ReadOccupancySensingPIRUnoccupiedToOccupiedThreshold : public ReadAttribut [cluster readAttributePIRUnoccupiedToOccupiedThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98075,6 +107394,8 @@ class WriteOccupancySensingPIRUnoccupiedToOccupiedThreshold : public WriteAttrib LogNSError("OccupancySensing " "PIRUnoccupiedToOccupiedThreshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98122,6 +107443,11 @@ class SubscribeAttributeOccupancySensingPIRUnoccupiedToOccupiedThreshold : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98157,8 +107483,11 @@ class ReadOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public ReadAttri [cluster readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicOccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicOccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98204,6 +107533,8 @@ class WriteOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public WriteAtt LogNSError("OccupancySensing " "UltrasonicOccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98251,6 +107582,11 @@ class SubscribeAttributeOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicOccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98286,8 +107622,11 @@ class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public ReadAttri [cluster readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98333,6 +107672,8 @@ class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public WriteAtt LogNSError("OccupancySensing " "UltrasonicUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98380,6 +107721,11 @@ class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98415,8 +107761,11 @@ class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public ReadA [cluster readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98463,6 +107812,8 @@ class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public Writ "OccupancySensing " "UltrasonicUnoccupiedToOccupiedThreshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98510,6 +107861,11 @@ class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98545,8 +107901,11 @@ class ReadOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Read [cluster readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactOccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactOccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98593,6 +107952,8 @@ class WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Wri "OccupancySensing " "PhysicalContactOccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98640,6 +108001,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactOccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98675,8 +108041,11 @@ class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Read [cluster readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98723,6 +108092,8 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Wri "OccupancySensing " "PhysicalContactUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98770,6 +108141,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98805,8 +108181,11 @@ class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public [cluster readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98852,6 +108231,9 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public "PhysicalContactUnoccupiedToOccupiedTh" "reshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), + error); } SetCommandExitStatus(error); }]; @@ -98899,6 +108281,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedThres } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98932,8 +108319,11 @@ class ReadOccupancySensingGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98977,6 +108367,11 @@ class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99010,8 +108405,11 @@ class ReadOccupancySensingAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99055,6 +108453,11 @@ class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99090,8 +108493,11 @@ class ReadOccupancySensingEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99135,6 +108541,11 @@ class SubscribeAttributeOccupancySensingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99170,8 +108581,11 @@ class ReadOccupancySensingAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99215,6 +108629,11 @@ class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99248,8 +108667,11 @@ class ReadOccupancySensingFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99293,6 +108715,11 @@ class SubscribeAttributeOccupancySensingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99326,8 +108753,11 @@ class ReadOccupancySensingClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99371,6 +108801,11 @@ class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99435,8 +108870,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasuredValue : public ReadAttri queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99481,6 +108919,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasuredValue : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99518,8 +108961,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMinMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99564,6 +109010,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMinMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99601,8 +109052,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMaxMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99647,6 +109101,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMaxMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99684,8 +109143,11 @@ class ReadCarbonMonoxideConcentrationMeasurementPeakMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99730,6 +109192,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99767,8 +109234,11 @@ class ReadCarbonMonoxideConcentrationMeasurementPeakMeasuredValueWindow : public queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99813,6 +109283,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementPeakMeasuredValueW } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99850,8 +109325,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAverageMeasuredValue : public Re queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99896,6 +109374,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAverageMeasuredVal } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99933,8 +109416,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAverageMeasuredValueWindow : pub queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99979,6 +109465,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAverageMeasuredVal } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100016,8 +109507,11 @@ class ReadCarbonMonoxideConcentrationMeasurementUncertainty : public ReadAttribu queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100062,6 +109556,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementUncertainty : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100099,8 +109598,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasurementUnit : public ReadAtt queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100145,6 +109647,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasurementUnit : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100182,8 +109689,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasurementMedium : public ReadA queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100228,6 +109738,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasurementMedium } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100265,8 +109780,11 @@ class ReadCarbonMonoxideConcentrationMeasurementLevelValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100311,6 +109829,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementLevelValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100348,8 +109871,11 @@ class ReadCarbonMonoxideConcentrationMeasurementGeneratedCommandList : public Re queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100394,6 +109920,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementGeneratedCommandLi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100431,8 +109962,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAcceptedCommandList : public Rea queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100477,6 +110011,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAcceptedCommandLis } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100514,8 +110053,11 @@ class ReadCarbonMonoxideConcentrationMeasurementEventList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100560,6 +110102,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementEventList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100597,8 +110144,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAttributeList : public ReadAttri queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100643,6 +110193,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAttributeList : pu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100680,8 +110235,11 @@ class ReadCarbonMonoxideConcentrationMeasurementFeatureMap : public ReadAttribut queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100726,6 +110284,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementFeatureMap : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100763,8 +110326,11 @@ class ReadCarbonMonoxideConcentrationMeasurementClusterRevision : public ReadAtt queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100809,6 +110375,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementClusterRevision : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100875,8 +110446,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasuredValue : public ReadAttrib queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100921,6 +110495,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasuredValue : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100958,8 +110537,11 @@ class ReadCarbonDioxideConcentrationMeasurementMinMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101004,6 +110586,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMinMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101041,8 +110628,11 @@ class ReadCarbonDioxideConcentrationMeasurementMaxMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101087,6 +110677,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMaxMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101124,8 +110719,11 @@ class ReadCarbonDioxideConcentrationMeasurementPeakMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101170,6 +110768,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementPeakMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101207,8 +110810,11 @@ class ReadCarbonDioxideConcentrationMeasurementPeakMeasuredValueWindow : public queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101253,6 +110859,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementPeakMeasuredValueWi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101290,8 +110901,11 @@ class ReadCarbonDioxideConcentrationMeasurementAverageMeasuredValue : public Rea queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101336,6 +110950,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAverageMeasuredValu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101373,8 +110992,11 @@ class ReadCarbonDioxideConcentrationMeasurementAverageMeasuredValueWindow : publ queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101419,6 +111041,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAverageMeasuredValu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101456,8 +111083,11 @@ class ReadCarbonDioxideConcentrationMeasurementUncertainty : public ReadAttribut queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101502,6 +111132,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementUncertainty : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101539,8 +111174,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasurementUnit : public ReadAttr queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101585,6 +111223,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasurementUnit : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101622,8 +111265,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasurementMedium : public ReadAt queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101668,6 +111314,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasurementMedium : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101705,8 +111356,11 @@ class ReadCarbonDioxideConcentrationMeasurementLevelValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101751,6 +111405,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementLevelValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101788,8 +111447,11 @@ class ReadCarbonDioxideConcentrationMeasurementGeneratedCommandList : public Rea queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101834,6 +111496,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementGeneratedCommandLis } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101871,8 +111538,11 @@ class ReadCarbonDioxideConcentrationMeasurementAcceptedCommandList : public Read queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101917,6 +111587,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101954,8 +111629,11 @@ class ReadCarbonDioxideConcentrationMeasurementEventList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102000,6 +111678,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementEventList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102037,8 +111720,11 @@ class ReadCarbonDioxideConcentrationMeasurementAttributeList : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102083,6 +111769,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAttributeList : pub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102120,8 +111811,11 @@ class ReadCarbonDioxideConcentrationMeasurementFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102166,6 +111860,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102203,8 +111902,11 @@ class ReadCarbonDioxideConcentrationMeasurementClusterRevision : public ReadAttr queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102249,6 +111951,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementClusterRevision : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102315,8 +112022,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102361,6 +112071,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102398,8 +112113,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMinMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102444,6 +112162,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMinMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102481,8 +112204,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMaxMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102527,6 +112253,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMaxMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102564,8 +112295,11 @@ class ReadNitrogenDioxideConcentrationMeasurementPeakMeasuredValue : public Read queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102610,6 +112344,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102647,8 +112386,11 @@ class ReadNitrogenDioxideConcentrationMeasurementPeakMeasuredValueWindow : publi queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102693,6 +112435,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102730,8 +112477,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAverageMeasuredValue : public R queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102776,6 +112526,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAverageMeasuredVa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102813,8 +112568,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAverageMeasuredValueWindow : pu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102859,6 +112617,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAverageMeasuredVa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102896,8 +112659,11 @@ class ReadNitrogenDioxideConcentrationMeasurementUncertainty : public ReadAttrib queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102942,6 +112708,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementUncertainty : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102979,8 +112750,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasurementUnit : public ReadAt queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103025,6 +112799,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasurementUnit : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103062,8 +112841,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasurementMedium : public Read queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103108,6 +112890,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasurementMedium } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103145,8 +112932,11 @@ class ReadNitrogenDioxideConcentrationMeasurementLevelValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103191,6 +112981,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementLevelValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103228,8 +113023,11 @@ class ReadNitrogenDioxideConcentrationMeasurementGeneratedCommandList : public R queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103274,6 +113072,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementGeneratedCommandL } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103311,8 +113114,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAcceptedCommandList : public Re queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103357,6 +113163,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAcceptedCommandLi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103394,8 +113205,11 @@ class ReadNitrogenDioxideConcentrationMeasurementEventList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103440,6 +113254,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementEventList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103477,8 +113296,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAttributeList : public ReadAttr queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103523,6 +113345,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAttributeList : p } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103560,8 +113387,11 @@ class ReadNitrogenDioxideConcentrationMeasurementFeatureMap : public ReadAttribu queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103606,6 +113436,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementFeatureMap : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103643,8 +113478,11 @@ class ReadNitrogenDioxideConcentrationMeasurementClusterRevision : public ReadAt queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103689,6 +113527,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementClusterRevision : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103754,8 +113597,11 @@ class ReadOzoneConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103799,6 +113645,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasuredValue : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103836,8 +113687,11 @@ class ReadOzoneConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103882,6 +113736,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMinMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103919,8 +113778,11 @@ class ReadOzoneConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103965,6 +113827,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMaxMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104002,8 +113869,11 @@ class ReadOzoneConcentrationMeasurementPeakMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104048,6 +113918,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementPeakMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104085,8 +113960,11 @@ class ReadOzoneConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttr queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104131,6 +114009,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementPeakMeasuredValueWindow : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104168,8 +114051,11 @@ class ReadOzoneConcentrationMeasurementAverageMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104214,6 +114100,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAverageMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104251,8 +114142,11 @@ class ReadOzoneConcentrationMeasurementAverageMeasuredValueWindow : public ReadA queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104297,6 +114191,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAverageMeasuredValueWindow } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104333,8 +114232,11 @@ class ReadOzoneConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104378,6 +114280,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementUncertainty : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104415,8 +114322,11 @@ class ReadOzoneConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104460,6 +114370,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasurementUnit : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104497,8 +114412,11 @@ class ReadOzoneConcentrationMeasurementMeasurementMedium : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104543,6 +114461,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasurementMedium : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104579,8 +114502,11 @@ class ReadOzoneConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104624,6 +114550,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementLevelValue : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104661,8 +114592,11 @@ class ReadOzoneConcentrationMeasurementGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104707,6 +114641,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104744,8 +114683,11 @@ class ReadOzoneConcentrationMeasurementAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104790,6 +114732,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104826,8 +114773,11 @@ class ReadOzoneConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104871,6 +114821,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104907,8 +114862,11 @@ class ReadOzoneConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104952,6 +114910,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104988,8 +114951,11 @@ class ReadOzoneConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105033,6 +114999,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105070,8 +115041,11 @@ class ReadOzoneConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105115,6 +115089,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105180,8 +115159,11 @@ class ReadPm25ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105225,6 +115207,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasuredValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105262,8 +115249,11 @@ class ReadPm25ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105307,6 +115297,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMinMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105344,8 +115339,11 @@ class ReadPm25ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105389,6 +115387,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMaxMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105426,8 +115429,11 @@ class ReadPm25ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105472,6 +115478,11 @@ class SubscribeAttributePm25ConcentrationMeasurementPeakMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105509,8 +115520,11 @@ class ReadPm25ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttri queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105555,6 +115569,11 @@ class SubscribeAttributePm25ConcentrationMeasurementPeakMeasuredValueWindow : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105592,8 +115611,11 @@ class ReadPm25ConcentrationMeasurementAverageMeasuredValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105638,6 +115660,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAverageMeasuredValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105675,8 +115702,11 @@ class ReadPm25ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105721,6 +115751,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105757,8 +115792,11 @@ class ReadPm25ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105802,6 +115840,11 @@ class SubscribeAttributePm25ConcentrationMeasurementUncertainty : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105839,8 +115882,11 @@ class ReadPm25ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105884,6 +115930,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasurementUnit : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105921,8 +115972,11 @@ class ReadPm25ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105967,6 +116021,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasurementMedium : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106003,8 +116062,11 @@ class ReadPm25ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106048,6 +116110,11 @@ class SubscribeAttributePm25ConcentrationMeasurementLevelValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106085,8 +116152,11 @@ class ReadPm25ConcentrationMeasurementGeneratedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106131,6 +116201,11 @@ class SubscribeAttributePm25ConcentrationMeasurementGeneratedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106168,8 +116243,11 @@ class ReadPm25ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106214,6 +116292,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106250,8 +116333,11 @@ class ReadPm25ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106295,6 +116381,11 @@ class SubscribeAttributePm25ConcentrationMeasurementEventList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106331,8 +116422,11 @@ class ReadPm25ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106376,6 +116470,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAttributeList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106412,8 +116511,11 @@ class ReadPm25ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106457,6 +116559,11 @@ class SubscribeAttributePm25ConcentrationMeasurementFeatureMap : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106494,8 +116601,11 @@ class ReadPm25ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106539,6 +116649,11 @@ class SubscribeAttributePm25ConcentrationMeasurementClusterRevision : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106605,8 +116720,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106651,6 +116769,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106688,8 +116811,11 @@ class ReadFormaldehydeConcentrationMeasurementMinMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106734,6 +116860,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMinMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106771,8 +116902,11 @@ class ReadFormaldehydeConcentrationMeasurementMaxMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106817,6 +116951,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMaxMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106854,8 +116993,11 @@ class ReadFormaldehydeConcentrationMeasurementPeakMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106900,6 +117042,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementPeakMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106937,8 +117084,11 @@ class ReadFormaldehydeConcentrationMeasurementPeakMeasuredValueWindow : public R queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106983,6 +117133,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementPeakMeasuredValueWin } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107020,8 +117175,11 @@ class ReadFormaldehydeConcentrationMeasurementAverageMeasuredValue : public Read queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107066,6 +117224,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAverageMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107103,8 +117266,11 @@ class ReadFormaldehydeConcentrationMeasurementAverageMeasuredValueWindow : publi queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107149,6 +117315,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAverageMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107186,8 +117357,11 @@ class ReadFormaldehydeConcentrationMeasurementUncertainty : public ReadAttribute queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107232,6 +117406,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementUncertainty : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107269,8 +117448,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasurementUnit : public ReadAttri queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107315,6 +117497,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasurementUnit : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107352,8 +117539,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasurementMedium : public ReadAtt queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107398,6 +117588,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasurementMedium : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107435,8 +117630,11 @@ class ReadFormaldehydeConcentrationMeasurementLevelValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107481,6 +117679,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementLevelValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107518,8 +117721,11 @@ class ReadFormaldehydeConcentrationMeasurementGeneratedCommandList : public Read queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107564,6 +117770,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementGeneratedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107601,8 +117812,11 @@ class ReadFormaldehydeConcentrationMeasurementAcceptedCommandList : public ReadA queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107647,6 +117861,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107684,8 +117903,11 @@ class ReadFormaldehydeConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107730,6 +117952,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementEventList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107767,8 +117994,11 @@ class ReadFormaldehydeConcentrationMeasurementAttributeList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107813,6 +118043,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAttributeList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107850,8 +118085,11 @@ class ReadFormaldehydeConcentrationMeasurementFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107896,6 +118134,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107933,8 +118176,11 @@ class ReadFormaldehydeConcentrationMeasurementClusterRevision : public ReadAttri queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107979,6 +118225,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementClusterRevision : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108044,8 +118295,11 @@ class ReadPm1ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108089,6 +118343,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasuredValue : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108126,8 +118385,11 @@ class ReadPm1ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108171,6 +118433,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMinMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108208,8 +118475,11 @@ class ReadPm1ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108253,6 +118523,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMaxMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108290,8 +118565,11 @@ class ReadPm1ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108335,6 +118613,11 @@ class SubscribeAttributePm1ConcentrationMeasurementPeakMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108372,8 +118655,11 @@ class ReadPm1ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttrib queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108418,6 +118704,11 @@ class SubscribeAttributePm1ConcentrationMeasurementPeakMeasuredValueWindow : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108455,8 +118746,11 @@ class ReadPm1ConcentrationMeasurementAverageMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108501,6 +118795,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAverageMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108538,8 +118837,11 @@ class ReadPm1ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAtt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108584,6 +118886,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108620,8 +118927,11 @@ class ReadPm1ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108665,6 +118975,11 @@ class SubscribeAttributePm1ConcentrationMeasurementUncertainty : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108701,8 +119016,11 @@ class ReadPm1ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108746,6 +119064,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasurementUnit : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108783,8 +119106,11 @@ class ReadPm1ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108828,6 +119154,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasurementMedium : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108864,8 +119195,11 @@ class ReadPm1ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108909,6 +119243,11 @@ class SubscribeAttributePm1ConcentrationMeasurementLevelValue : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108946,8 +119285,11 @@ class ReadPm1ConcentrationMeasurementGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108992,6 +119334,11 @@ class SubscribeAttributePm1ConcentrationMeasurementGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109029,8 +119376,11 @@ class ReadPm1ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109075,6 +119425,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109111,8 +119466,11 @@ class ReadPm1ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109156,6 +119514,11 @@ class SubscribeAttributePm1ConcentrationMeasurementEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109192,8 +119555,11 @@ class ReadPm1ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109237,6 +119603,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109273,8 +119644,11 @@ class ReadPm1ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109318,6 +119692,11 @@ class SubscribeAttributePm1ConcentrationMeasurementFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109354,8 +119733,11 @@ class ReadPm1ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109399,6 +119781,11 @@ class SubscribeAttributePm1ConcentrationMeasurementClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109464,8 +119851,11 @@ class ReadPm10ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109509,6 +119899,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasuredValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109546,8 +119941,11 @@ class ReadPm10ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109591,6 +119989,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMinMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109628,8 +120031,11 @@ class ReadPm10ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109673,6 +120079,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMaxMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109710,8 +120121,11 @@ class ReadPm10ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109756,6 +120170,11 @@ class SubscribeAttributePm10ConcentrationMeasurementPeakMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109793,8 +120212,11 @@ class ReadPm10ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttri queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109839,6 +120261,11 @@ class SubscribeAttributePm10ConcentrationMeasurementPeakMeasuredValueWindow : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109876,8 +120303,11 @@ class ReadPm10ConcentrationMeasurementAverageMeasuredValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109922,6 +120352,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAverageMeasuredValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109959,8 +120394,11 @@ class ReadPm10ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110005,6 +120443,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110041,8 +120484,11 @@ class ReadPm10ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110086,6 +120532,11 @@ class SubscribeAttributePm10ConcentrationMeasurementUncertainty : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110123,8 +120574,11 @@ class ReadPm10ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110168,6 +120622,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasurementUnit : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110205,8 +120664,11 @@ class ReadPm10ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110251,6 +120713,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasurementMedium : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110287,8 +120754,11 @@ class ReadPm10ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110332,6 +120802,11 @@ class SubscribeAttributePm10ConcentrationMeasurementLevelValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110369,8 +120844,11 @@ class ReadPm10ConcentrationMeasurementGeneratedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110415,6 +120893,11 @@ class SubscribeAttributePm10ConcentrationMeasurementGeneratedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110452,8 +120935,11 @@ class ReadPm10ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110498,6 +120984,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110534,8 +121025,11 @@ class ReadPm10ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110579,6 +121073,11 @@ class SubscribeAttributePm10ConcentrationMeasurementEventList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110615,8 +121114,11 @@ class ReadPm10ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110660,6 +121162,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAttributeList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110696,8 +121203,11 @@ class ReadPm10ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110741,6 +121251,11 @@ class SubscribeAttributePm10ConcentrationMeasurementFeatureMap : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110778,8 +121293,11 @@ class ReadPm10ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110823,6 +121341,11 @@ class SubscribeAttributePm10ConcentrationMeasurementClusterRevision : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110890,8 +121413,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValue : p queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110937,6 +121463,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110975,8 +121506,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValue queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111022,6 +121556,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMin } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111060,8 +121599,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValue queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111107,6 +121649,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMax } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111145,8 +121692,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValue queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111192,6 +121742,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementPea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111231,8 +121786,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValue [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111279,6 +121837,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementPea reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111317,8 +121880,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVa queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111365,6 +121931,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAve reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111404,8 +121975,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVa [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111453,6 +122027,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAve reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111491,8 +122070,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementUncertainty : pub queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111538,6 +122120,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementUnc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111576,8 +122163,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasurementUnit : queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111623,6 +122213,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111661,8 +122256,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasurementMedium queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111708,6 +122306,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111746,8 +122349,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementLevelValue : publ queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111793,6 +122399,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementLev } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111831,8 +122442,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandL queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111879,6 +122493,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementGen reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111917,8 +122536,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandLi queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111965,6 +122587,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAcc reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112003,8 +122630,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementEventList : publi queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112050,6 +122680,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementEve } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112088,8 +122723,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeList : p queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112135,6 +122773,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112173,8 +122816,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementFeatureMap : publ queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112220,6 +122866,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementFea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112258,8 +122909,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementClusterRevision : queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112305,6 +122959,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementClu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112370,8 +123029,11 @@ class ReadRadonConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112415,6 +123077,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasuredValue : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112452,8 +123119,11 @@ class ReadRadonConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112498,6 +123168,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMinMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112535,8 +123210,11 @@ class ReadRadonConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112581,6 +123259,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMaxMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112618,8 +123301,11 @@ class ReadRadonConcentrationMeasurementPeakMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112664,6 +123350,11 @@ class SubscribeAttributeRadonConcentrationMeasurementPeakMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112701,8 +123392,11 @@ class ReadRadonConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttr queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112747,6 +123441,11 @@ class SubscribeAttributeRadonConcentrationMeasurementPeakMeasuredValueWindow : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112784,8 +123483,11 @@ class ReadRadonConcentrationMeasurementAverageMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112830,6 +123532,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAverageMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112867,8 +123574,11 @@ class ReadRadonConcentrationMeasurementAverageMeasuredValueWindow : public ReadA queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112913,6 +123623,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAverageMeasuredValueWindow } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112949,8 +123664,11 @@ class ReadRadonConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112994,6 +123712,11 @@ class SubscribeAttributeRadonConcentrationMeasurementUncertainty : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113031,8 +123754,11 @@ class ReadRadonConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113076,6 +123802,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasurementUnit : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113113,8 +123844,11 @@ class ReadRadonConcentrationMeasurementMeasurementMedium : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113159,6 +123893,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasurementMedium : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113195,8 +123934,11 @@ class ReadRadonConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113240,6 +123982,11 @@ class SubscribeAttributeRadonConcentrationMeasurementLevelValue : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113277,8 +124024,11 @@ class ReadRadonConcentrationMeasurementGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113323,6 +124073,11 @@ class SubscribeAttributeRadonConcentrationMeasurementGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113360,8 +124115,11 @@ class ReadRadonConcentrationMeasurementAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113406,6 +124164,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113442,8 +124205,11 @@ class ReadRadonConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113487,6 +124253,11 @@ class SubscribeAttributeRadonConcentrationMeasurementEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113523,8 +124294,11 @@ class ReadRadonConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113568,6 +124342,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113604,8 +124383,11 @@ class ReadRadonConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113649,6 +124431,11 @@ class SubscribeAttributeRadonConcentrationMeasurementFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113686,8 +124473,11 @@ class ReadRadonConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113731,6 +124521,11 @@ class SubscribeAttributeRadonConcentrationMeasurementClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113783,8 +124578,11 @@ class ReadWakeOnLanMACAddress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMACAddressWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.MACAddress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN MACAddress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113828,6 +124626,11 @@ class SubscribeAttributeWakeOnLanMACAddress : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.MACAddress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113861,8 +124664,11 @@ class ReadWakeOnLanGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113906,6 +124712,11 @@ class SubscribeAttributeWakeOnLanGeneratedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113939,8 +124750,11 @@ class ReadWakeOnLanAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113984,6 +124798,11 @@ class SubscribeAttributeWakeOnLanAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114019,8 +124838,11 @@ class ReadWakeOnLanEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114064,6 +124886,11 @@ class SubscribeAttributeWakeOnLanEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114099,8 +124926,11 @@ class ReadWakeOnLanAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114144,6 +124974,11 @@ class SubscribeAttributeWakeOnLanAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114177,8 +125012,11 @@ class ReadWakeOnLanFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114222,6 +125060,11 @@ class SubscribeAttributeWakeOnLanFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114255,8 +125098,11 @@ class ReadWakeOnLanClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114300,6 +125146,11 @@ class SubscribeAttributeWakeOnLanClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114360,19 +125211,29 @@ class ChannelChangeChannel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeChannelWithParams:params - completion:^( - MTRChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeChannelWithParams:params + completion:^( + MTRChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -114418,6 +125279,8 @@ class ChannelChangeChannelByNumber : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -114460,17 +125323,19 @@ class ChannelSkipChannel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipChannelWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipChannelWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -114503,8 +125368,11 @@ class ReadChannelChannelList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeChannelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ChannelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel ChannelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114546,6 +125414,11 @@ class SubscribeAttributeChannelChannelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ChannelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114578,8 +125451,11 @@ class ReadChannelLineup : public ReadAttribute { [cluster readAttributeLineupWithCompletion:^(MTRChannelClusterLineupInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.Lineup response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel Lineup read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114621,6 +125497,11 @@ class SubscribeAttributeChannelLineup : public SubscribeAttribute { } reportHandler:^(MTRChannelClusterLineupInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.Lineup response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114653,8 +125534,11 @@ class ReadChannelCurrentChannel : public ReadAttribute { [cluster readAttributeCurrentChannelWithCompletion:^( MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.CurrentChannel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel CurrentChannel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114696,6 +125580,11 @@ class SubscribeAttributeChannelCurrentChannel : public SubscribeAttribute { } reportHandler:^(MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.CurrentChannel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114727,8 +125616,11 @@ class ReadChannelGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114770,6 +125662,11 @@ class SubscribeAttributeChannelGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114801,8 +125698,11 @@ class ReadChannelAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114844,6 +125744,11 @@ class SubscribeAttributeChannelAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114877,8 +125782,11 @@ class ReadChannelEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114920,6 +125828,11 @@ class SubscribeAttributeChannelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114953,8 +125866,11 @@ class ReadChannelAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114996,6 +125912,11 @@ class SubscribeAttributeChannelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115027,8 +125948,11 @@ class ReadChannelFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115070,6 +125994,11 @@ class SubscribeAttributeChannelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115101,8 +126030,11 @@ class ReadChannelClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115144,6 +126076,11 @@ class SubscribeAttributeChannelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115209,19 +126146,29 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster navigateTargetWithParams:params - completion:^(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + navigateTargetWithParams:params + completion:^(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -115256,8 +126203,11 @@ class ReadTargetNavigatorTargetList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTargetListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.TargetList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator TargetList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115301,6 +126251,11 @@ class SubscribeAttributeTargetNavigatorTargetList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.TargetList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115334,8 +126289,11 @@ class ReadTargetNavigatorCurrentTarget : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentTargetWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator CurrentTarget read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115379,6 +126337,11 @@ class SubscribeAttributeTargetNavigatorCurrentTarget : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115412,8 +126375,11 @@ class ReadTargetNavigatorGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115457,6 +126423,11 @@ class SubscribeAttributeTargetNavigatorGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115490,8 +126461,11 @@ class ReadTargetNavigatorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115535,6 +126509,11 @@ class SubscribeAttributeTargetNavigatorAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115570,8 +126549,11 @@ class ReadTargetNavigatorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115615,6 +126597,11 @@ class SubscribeAttributeTargetNavigatorEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115650,8 +126637,11 @@ class ReadTargetNavigatorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115695,6 +126685,11 @@ class SubscribeAttributeTargetNavigatorAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115728,8 +126723,11 @@ class ReadTargetNavigatorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115773,6 +126771,11 @@ class SubscribeAttributeTargetNavigatorFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115806,8 +126809,11 @@ class ReadTargetNavigatorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115851,6 +126857,11 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115924,10 +126935,18 @@ class MediaPlaybackPlay : public ClusterCommand { [cluster playWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -115973,10 +126992,18 @@ class MediaPlaybackPause : public ClusterCommand { pauseWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116021,10 +127048,18 @@ class MediaPlaybackStop : public ClusterCommand { [cluster stopWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116070,10 +127105,18 @@ class MediaPlaybackStartOver : public ClusterCommand { startOverWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116119,10 +127162,18 @@ class MediaPlaybackPrevious : public ClusterCommand { previousWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116167,10 +127218,18 @@ class MediaPlaybackNext : public ClusterCommand { [cluster nextWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116216,10 +127275,18 @@ class MediaPlaybackRewind : public ClusterCommand { rewindWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116261,19 +127328,28 @@ class MediaPlaybackFastForward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster fastForwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + fastForwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116312,19 +127388,28 @@ class MediaPlaybackSkipForward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipForwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipForwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116364,19 +127449,28 @@ class MediaPlaybackSkipBackward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipBackwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipBackwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116419,10 +127513,18 @@ class MediaPlaybackSeek : public ClusterCommand { [cluster seekWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116462,8 +127564,11 @@ class ReadMediaPlaybackCurrentState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.CurrentState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback CurrentState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116507,6 +127612,11 @@ class SubscribeAttributeMediaPlaybackCurrentState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.CurrentState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116540,8 +127650,11 @@ class ReadMediaPlaybackStartTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.StartTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback StartTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116585,6 +127698,11 @@ class SubscribeAttributeMediaPlaybackStartTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.StartTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116618,8 +127736,11 @@ class ReadMediaPlaybackDuration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.Duration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback Duration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116663,6 +127784,11 @@ class SubscribeAttributeMediaPlaybackDuration : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.Duration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116697,8 +127823,11 @@ class ReadMediaPlaybackSampledPosition : public ReadAttribute { [cluster readAttributeSampledPositionWithCompletion:^( MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SampledPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116742,6 +127871,11 @@ class SubscribeAttributeMediaPlaybackSampledPosition : public SubscribeAttribute } reportHandler:^(MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116775,8 +127909,11 @@ class ReadMediaPlaybackPlaybackSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback PlaybackSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116820,6 +127957,11 @@ class SubscribeAttributeMediaPlaybackPlaybackSpeed : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116853,8 +127995,11 @@ class ReadMediaPlaybackSeekRangeEnd : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSeekRangeEndWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SeekRangeEnd read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116898,6 +128043,11 @@ class SubscribeAttributeMediaPlaybackSeekRangeEnd : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116931,8 +128081,11 @@ class ReadMediaPlaybackSeekRangeStart : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSeekRangeStartWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SeekRangeStart read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116976,6 +128129,11 @@ class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117009,8 +128167,11 @@ class ReadMediaPlaybackGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117054,6 +128215,11 @@ class SubscribeAttributeMediaPlaybackGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117087,8 +128253,11 @@ class ReadMediaPlaybackAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117132,6 +128301,11 @@ class SubscribeAttributeMediaPlaybackAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117167,8 +128341,11 @@ class ReadMediaPlaybackEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117212,6 +128389,11 @@ class SubscribeAttributeMediaPlaybackEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117247,8 +128429,11 @@ class ReadMediaPlaybackAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117292,6 +128477,11 @@ class SubscribeAttributeMediaPlaybackAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117325,8 +128515,11 @@ class ReadMediaPlaybackFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117370,6 +128563,11 @@ class SubscribeAttributeMediaPlaybackFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117403,8 +128601,11 @@ class ReadMediaPlaybackClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117448,6 +128649,11 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117508,17 +128714,19 @@ class MediaInputSelectInput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster selectInputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + selectInputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -117562,6 +128770,8 @@ class MediaInputShowInputStatus : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -117609,6 +128819,8 @@ class MediaInputHideInputStatus : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -117656,17 +128868,19 @@ class MediaInputRenameInput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster renameInputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + renameInputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -117701,8 +128915,11 @@ class ReadMediaInputInputList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.InputList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput InputList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117746,6 +128963,11 @@ class SubscribeAttributeMediaInputInputList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.InputList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117779,8 +129001,11 @@ class ReadMediaInputCurrentInput : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.CurrentInput response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput CurrentInput read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117824,6 +129049,11 @@ class SubscribeAttributeMediaInputCurrentInput : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.CurrentInput response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117857,8 +129087,11 @@ class ReadMediaInputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117902,6 +129135,11 @@ class SubscribeAttributeMediaInputGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117935,8 +129173,11 @@ class ReadMediaInputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117980,6 +129221,11 @@ class SubscribeAttributeMediaInputAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118015,8 +129261,11 @@ class ReadMediaInputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118060,6 +129309,11 @@ class SubscribeAttributeMediaInputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118095,8 +129349,11 @@ class ReadMediaInputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118140,6 +129397,11 @@ class SubscribeAttributeMediaInputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118173,8 +129435,11 @@ class ReadMediaInputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118218,6 +129483,11 @@ class SubscribeAttributeMediaInputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118251,8 +129521,11 @@ class ReadMediaInputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118296,6 +129569,11 @@ class SubscribeAttributeMediaInputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118353,6 +129631,7 @@ class LowPowerSleep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -118389,8 +129668,11 @@ class ReadLowPowerGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118432,6 +129714,11 @@ class SubscribeAttributeLowPowerGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118463,8 +129750,11 @@ class ReadLowPowerAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118506,6 +129796,11 @@ class SubscribeAttributeLowPowerAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118539,8 +129834,11 @@ class ReadLowPowerEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118582,6 +129880,11 @@ class SubscribeAttributeLowPowerEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118615,8 +129918,11 @@ class ReadLowPowerAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118658,6 +129964,11 @@ class SubscribeAttributeLowPowerAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118689,8 +130000,11 @@ class ReadLowPowerFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118732,6 +130046,11 @@ class SubscribeAttributeLowPowerFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118763,8 +130082,11 @@ class ReadLowPowerClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118806,6 +130128,11 @@ class SubscribeAttributeLowPowerClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118864,10 +130191,18 @@ class KeypadInputSendKey : public ClusterCommand { [cluster sendKeyWithParams:params completion:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -118907,8 +130242,11 @@ class ReadKeypadInputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118952,6 +130290,11 @@ class SubscribeAttributeKeypadInputGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118985,8 +130328,11 @@ class ReadKeypadInputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119030,6 +130376,11 @@ class SubscribeAttributeKeypadInputAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119065,8 +130416,11 @@ class ReadKeypadInputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119110,6 +130464,11 @@ class SubscribeAttributeKeypadInputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119145,8 +130504,11 @@ class ReadKeypadInputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119190,6 +130552,11 @@ class SubscribeAttributeKeypadInputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119223,8 +130590,11 @@ class ReadKeypadInputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119268,6 +130638,11 @@ class SubscribeAttributeKeypadInputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119301,8 +130676,11 @@ class ReadKeypadInputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119346,6 +130724,11 @@ class SubscribeAttributeKeypadInputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119447,19 +130830,29 @@ class ContentLauncherLaunchContent : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchContentWithParams:params - completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchContentWithParams:params + completion:^( + MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -119686,19 +131079,28 @@ class ContentLauncherLaunchURL : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchURLWithParams:params - completion:^( - MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchURLWithParams:params + completion:^( + MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -119735,8 +131137,11 @@ class ReadContentLauncherAcceptHeader : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptHeaderWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptHeader response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AcceptHeader read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119780,6 +131185,11 @@ class SubscribeAttributeContentLauncherAcceptHeader : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptHeader response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119813,8 +131223,11 @@ class ReadContentLauncherSupportedStreamingProtocols : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedStreamingProtocolsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.SupportedStreamingProtocols response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher SupportedStreamingProtocols read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119858,6 +131271,8 @@ class WriteContentLauncherSupportedStreamingProtocols : public WriteAttribute { if (error != nil) { LogNSError( "ContentLauncher SupportedStreamingProtocols write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119904,6 +131319,11 @@ class SubscribeAttributeContentLauncherSupportedStreamingProtocols : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.SupportedStreamingProtocols response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119937,8 +131357,11 @@ class ReadContentLauncherGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119982,6 +131405,11 @@ class SubscribeAttributeContentLauncherGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120015,8 +131443,11 @@ class ReadContentLauncherAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120060,6 +131491,11 @@ class SubscribeAttributeContentLauncherAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120095,8 +131531,11 @@ class ReadContentLauncherEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120140,6 +131579,11 @@ class SubscribeAttributeContentLauncherEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120175,8 +131619,11 @@ class ReadContentLauncherAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120220,6 +131667,11 @@ class SubscribeAttributeContentLauncherAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120253,8 +131705,11 @@ class ReadContentLauncherFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120298,6 +131753,11 @@ class SubscribeAttributeContentLauncherFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120331,8 +131791,11 @@ class ReadContentLauncherClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120376,6 +131839,11 @@ class SubscribeAttributeContentLauncherClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120434,17 +131902,19 @@ class AudioOutputSelectOutput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster selectOutputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + selectOutputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -120488,17 +131958,19 @@ class AudioOutputRenameOutput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster renameOutputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + renameOutputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -120533,8 +132005,11 @@ class ReadAudioOutputOutputList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.OutputList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput OutputList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120578,6 +132053,11 @@ class SubscribeAttributeAudioOutputOutputList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.OutputList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120611,8 +132091,11 @@ class ReadAudioOutputCurrentOutput : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentOutputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.CurrentOutput response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput CurrentOutput read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120656,6 +132139,11 @@ class SubscribeAttributeAudioOutputCurrentOutput : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.CurrentOutput response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120689,8 +132177,11 @@ class ReadAudioOutputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120734,6 +132225,11 @@ class SubscribeAttributeAudioOutputGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120767,8 +132263,11 @@ class ReadAudioOutputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120812,6 +132311,11 @@ class SubscribeAttributeAudioOutputAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120847,8 +132351,11 @@ class ReadAudioOutputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120892,6 +132399,11 @@ class SubscribeAttributeAudioOutputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120927,8 +132439,11 @@ class ReadAudioOutputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120972,6 +132487,11 @@ class SubscribeAttributeAudioOutputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121005,8 +132525,11 @@ class ReadAudioOutputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121050,6 +132573,11 @@ class SubscribeAttributeAudioOutputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121083,8 +132611,11 @@ class ReadAudioOutputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121128,6 +132659,11 @@ class SubscribeAttributeAudioOutputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121202,19 +132738,28 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchAppWithParams:params - completion:^(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchAppWithParams:params + completion:^( + MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -121269,10 +132814,18 @@ class ApplicationLauncherStopApp : public ClusterCommand { completion:^( MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -121332,10 +132885,18 @@ class ApplicationLauncherHideApp : public ClusterCommand { completion:^( MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -121377,8 +132938,11 @@ class ReadApplicationLauncherCatalogList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCatalogListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CatalogList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher CatalogList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121422,6 +132986,11 @@ class SubscribeAttributeApplicationLauncherCatalogList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CatalogList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121456,8 +133025,11 @@ class ReadApplicationLauncherCurrentApp : public ReadAttribute { [cluster readAttributeCurrentAppWithCompletion:^( MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher CurrentApp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121515,6 +133087,8 @@ class WriteApplicationLauncherCurrentApp : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ApplicationLauncher CurrentApp write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121564,6 +133138,11 @@ class SubscribeAttributeApplicationLauncherCurrentApp : public SubscribeAttribut } reportHandler:^(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121597,8 +133176,11 @@ class ReadApplicationLauncherGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121642,6 +133224,11 @@ class SubscribeAttributeApplicationLauncherGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121675,8 +133262,11 @@ class ReadApplicationLauncherAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121720,6 +133310,11 @@ class SubscribeAttributeApplicationLauncherAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121755,8 +133350,11 @@ class ReadApplicationLauncherEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121800,6 +133398,11 @@ class SubscribeAttributeApplicationLauncherEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121835,8 +133438,11 @@ class ReadApplicationLauncherAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121880,6 +133486,11 @@ class SubscribeAttributeApplicationLauncherAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121913,8 +133524,11 @@ class ReadApplicationLauncherFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121958,6 +133572,11 @@ class SubscribeAttributeApplicationLauncherFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121991,8 +133610,11 @@ class ReadApplicationLauncherClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122036,6 +133658,11 @@ class SubscribeAttributeApplicationLauncherClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122093,8 +133720,11 @@ class ReadApplicationBasicVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122138,6 +133768,11 @@ class SubscribeAttributeApplicationBasicVendorName : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122171,8 +133806,11 @@ class ReadApplicationBasicVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122216,6 +133854,11 @@ class SubscribeAttributeApplicationBasicVendorID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122249,8 +133892,11 @@ class ReadApplicationBasicApplicationName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ApplicationName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122294,6 +133940,11 @@ class SubscribeAttributeApplicationBasicApplicationName : public SubscribeAttrib } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122327,8 +133978,11 @@ class ReadApplicationBasicProductID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ProductID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ProductID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122372,6 +134026,11 @@ class SubscribeAttributeApplicationBasicProductID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ProductID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122406,8 +134065,11 @@ class ReadApplicationBasicApplication : public ReadAttribute { [cluster readAttributeApplicationWithCompletion:^( MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic Application read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122451,6 +134113,11 @@ class SubscribeAttributeApplicationBasicApplication : public SubscribeAttribute } reportHandler:^(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122484,8 +134151,11 @@ class ReadApplicationBasicStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Status response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic Status read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122529,6 +134199,11 @@ class SubscribeAttributeApplicationBasicStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Status response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122562,8 +134237,11 @@ class ReadApplicationBasicApplicationVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationVersionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ApplicationVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122607,6 +134285,11 @@ class SubscribeAttributeApplicationBasicApplicationVersion : public SubscribeAtt } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122640,8 +134323,11 @@ class ReadApplicationBasicAllowedVendorList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAllowedVendorListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AllowedVendorList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AllowedVendorList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122685,6 +134371,11 @@ class SubscribeAttributeApplicationBasicAllowedVendorList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AllowedVendorList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122718,8 +134409,11 @@ class ReadApplicationBasicGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122763,6 +134457,11 @@ class SubscribeAttributeApplicationBasicGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122796,8 +134495,11 @@ class ReadApplicationBasicAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122841,6 +134543,11 @@ class SubscribeAttributeApplicationBasicAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122876,8 +134583,11 @@ class ReadApplicationBasicEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122921,6 +134631,11 @@ class SubscribeAttributeApplicationBasicEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122956,8 +134671,11 @@ class ReadApplicationBasicAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123001,6 +134719,11 @@ class SubscribeAttributeApplicationBasicAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123034,8 +134757,11 @@ class ReadApplicationBasicFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123079,6 +134805,11 @@ class SubscribeAttributeApplicationBasicFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123112,8 +134843,11 @@ class ReadApplicationBasicClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123157,6 +134891,11 @@ class SubscribeAttributeApplicationBasicClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123216,19 +134955,28 @@ class AccountLoginGetSetupPIN : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getSetupPINWithParams:params - completion:^( - MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + getSetupPINWithParams:params + completion:^( + MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -123280,6 +135028,7 @@ class AccountLoginLogin : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -123328,6 +135077,7 @@ class AccountLoginLogout : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -123366,8 +135116,11 @@ class ReadAccountLoginGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123411,6 +135164,11 @@ class SubscribeAttributeAccountLoginGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123444,8 +135202,11 @@ class ReadAccountLoginAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123489,6 +135250,11 @@ class SubscribeAttributeAccountLoginAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123524,8 +135290,11 @@ class ReadAccountLoginEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123569,6 +135338,11 @@ class SubscribeAttributeAccountLoginEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123604,8 +135378,11 @@ class ReadAccountLoginAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123649,6 +135426,11 @@ class SubscribeAttributeAccountLoginAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123682,8 +135464,11 @@ class ReadAccountLoginFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123727,6 +135512,11 @@ class SubscribeAttributeAccountLoginFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123760,8 +135550,11 @@ class ReadAccountLoginClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123805,6 +135598,11 @@ class SubscribeAttributeAccountLoginClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123993,6 +135791,8 @@ class ElectricalMeasurementGetProfileInfoCommand : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -124047,6 +135847,8 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -124086,8 +135888,11 @@ class ReadElectricalMeasurementMeasurementType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasurementType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124131,6 +135936,11 @@ class SubscribeAttributeElectricalMeasurementMeasurementType : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124164,8 +135974,11 @@ class ReadElectricalMeasurementDcVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124209,6 +136022,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltage : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124242,8 +136060,11 @@ class ReadElectricalMeasurementDcVoltageMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124287,6 +136108,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMin : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124320,8 +136146,11 @@ class ReadElectricalMeasurementDcVoltageMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124365,6 +136194,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMax : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124398,8 +136232,11 @@ class ReadElectricalMeasurementDcCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124443,6 +136280,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrent : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124476,8 +136318,11 @@ class ReadElectricalMeasurementDcCurrentMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124521,6 +136366,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMin : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124554,8 +136404,11 @@ class ReadElectricalMeasurementDcCurrentMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124599,6 +136452,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMax : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124632,8 +136490,11 @@ class ReadElectricalMeasurementDcPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124677,6 +136538,11 @@ class SubscribeAttributeElectricalMeasurementDcPower : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124710,8 +136576,11 @@ class ReadElectricalMeasurementDcPowerMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124755,6 +136624,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMin : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124788,8 +136662,11 @@ class ReadElectricalMeasurementDcPowerMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124833,6 +136710,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMax : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124866,8 +136748,11 @@ class ReadElectricalMeasurementDcVoltageMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124911,6 +136796,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124944,8 +136834,11 @@ class ReadElectricalMeasurementDcVoltageDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124989,6 +136882,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125022,8 +136920,11 @@ class ReadElectricalMeasurementDcCurrentMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125067,6 +136968,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125100,8 +137006,11 @@ class ReadElectricalMeasurementDcCurrentDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125145,6 +137054,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125178,8 +137092,11 @@ class ReadElectricalMeasurementDcPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125223,6 +137140,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMultiplier : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125256,8 +137178,11 @@ class ReadElectricalMeasurementDcPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125301,6 +137226,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerDivisor : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125334,8 +137264,11 @@ class ReadElectricalMeasurementAcFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125379,6 +137312,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequency : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125412,8 +137350,11 @@ class ReadElectricalMeasurementAcFrequencyMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125457,6 +137398,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMin : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125490,8 +137436,11 @@ class ReadElectricalMeasurementAcFrequencyMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125535,6 +137484,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMax : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125568,8 +137522,11 @@ class ReadElectricalMeasurementNeutralCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNeutralCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement NeutralCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125613,6 +137570,11 @@ class SubscribeAttributeElectricalMeasurementNeutralCurrent : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125646,8 +137608,11 @@ class ReadElectricalMeasurementTotalActivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalActivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalActivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125691,6 +137656,11 @@ class SubscribeAttributeElectricalMeasurementTotalActivePower : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125724,8 +137694,11 @@ class ReadElectricalMeasurementTotalReactivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalReactivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalReactivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125769,6 +137742,11 @@ class SubscribeAttributeElectricalMeasurementTotalReactivePower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125802,8 +137780,11 @@ class ReadElectricalMeasurementTotalApparentPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalApparentPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalApparentPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125847,6 +137828,11 @@ class SubscribeAttributeElectricalMeasurementTotalApparentPower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125881,8 +137867,11 @@ class ReadElectricalMeasurementMeasured1stHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured1stHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured1stHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125927,6 +137916,11 @@ class SubscribeAttributeElectricalMeasurementMeasured1stHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125961,8 +137955,11 @@ class ReadElectricalMeasurementMeasured3rdHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured3rdHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured3rdHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126007,6 +138004,11 @@ class SubscribeAttributeElectricalMeasurementMeasured3rdHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126041,8 +138043,11 @@ class ReadElectricalMeasurementMeasured5thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured5thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured5thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126087,6 +138092,11 @@ class SubscribeAttributeElectricalMeasurementMeasured5thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126121,8 +138131,11 @@ class ReadElectricalMeasurementMeasured7thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured7thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured7thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126167,6 +138180,11 @@ class SubscribeAttributeElectricalMeasurementMeasured7thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126201,8 +138219,11 @@ class ReadElectricalMeasurementMeasured9thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured9thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured9thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126247,6 +138268,11 @@ class SubscribeAttributeElectricalMeasurementMeasured9thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126281,8 +138307,11 @@ class ReadElectricalMeasurementMeasured11thHarmonicCurrent : public ReadAttribut queue:callbackQueue]; [cluster readAttributeMeasured11thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured11thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126327,6 +138356,11 @@ class SubscribeAttributeElectricalMeasurementMeasured11thHarmonicCurrent : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126362,8 +138396,11 @@ class ReadElectricalMeasurementMeasuredPhase1stHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase1stHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase1stHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126408,6 +138445,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase1stHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126443,8 +138485,11 @@ class ReadElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase3rdHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase3rdHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126489,6 +138534,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126524,8 +138574,11 @@ class ReadElectricalMeasurementMeasuredPhase5thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase5thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase5thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126570,6 +138623,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase5thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126605,8 +138663,11 @@ class ReadElectricalMeasurementMeasuredPhase7thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase7thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase7thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126651,6 +138712,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase7thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126686,8 +138752,11 @@ class ReadElectricalMeasurementMeasuredPhase9thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase9thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase9thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126732,6 +138801,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase9thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126767,8 +138841,11 @@ class ReadElectricalMeasurementMeasuredPhase11thHarmonicCurrent : public ReadAtt [cluster readAttributeMeasuredPhase11thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase11thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase11thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126813,6 +138890,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase11thHarmonicCurrent : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase11thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126846,8 +138928,11 @@ class ReadElectricalMeasurementAcFrequencyMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126891,6 +138976,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMultiplier : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126924,8 +139014,11 @@ class ReadElectricalMeasurementAcFrequencyDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126969,6 +139062,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyDivisor : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127002,8 +139100,11 @@ class ReadElectricalMeasurementPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127047,6 +139148,11 @@ class SubscribeAttributeElectricalMeasurementPowerMultiplier : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127080,8 +139186,11 @@ class ReadElectricalMeasurementPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127125,6 +139234,11 @@ class SubscribeAttributeElectricalMeasurementPowerDivisor : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127159,8 +139273,11 @@ class ReadElectricalMeasurementHarmonicCurrentMultiplier : public ReadAttribute queue:callbackQueue]; [cluster readAttributeHarmonicCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement HarmonicCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127205,6 +139322,11 @@ class SubscribeAttributeElectricalMeasurementHarmonicCurrentMultiplier : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127240,8 +139362,11 @@ class ReadElectricalMeasurementPhaseHarmonicCurrentMultiplier : public ReadAttri [cluster readAttributePhaseHarmonicCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PhaseHarmonicCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127286,6 +139411,11 @@ class SubscribeAttributeElectricalMeasurementPhaseHarmonicCurrentMultiplier : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127319,8 +139449,11 @@ class ReadElectricalMeasurementInstantaneousVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127364,6 +139497,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousVoltage : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127398,8 +139536,11 @@ class ReadElectricalMeasurementInstantaneousLineCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousLineCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousLineCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127444,6 +139585,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousLineCurrent : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127478,8 +139624,11 @@ class ReadElectricalMeasurementInstantaneousActiveCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeInstantaneousActiveCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousActiveCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127524,6 +139673,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousActiveCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127558,8 +139712,11 @@ class ReadElectricalMeasurementInstantaneousReactiveCurrent : public ReadAttribu queue:callbackQueue]; [cluster readAttributeInstantaneousReactiveCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousReactiveCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127604,6 +139761,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousReactiveCurrent : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127637,8 +139799,11 @@ class ReadElectricalMeasurementInstantaneousPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127682,6 +139847,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousPower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127715,8 +139885,11 @@ class ReadElectricalMeasurementRmsVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127760,6 +139933,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltage : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127793,8 +139971,11 @@ class ReadElectricalMeasurementRmsVoltageMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127838,6 +140019,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMin : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127871,8 +140057,11 @@ class ReadElectricalMeasurementRmsVoltageMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127916,6 +140105,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMax : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127949,8 +140143,11 @@ class ReadElectricalMeasurementRmsCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127994,6 +140191,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrent : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128027,8 +140229,11 @@ class ReadElectricalMeasurementRmsCurrentMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128072,6 +140277,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMin : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128105,8 +140315,11 @@ class ReadElectricalMeasurementRmsCurrentMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128150,6 +140363,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMax : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128183,8 +140401,11 @@ class ReadElectricalMeasurementActivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128228,6 +140449,11 @@ class SubscribeAttributeElectricalMeasurementActivePower : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128261,8 +140487,11 @@ class ReadElectricalMeasurementActivePowerMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128306,6 +140535,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMin : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128339,8 +140573,11 @@ class ReadElectricalMeasurementActivePowerMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128384,6 +140621,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMax : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128417,8 +140659,11 @@ class ReadElectricalMeasurementReactivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128462,6 +140707,11 @@ class SubscribeAttributeElectricalMeasurementReactivePower : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128495,8 +140745,11 @@ class ReadElectricalMeasurementApparentPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128540,6 +140793,11 @@ class SubscribeAttributeElectricalMeasurementApparentPower : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128573,8 +140831,11 @@ class ReadElectricalMeasurementPowerFactor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128618,6 +140879,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactor : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128653,8 +140919,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public ReadA [cluster readAttributeAverageRmsVoltageMeasurementPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128699,6 +140968,8 @@ class WriteElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public Writ LogNSError("ElectricalMeasurement " "AverageRmsVoltageMeasurementPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128746,6 +141017,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriod } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128780,8 +141056,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounter : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAverageRmsUnderVoltageCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounter read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128827,6 +141106,8 @@ class WriteElectricalMeasurementAverageRmsUnderVoltageCounter : public WriteAttr LogNSError( "ElectricalMeasurement AverageRmsUnderVoltageCounter write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128874,6 +141155,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounter : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128908,8 +141194,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriod : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsExtremeOverVoltagePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128955,6 +141244,8 @@ class WriteElectricalMeasurementRmsExtremeOverVoltagePeriod : public WriteAttrib LogNSError( "ElectricalMeasurement RmsExtremeOverVoltagePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129002,6 +141293,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriod : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129036,8 +141332,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriod : public ReadAttribu queue:callbackQueue]; [cluster readAttributeRmsExtremeUnderVoltagePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129083,6 +141382,8 @@ class WriteElectricalMeasurementRmsExtremeUnderVoltagePeriod : public WriteAttri LogNSError( "ElectricalMeasurement RmsExtremeUnderVoltagePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129130,6 +141431,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriod : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129163,8 +141469,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129206,6 +141515,8 @@ class WriteElectricalMeasurementRmsVoltageSagPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement RmsVoltageSagPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129252,6 +141563,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriod : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129285,8 +141601,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129329,6 +141648,8 @@ class WriteElectricalMeasurementRmsVoltageSwellPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129375,6 +141696,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriod : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129408,8 +141734,11 @@ class ReadElectricalMeasurementAcVoltageMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129453,6 +141782,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129486,8 +141820,11 @@ class ReadElectricalMeasurementAcVoltageDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129531,6 +141868,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129564,8 +141906,11 @@ class ReadElectricalMeasurementAcCurrentMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129609,6 +141954,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129642,8 +141992,11 @@ class ReadElectricalMeasurementAcCurrentDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129687,6 +142040,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129720,8 +142078,11 @@ class ReadElectricalMeasurementAcPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcPowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcPowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129765,6 +142126,11 @@ class SubscribeAttributeElectricalMeasurementAcPowerMultiplier : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129798,8 +142164,11 @@ class ReadElectricalMeasurementAcPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcPowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcPowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129843,6 +142212,11 @@ class SubscribeAttributeElectricalMeasurementAcPowerDivisor : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129876,8 +142250,11 @@ class ReadElectricalMeasurementOverloadAlarmsMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverloadAlarmsMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement OverloadAlarmsMask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129919,6 +142296,8 @@ class WriteElectricalMeasurementOverloadAlarmsMask : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement OverloadAlarmsMask write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129965,6 +142344,11 @@ class SubscribeAttributeElectricalMeasurementOverloadAlarmsMask : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129998,8 +142382,11 @@ class ReadElectricalMeasurementVoltageOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVoltageOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement VoltageOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130043,6 +142430,11 @@ class SubscribeAttributeElectricalMeasurementVoltageOverload : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130076,8 +142468,11 @@ class ReadElectricalMeasurementCurrentOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement CurrentOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130121,6 +142516,11 @@ class SubscribeAttributeElectricalMeasurementCurrentOverload : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130154,8 +142554,11 @@ class ReadElectricalMeasurementAcOverloadAlarmsMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcOverloadAlarmsMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcOverloadAlarmsMask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130198,6 +142601,8 @@ class WriteElectricalMeasurementAcOverloadAlarmsMask : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement AcOverloadAlarmsMask write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130244,6 +142649,11 @@ class SubscribeAttributeElectricalMeasurementAcOverloadAlarmsMask : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130277,8 +142687,11 @@ class ReadElectricalMeasurementAcVoltageOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130322,6 +142735,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageOverload : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130355,8 +142773,11 @@ class ReadElectricalMeasurementAcCurrentOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130400,6 +142821,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentOverload : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130433,8 +142859,11 @@ class ReadElectricalMeasurementAcActivePowerOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcActivePowerOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcActivePowerOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130478,6 +142907,11 @@ class SubscribeAttributeElectricalMeasurementAcActivePowerOverload : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130512,8 +142946,11 @@ class ReadElectricalMeasurementAcReactivePowerOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcReactivePowerOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcReactivePowerOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130557,6 +142994,11 @@ class SubscribeAttributeElectricalMeasurementAcReactivePowerOverload : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130590,8 +143032,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAverageRmsOverVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130635,6 +143080,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltage : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130669,8 +143119,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAverageRmsUnderVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130714,6 +143167,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130747,8 +143205,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsExtremeOverVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130792,6 +143253,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltage : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130826,8 +143292,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsExtremeUnderVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130871,6 +143340,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130904,8 +143378,11 @@ class ReadElectricalMeasurementRmsVoltageSag : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSagWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSag read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130949,6 +143426,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSag : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130982,8 +143464,11 @@ class ReadElectricalMeasurementRmsVoltageSwell : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwell read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131027,6 +143512,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwell : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131060,8 +143550,11 @@ class ReadElectricalMeasurementLineCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLineCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement LineCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131105,6 +143598,11 @@ class SubscribeAttributeElectricalMeasurementLineCurrentPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131138,8 +143636,11 @@ class ReadElectricalMeasurementActiveCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActiveCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131183,6 +143684,11 @@ class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131216,8 +143722,11 @@ class ReadElectricalMeasurementReactiveCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactiveCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactiveCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131261,6 +143770,11 @@ class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseB : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131294,8 +143808,11 @@ class ReadElectricalMeasurementRmsVoltagePhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltagePhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltagePhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131339,6 +143856,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseB : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131372,8 +143894,11 @@ class ReadElectricalMeasurementRmsVoltageMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131417,6 +143942,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131450,8 +143980,11 @@ class ReadElectricalMeasurementRmsVoltageMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131495,6 +144028,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131528,8 +144066,11 @@ class ReadElectricalMeasurementRmsCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131573,6 +144114,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseB : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131606,8 +144152,11 @@ class ReadElectricalMeasurementRmsCurrentMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131651,6 +144200,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131684,8 +144238,11 @@ class ReadElectricalMeasurementRmsCurrentMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131729,6 +144286,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131762,8 +144324,11 @@ class ReadElectricalMeasurementActivePowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131807,6 +144372,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131840,8 +144410,11 @@ class ReadElectricalMeasurementActivePowerMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131885,6 +144458,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseB : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131918,8 +144496,11 @@ class ReadElectricalMeasurementActivePowerMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131963,6 +144544,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseB : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131996,8 +144582,11 @@ class ReadElectricalMeasurementReactivePowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132041,6 +144630,11 @@ class SubscribeAttributeElectricalMeasurementReactivePowerPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132074,8 +144668,11 @@ class ReadElectricalMeasurementApparentPowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132119,6 +144716,11 @@ class SubscribeAttributeElectricalMeasurementApparentPowerPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132152,8 +144754,11 @@ class ReadElectricalMeasurementPowerFactorPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactorPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132197,6 +144802,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactorPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132232,8 +144842,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB : public [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132278,6 +144891,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodP } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132313,8 +144931,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseB : public ReadA [cluster readAttributeAverageRmsOverVoltageCounterPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltageCounterPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132359,6 +144980,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132394,8 +145020,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB : public Read [cluster readAttributeAverageRmsUnderVoltageCounterPhaseBWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132440,6 +145069,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132475,8 +145109,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : public ReadAt [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132521,6 +145158,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132556,8 +145198,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB : public ReadA [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132602,6 +145247,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132636,8 +145286,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseB : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132682,6 +145335,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseB : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132716,8 +145374,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseB : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132762,6 +145423,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseB : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132795,8 +145461,11 @@ class ReadElectricalMeasurementLineCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLineCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement LineCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132840,6 +145509,11 @@ class SubscribeAttributeElectricalMeasurementLineCurrentPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132873,8 +145547,11 @@ class ReadElectricalMeasurementActiveCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActiveCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132918,6 +145595,11 @@ class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132951,8 +145633,11 @@ class ReadElectricalMeasurementReactiveCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactiveCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactiveCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132996,6 +145681,11 @@ class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseC : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133029,8 +145719,11 @@ class ReadElectricalMeasurementRmsVoltagePhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltagePhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltagePhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133074,6 +145767,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseC : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133107,8 +145805,11 @@ class ReadElectricalMeasurementRmsVoltageMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133152,6 +145853,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133185,8 +145891,11 @@ class ReadElectricalMeasurementRmsVoltageMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133230,6 +145939,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133263,8 +145977,11 @@ class ReadElectricalMeasurementRmsCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133308,6 +146025,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseC : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133341,8 +146063,11 @@ class ReadElectricalMeasurementRmsCurrentMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133386,6 +146111,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133419,8 +146149,11 @@ class ReadElectricalMeasurementRmsCurrentMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133464,6 +146197,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133497,8 +146235,11 @@ class ReadElectricalMeasurementActivePowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133542,6 +146283,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133575,8 +146321,11 @@ class ReadElectricalMeasurementActivePowerMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133620,6 +146369,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseC : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133653,8 +146407,11 @@ class ReadElectricalMeasurementActivePowerMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133698,6 +146455,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseC : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133731,8 +146493,11 @@ class ReadElectricalMeasurementReactivePowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133776,6 +146541,11 @@ class SubscribeAttributeElectricalMeasurementReactivePowerPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133809,8 +146579,11 @@ class ReadElectricalMeasurementApparentPowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133854,6 +146627,11 @@ class SubscribeAttributeElectricalMeasurementApparentPowerPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133887,8 +146665,11 @@ class ReadElectricalMeasurementPowerFactorPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactorPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133932,6 +146713,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactorPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133967,8 +146753,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC : public [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134013,6 +146802,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodP } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134048,8 +146842,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseC : public ReadA [cluster readAttributeAverageRmsOverVoltageCounterPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltageCounterPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134094,6 +146891,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134129,8 +146931,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC : public Read [cluster readAttributeAverageRmsUnderVoltageCounterPhaseCWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134175,6 +146980,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134210,8 +147020,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : public ReadAt [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134256,6 +147069,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134291,8 +147109,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC : public ReadA [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134337,6 +147158,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134371,8 +147197,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseC : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134417,6 +147246,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseC : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134451,8 +147285,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseC : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134497,6 +147334,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseC : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134530,8 +147372,11 @@ class ReadElectricalMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134575,6 +147420,11 @@ class SubscribeAttributeElectricalMeasurementGeneratedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134608,8 +147458,11 @@ class ReadElectricalMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134653,6 +147506,11 @@ class SubscribeAttributeElectricalMeasurementAcceptedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134688,8 +147546,11 @@ class ReadElectricalMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134733,6 +147594,11 @@ class SubscribeAttributeElectricalMeasurementEventList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134768,8 +147634,11 @@ class ReadElectricalMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134813,6 +147682,11 @@ class SubscribeAttributeElectricalMeasurementAttributeList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134846,8 +147720,11 @@ class ReadElectricalMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134891,6 +147768,11 @@ class SubscribeAttributeElectricalMeasurementFeatureMap : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134924,8 +147806,11 @@ class ReadElectricalMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134969,6 +147854,11 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -135133,6 +148023,7 @@ class UnitTestingTest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135180,6 +148071,8 @@ class UnitTestingTestNotHandled : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135221,19 +148114,28 @@ class UnitTestingTestSpecific : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testSpecificWithParams:params - completion:^(MTRUnitTestingClusterTestSpecificResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testSpecificWithParams:params + completion:^( + MTRUnitTestingClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135276,6 +148178,8 @@ class UnitTestingTestUnknownCommand : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135321,19 +148225,29 @@ class UnitTestingTestAddArguments : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testAddArgumentsWithParams:params - completion:^(MTRUnitTestingClusterTestAddArgumentsResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testAddArgumentsWithParams:params + completion:^(MTRUnitTestingClusterTestAddArgumentsResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135373,19 +148287,30 @@ class UnitTestingTestSimpleArgumentRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testSimpleArgumentRequestWithParams:params - completion:^(MTRUnitTestingClusterTestSimpleArgumentResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testSimpleArgumentRequestWithParams:params + completion:^(MTRUnitTestingClusterTestSimpleArgumentResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135546,10 +148471,20 @@ class UnitTestingTestStructArrayArgumentRequest : public ClusterCommand { MTRUnitTestingClusterTestStructArrayArgumentResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestStructArrayArgumentResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestStructArrayArgumentResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135615,10 +148550,20 @@ class UnitTestingTestStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135682,10 +148627,20 @@ class UnitTestingTestNestedStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135754,10 +148709,20 @@ class UnitTestingTestListStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135817,10 +148782,20 @@ class UnitTestingTestListInt8UArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135926,19 +148901,30 @@ class UnitTestingTestNestedStructListArgumentRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testNestedStructListArgumentRequestWithParams:params - completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testNestedStructListArgumentRequestWithParams:params + completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136053,10 +149039,20 @@ class UnitTestingTestListNestedStructListArgumentRequest : public ClusterCommand completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136117,10 +149113,20 @@ class UnitTestingTestListInt8UReverseRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterTestListInt8UReverseResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestListInt8UReverseResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestListInt8UReverseResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136168,19 +149174,29 @@ class UnitTestingTestEnumsRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEnumsRequestWithParams:params - completion:^(MTRUnitTestingClusterTestEnumsResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testEnumsRequestWithParams:params + completion:^( + MTRUnitTestingClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136233,10 +149249,20 @@ class UnitTestingTestNullableOptionalRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterTestNullableOptionalResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136447,10 +149473,20 @@ class UnitTestingTestComplexNullableOptionalRequest : public ClusterCommand { MTRUnitTestingClusterTestComplexNullableOptionalResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestComplexNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestComplexNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136524,10 +149560,20 @@ class UnitTestingSimpleStructEchoRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136577,6 +149623,8 @@ class UnitTestingTimedInvokeRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136630,6 +149678,8 @@ class UnitTestingTestSimpleOptionalArgumentRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136678,19 +149728,30 @@ class UnitTestingTestEmitTestEventRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEmitTestEventRequestWithParams:params - completion:^(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testEmitTestEventRequestWithParams:params + completion:^(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136736,10 +149797,20 @@ class UnitTestingTestEmitTestFabricScopedEventRequest : public ClusterCommand { MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136779,8 +149850,11 @@ class ReadUnitTestingBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Boolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Boolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136822,6 +149896,8 @@ class WriteUnitTestingBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Boolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136868,6 +149944,11 @@ class SubscribeAttributeUnitTestingBoolean : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Boolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -136901,8 +149982,11 @@ class ReadUnitTestingBitmap8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136944,6 +150028,8 @@ class WriteUnitTestingBitmap8 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136990,6 +150076,11 @@ class SubscribeAttributeUnitTestingBitmap8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137023,8 +150114,11 @@ class ReadUnitTestingBitmap16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137066,6 +150160,8 @@ class WriteUnitTestingBitmap16 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137112,6 +150208,11 @@ class SubscribeAttributeUnitTestingBitmap16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137145,8 +150246,11 @@ class ReadUnitTestingBitmap32 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap32 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap32 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137188,6 +150292,8 @@ class WriteUnitTestingBitmap32 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap32 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137234,6 +150340,11 @@ class SubscribeAttributeUnitTestingBitmap32 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap32 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137267,8 +150378,11 @@ class ReadUnitTestingBitmap64 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap64WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap64 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap64 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137310,6 +150424,8 @@ class WriteUnitTestingBitmap64 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap64 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137356,6 +150472,11 @@ class SubscribeAttributeUnitTestingBitmap64 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap64 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137389,8 +150510,11 @@ class ReadUnitTestingInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137432,6 +150556,8 @@ class WriteUnitTestingInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137478,6 +150604,11 @@ class SubscribeAttributeUnitTestingInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137511,8 +150642,11 @@ class ReadUnitTestingInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137554,6 +150688,8 @@ class WriteUnitTestingInt16u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137600,6 +150736,11 @@ class SubscribeAttributeUnitTestingInt16u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137633,8 +150774,11 @@ class ReadUnitTestingInt24u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt24uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int24u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137676,6 +150820,8 @@ class WriteUnitTestingInt24u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int24u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137722,6 +150868,11 @@ class SubscribeAttributeUnitTestingInt24u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137755,8 +150906,11 @@ class ReadUnitTestingInt32u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt32uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int32u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137798,6 +150952,8 @@ class WriteUnitTestingInt32u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int32u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137844,6 +151000,11 @@ class SubscribeAttributeUnitTestingInt32u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137877,8 +151038,11 @@ class ReadUnitTestingInt40u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt40uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int40u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137920,6 +151084,8 @@ class WriteUnitTestingInt40u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int40u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137966,6 +151132,11 @@ class SubscribeAttributeUnitTestingInt40u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137999,8 +151170,11 @@ class ReadUnitTestingInt48u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt48uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int48u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138042,6 +151216,8 @@ class WriteUnitTestingInt48u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int48u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138088,6 +151264,11 @@ class SubscribeAttributeUnitTestingInt48u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138121,8 +151302,11 @@ class ReadUnitTestingInt56u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt56uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int56u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138164,6 +151348,8 @@ class WriteUnitTestingInt56u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int56u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138210,6 +151396,11 @@ class SubscribeAttributeUnitTestingInt56u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138243,8 +151434,11 @@ class ReadUnitTestingInt64u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt64uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int64u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138286,6 +151480,8 @@ class WriteUnitTestingInt64u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int64u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138332,6 +151528,11 @@ class SubscribeAttributeUnitTestingInt64u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138365,8 +151566,11 @@ class ReadUnitTestingInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138408,6 +151612,8 @@ class WriteUnitTestingInt8s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138454,6 +151660,11 @@ class SubscribeAttributeUnitTestingInt8s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138487,8 +151698,11 @@ class ReadUnitTestingInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138530,6 +151744,8 @@ class WriteUnitTestingInt16s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138576,6 +151792,11 @@ class SubscribeAttributeUnitTestingInt16s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138609,8 +151830,11 @@ class ReadUnitTestingInt24s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt24sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int24s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138652,6 +151876,8 @@ class WriteUnitTestingInt24s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int24s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138698,6 +151924,11 @@ class SubscribeAttributeUnitTestingInt24s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138731,8 +151962,11 @@ class ReadUnitTestingInt32s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt32sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int32s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138774,6 +152008,8 @@ class WriteUnitTestingInt32s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int32s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138820,6 +152056,11 @@ class SubscribeAttributeUnitTestingInt32s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138853,8 +152094,11 @@ class ReadUnitTestingInt40s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt40sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int40s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138896,6 +152140,8 @@ class WriteUnitTestingInt40s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int40s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138942,6 +152188,11 @@ class SubscribeAttributeUnitTestingInt40s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138975,8 +152226,11 @@ class ReadUnitTestingInt48s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt48sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int48s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139018,6 +152272,8 @@ class WriteUnitTestingInt48s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int48s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139064,6 +152320,11 @@ class SubscribeAttributeUnitTestingInt48s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139097,8 +152358,11 @@ class ReadUnitTestingInt56s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt56sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int56s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139140,6 +152404,8 @@ class WriteUnitTestingInt56s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int56s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139186,6 +152452,11 @@ class SubscribeAttributeUnitTestingInt56s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139219,8 +152490,11 @@ class ReadUnitTestingInt64s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt64sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int64s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139262,6 +152536,8 @@ class WriteUnitTestingInt64s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int64s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139308,6 +152584,11 @@ class SubscribeAttributeUnitTestingInt64s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139341,8 +152622,11 @@ class ReadUnitTestingEnum8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnum8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Enum8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139384,6 +152668,8 @@ class WriteUnitTestingEnum8 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Enum8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139430,6 +152716,11 @@ class SubscribeAttributeUnitTestingEnum8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139463,8 +152754,11 @@ class ReadUnitTestingEnum16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnum16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Enum16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139506,6 +152800,8 @@ class WriteUnitTestingEnum16 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Enum16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139552,6 +152848,11 @@ class SubscribeAttributeUnitTestingEnum16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139585,8 +152886,11 @@ class ReadUnitTestingFloatSingle : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFloatSingleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatSingle response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FloatSingle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139628,6 +152932,8 @@ class WriteUnitTestingFloatSingle : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting FloatSingle write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139674,6 +152980,11 @@ class SubscribeAttributeUnitTestingFloatSingle : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatSingle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139707,8 +153018,11 @@ class ReadUnitTestingFloatDouble : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFloatDoubleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatDouble response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FloatDouble read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139750,6 +153064,8 @@ class WriteUnitTestingFloatDouble : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting FloatDouble write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139796,6 +153112,11 @@ class SubscribeAttributeUnitTestingFloatDouble : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatDouble response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139829,8 +153150,11 @@ class ReadUnitTestingOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.OctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting OctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139872,6 +153196,8 @@ class WriteUnitTestingOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting OctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139918,6 +153244,11 @@ class SubscribeAttributeUnitTestingOctetString : public SubscribeAttribute { } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.OctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139951,8 +153282,11 @@ class ReadUnitTestingListInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListInt8uWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140004,6 +153338,8 @@ class WriteUnitTestingListInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140051,6 +153387,11 @@ class SubscribeAttributeUnitTestingListInt8u : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140084,8 +153425,11 @@ class ReadUnitTestingListOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140137,6 +153481,8 @@ class WriteUnitTestingListOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140184,6 +153530,11 @@ class SubscribeAttributeUnitTestingListOctetString : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140217,8 +153568,11 @@ class ReadUnitTestingListStructOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListStructOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListStructOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListStructOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140272,6 +153626,8 @@ class WriteUnitTestingListStructOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListStructOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140320,6 +153676,11 @@ class SubscribeAttributeUnitTestingListStructOctetString : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListStructOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140353,8 +153714,11 @@ class ReadUnitTestingLongOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLongOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting LongOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140396,6 +153760,8 @@ class WriteUnitTestingLongOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting LongOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140442,6 +153808,11 @@ class SubscribeAttributeUnitTestingLongOctetString : public SubscribeAttribute { } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140475,8 +153846,11 @@ class ReadUnitTestingCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.CharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting CharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140520,6 +153894,8 @@ class WriteUnitTestingCharString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting CharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140566,6 +153942,11 @@ class SubscribeAttributeUnitTestingCharString : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.CharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140599,8 +153980,11 @@ class ReadUnitTestingLongCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLongCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongCharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting LongCharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140644,6 +154028,8 @@ class WriteUnitTestingLongCharString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting LongCharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140690,6 +154076,11 @@ class SubscribeAttributeUnitTestingLongCharString : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongCharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140723,8 +154114,11 @@ class ReadUnitTestingEpochUs : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEpochUsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochUs response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EpochUs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140766,6 +154160,8 @@ class WriteUnitTestingEpochUs : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EpochUs write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140812,6 +154208,11 @@ class SubscribeAttributeUnitTestingEpochUs : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochUs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140845,8 +154246,11 @@ class ReadUnitTestingEpochS : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEpochSWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochS response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EpochS read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140888,6 +154292,8 @@ class WriteUnitTestingEpochS : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EpochS write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140934,6 +154340,11 @@ class SubscribeAttributeUnitTestingEpochS : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochS response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140967,8 +154378,11 @@ class ReadUnitTestingVendorId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.VendorId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting VendorId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141010,6 +154424,8 @@ class WriteUnitTestingVendorId : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting VendorId write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141056,6 +154472,11 @@ class SubscribeAttributeUnitTestingVendorId : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.VendorId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141090,8 +154511,11 @@ class ReadUnitTestingListNullablesAndOptionalsStruct : public ReadAttribute { [cluster readAttributeListNullablesAndOptionalsStructWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListNullablesAndOptionalsStruct response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListNullablesAndOptionalsStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141296,6 +154720,8 @@ class WriteUnitTestingListNullablesAndOptionalsStruct : public WriteAttribute { LogNSError( "UnitTesting ListNullablesAndOptionalsStruct write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141345,6 +154771,11 @@ class SubscribeAttributeUnitTestingListNullablesAndOptionalsStruct : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListNullablesAndOptionalsStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141378,8 +154809,11 @@ class ReadUnitTestingEnumAttr : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnumAttrWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EnumAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EnumAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141421,6 +154855,8 @@ class WriteUnitTestingEnumAttr : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EnumAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141467,6 +154903,11 @@ class SubscribeAttributeUnitTestingEnumAttr : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EnumAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141501,8 +154942,11 @@ class ReadUnitTestingStructAttr : public ReadAttribute { [cluster readAttributeStructAttrWithCompletion:^( MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.StructAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting StructAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141554,6 +154998,8 @@ class WriteUnitTestingStructAttr : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting StructAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141601,6 +155047,11 @@ class SubscribeAttributeUnitTestingStructAttr : public SubscribeAttribute { } reportHandler:^(MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.StructAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141634,8 +155085,11 @@ class ReadUnitTestingRangeRestrictedInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141677,6 +155131,8 @@ class WriteUnitTestingRangeRestrictedInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141723,6 +155179,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt8u : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141756,8 +155217,11 @@ class ReadUnitTestingRangeRestrictedInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141799,6 +155263,8 @@ class WriteUnitTestingRangeRestrictedInt8s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141845,6 +155311,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt8s : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141878,8 +155349,11 @@ class ReadUnitTestingRangeRestrictedInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141921,6 +155395,8 @@ class WriteUnitTestingRangeRestrictedInt16u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141967,6 +155443,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt16u : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142000,8 +155481,11 @@ class ReadUnitTestingRangeRestrictedInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142043,6 +155527,8 @@ class WriteUnitTestingRangeRestrictedInt16s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142089,6 +155575,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt16s : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142122,8 +155613,11 @@ class ReadUnitTestingListLongOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListLongOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListLongOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListLongOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142175,6 +155669,8 @@ class WriteUnitTestingListLongOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListLongOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142222,6 +155718,11 @@ class SubscribeAttributeUnitTestingListLongOctetString : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListLongOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142260,8 +155761,13 @@ class ReadUnitTestingListFabricScoped : public ReadAttribute { [cluster readAttributeListFabricScopedWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListFabricScoped response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListFabricScoped read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142362,6 +155868,8 @@ class WriteUnitTestingListFabricScoped : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListFabricScoped write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142410,6 +155918,11 @@ class SubscribeAttributeUnitTestingListFabricScoped : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListFabricScoped response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142443,8 +155956,11 @@ class ReadUnitTestingTimedWriteBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimedWriteBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.TimedWriteBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting TimedWriteBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142486,6 +156002,8 @@ class WriteUnitTestingTimedWriteBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting TimedWriteBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142532,6 +156050,11 @@ class SubscribeAttributeUnitTestingTimedWriteBoolean : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.TimedWriteBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142565,8 +156088,11 @@ class ReadUnitTestingGeneralErrorBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneralErrorBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneralErrorBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting GeneralErrorBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142608,6 +156134,8 @@ class WriteUnitTestingGeneralErrorBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting GeneralErrorBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142654,6 +156182,11 @@ class SubscribeAttributeUnitTestingGeneralErrorBoolean : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneralErrorBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142687,8 +156220,11 @@ class ReadUnitTestingClusterErrorBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterErrorBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterErrorBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ClusterErrorBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142730,6 +156266,8 @@ class WriteUnitTestingClusterErrorBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ClusterErrorBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142776,6 +156314,11 @@ class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterErrorBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142809,8 +156352,11 @@ class ReadUnitTestingUnsupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnsupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Unsupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Unsupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142852,6 +156398,8 @@ class WriteUnitTestingUnsupported : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Unsupported write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142898,6 +156446,11 @@ class SubscribeAttributeUnitTestingUnsupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Unsupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142931,8 +156484,11 @@ class ReadUnitTestingNullableBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142967,13 +156523,18 @@ class WriteUnitTestingNullableBoolean : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithBool:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithBool:mValue.Value()]; + } [cluster writeAttributeNullableBooleanWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142981,7 +156542,7 @@ class WriteUnitTestingNullableBoolean : public WriteAttribute { } private: - bool mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBoolean : public SubscribeAttribute { @@ -143020,6 +156581,11 @@ class SubscribeAttributeUnitTestingNullableBoolean : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143053,8 +156619,11 @@ class ReadUnitTestingNullableBitmap8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143089,13 +156658,18 @@ class WriteUnitTestingNullableBitmap8 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableBitmap8WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143103,7 +156677,7 @@ class WriteUnitTestingNullableBitmap8 : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap8 : public SubscribeAttribute { @@ -143142,6 +156716,11 @@ class SubscribeAttributeUnitTestingNullableBitmap8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143175,8 +156754,11 @@ class ReadUnitTestingNullableBitmap16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143211,13 +156793,18 @@ class WriteUnitTestingNullableBitmap16 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableBitmap16WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143225,7 +156812,7 @@ class WriteUnitTestingNullableBitmap16 : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap16 : public SubscribeAttribute { @@ -143264,6 +156851,11 @@ class SubscribeAttributeUnitTestingNullableBitmap16 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143297,8 +156889,11 @@ class ReadUnitTestingNullableBitmap32 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap32 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap32 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143333,13 +156928,18 @@ class WriteUnitTestingNullableBitmap32 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableBitmap32WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap32 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143347,7 +156947,7 @@ class WriteUnitTestingNullableBitmap32 : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap32 : public SubscribeAttribute { @@ -143386,6 +156986,11 @@ class SubscribeAttributeUnitTestingNullableBitmap32 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap32 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143419,8 +157024,11 @@ class ReadUnitTestingNullableBitmap64 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap64WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap64 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap64 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143455,13 +157063,18 @@ class WriteUnitTestingNullableBitmap64 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableBitmap64WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap64 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143469,7 +157082,7 @@ class WriteUnitTestingNullableBitmap64 : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap64 : public SubscribeAttribute { @@ -143508,6 +157121,11 @@ class SubscribeAttributeUnitTestingNullableBitmap64 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap64 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143541,8 +157159,11 @@ class ReadUnitTestingNullableInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143577,13 +157198,18 @@ class WriteUnitTestingNullableInt8u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableInt8uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143591,7 +157217,7 @@ class WriteUnitTestingNullableInt8u : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt8u : public SubscribeAttribute { @@ -143630,6 +157256,11 @@ class SubscribeAttributeUnitTestingNullableInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143663,8 +157294,11 @@ class ReadUnitTestingNullableInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143699,13 +157333,18 @@ class WriteUnitTestingNullableInt16u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableInt16uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143713,7 +157352,7 @@ class WriteUnitTestingNullableInt16u : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt16u : public SubscribeAttribute { @@ -143752,6 +157391,11 @@ class SubscribeAttributeUnitTestingNullableInt16u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143785,8 +157429,11 @@ class ReadUnitTestingNullableInt24u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt24uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt24u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143821,13 +157468,18 @@ class WriteUnitTestingNullableInt24u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableInt24uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt24u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143835,7 +157487,7 @@ class WriteUnitTestingNullableInt24u : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt24u : public SubscribeAttribute { @@ -143874,6 +157526,11 @@ class SubscribeAttributeUnitTestingNullableInt24u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143907,8 +157564,11 @@ class ReadUnitTestingNullableInt32u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt32uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt32u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143943,13 +157603,18 @@ class WriteUnitTestingNullableInt32u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableInt32uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt32u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143957,7 +157622,7 @@ class WriteUnitTestingNullableInt32u : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt32u : public SubscribeAttribute { @@ -143996,6 +157661,11 @@ class SubscribeAttributeUnitTestingNullableInt32u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144029,8 +157699,11 @@ class ReadUnitTestingNullableInt40u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt40uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt40u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144065,13 +157738,18 @@ class WriteUnitTestingNullableInt40u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt40uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt40u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144079,7 +157757,7 @@ class WriteUnitTestingNullableInt40u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt40u : public SubscribeAttribute { @@ -144118,6 +157796,11 @@ class SubscribeAttributeUnitTestingNullableInt40u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144151,8 +157834,11 @@ class ReadUnitTestingNullableInt48u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt48uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt48u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144187,13 +157873,18 @@ class WriteUnitTestingNullableInt48u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt48uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt48u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144201,7 +157892,7 @@ class WriteUnitTestingNullableInt48u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt48u : public SubscribeAttribute { @@ -144240,6 +157931,11 @@ class SubscribeAttributeUnitTestingNullableInt48u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144273,8 +157969,11 @@ class ReadUnitTestingNullableInt56u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt56uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt56u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144309,13 +158008,18 @@ class WriteUnitTestingNullableInt56u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt56uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt56u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144323,7 +158027,7 @@ class WriteUnitTestingNullableInt56u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt56u : public SubscribeAttribute { @@ -144362,6 +158066,11 @@ class SubscribeAttributeUnitTestingNullableInt56u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144395,8 +158104,11 @@ class ReadUnitTestingNullableInt64u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt64uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt64u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144431,13 +158143,18 @@ class WriteUnitTestingNullableInt64u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt64uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt64u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144445,7 +158162,7 @@ class WriteUnitTestingNullableInt64u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt64u : public SubscribeAttribute { @@ -144484,6 +158201,11 @@ class SubscribeAttributeUnitTestingNullableInt64u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144517,8 +158239,11 @@ class ReadUnitTestingNullableInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144553,13 +158278,18 @@ class WriteUnitTestingNullableInt8s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithChar:mValue.Value()]; + } [cluster writeAttributeNullableInt8sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144567,7 +158297,7 @@ class WriteUnitTestingNullableInt8s : public WriteAttribute { } private: - int8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt8s : public SubscribeAttribute { @@ -144606,6 +158336,11 @@ class SubscribeAttributeUnitTestingNullableInt8s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144639,8 +158374,11 @@ class ReadUnitTestingNullableInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144675,13 +158413,18 @@ class WriteUnitTestingNullableInt16s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithShort:mValue.Value()]; + } [cluster writeAttributeNullableInt16sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144689,7 +158432,7 @@ class WriteUnitTestingNullableInt16s : public WriteAttribute { } private: - int16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt16s : public SubscribeAttribute { @@ -144728,6 +158471,11 @@ class SubscribeAttributeUnitTestingNullableInt16s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144761,8 +158509,11 @@ class ReadUnitTestingNullableInt24s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt24sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt24s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144797,13 +158548,18 @@ class WriteUnitTestingNullableInt24s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithInt:mValue.Value()]; + } [cluster writeAttributeNullableInt24sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt24s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144811,7 +158567,7 @@ class WriteUnitTestingNullableInt24s : public WriteAttribute { } private: - int32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt24s : public SubscribeAttribute { @@ -144850,6 +158606,11 @@ class SubscribeAttributeUnitTestingNullableInt24s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144883,8 +158644,11 @@ class ReadUnitTestingNullableInt32s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt32sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt32s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144919,13 +158683,18 @@ class WriteUnitTestingNullableInt32s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithInt:mValue.Value()]; + } [cluster writeAttributeNullableInt32sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt32s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144933,7 +158702,7 @@ class WriteUnitTestingNullableInt32s : public WriteAttribute { } private: - int32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt32s : public SubscribeAttribute { @@ -144972,6 +158741,11 @@ class SubscribeAttributeUnitTestingNullableInt32s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145005,8 +158779,11 @@ class ReadUnitTestingNullableInt40s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt40sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt40s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145041,13 +158818,18 @@ class WriteUnitTestingNullableInt40s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt40sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt40s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145055,7 +158837,7 @@ class WriteUnitTestingNullableInt40s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt40s : public SubscribeAttribute { @@ -145094,6 +158876,11 @@ class SubscribeAttributeUnitTestingNullableInt40s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145127,8 +158914,11 @@ class ReadUnitTestingNullableInt48s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt48sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt48s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145163,13 +158953,18 @@ class WriteUnitTestingNullableInt48s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt48sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt48s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145177,7 +158972,7 @@ class WriteUnitTestingNullableInt48s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt48s : public SubscribeAttribute { @@ -145216,6 +159011,11 @@ class SubscribeAttributeUnitTestingNullableInt48s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145249,8 +159049,11 @@ class ReadUnitTestingNullableInt56s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt56sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt56s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145285,13 +159088,18 @@ class WriteUnitTestingNullableInt56s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt56sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt56s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145299,7 +159107,7 @@ class WriteUnitTestingNullableInt56s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt56s : public SubscribeAttribute { @@ -145338,6 +159146,11 @@ class SubscribeAttributeUnitTestingNullableInt56s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145371,8 +159184,11 @@ class ReadUnitTestingNullableInt64s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt64sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt64s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145407,13 +159223,18 @@ class WriteUnitTestingNullableInt64s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt64sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt64s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145421,7 +159242,7 @@ class WriteUnitTestingNullableInt64s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt64s : public SubscribeAttribute { @@ -145460,6 +159281,11 @@ class SubscribeAttributeUnitTestingNullableInt64s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145493,8 +159319,11 @@ class ReadUnitTestingNullableEnum8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnum8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnum8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145529,13 +159358,18 @@ class WriteUnitTestingNullableEnum8 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableEnum8WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnum8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145543,7 +159377,7 @@ class WriteUnitTestingNullableEnum8 : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnum8 : public SubscribeAttribute { @@ -145582,6 +159416,11 @@ class SubscribeAttributeUnitTestingNullableEnum8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145615,8 +159454,11 @@ class ReadUnitTestingNullableEnum16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnum16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnum16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145651,13 +159493,18 @@ class WriteUnitTestingNullableEnum16 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableEnum16WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnum16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145665,7 +159512,7 @@ class WriteUnitTestingNullableEnum16 : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnum16 : public SubscribeAttribute { @@ -145704,6 +159551,11 @@ class SubscribeAttributeUnitTestingNullableEnum16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145737,8 +159589,11 @@ class ReadUnitTestingNullableFloatSingle : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableFloatSingleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatSingle response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableFloatSingle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145773,13 +159628,18 @@ class WriteUnitTestingNullableFloatSingle : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithFloat:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithFloat:mValue.Value()]; + } [cluster writeAttributeNullableFloatSingleWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableFloatSingle write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145787,7 +159647,7 @@ class WriteUnitTestingNullableFloatSingle : public WriteAttribute { } private: - float mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableFloatSingle : public SubscribeAttribute { @@ -145826,6 +159686,11 @@ class SubscribeAttributeUnitTestingNullableFloatSingle : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatSingle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145859,8 +159724,11 @@ class ReadUnitTestingNullableFloatDouble : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableFloatDoubleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatDouble response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableFloatDouble read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145895,13 +159763,18 @@ class WriteUnitTestingNullableFloatDouble : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithDouble:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithDouble:mValue.Value()]; + } [cluster writeAttributeNullableFloatDoubleWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableFloatDouble write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145909,7 +159782,7 @@ class WriteUnitTestingNullableFloatDouble : public WriteAttribute { } private: - double mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableFloatDouble : public SubscribeAttribute { @@ -145948,6 +159821,11 @@ class SubscribeAttributeUnitTestingNullableFloatDouble : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatDouble response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145981,8 +159859,11 @@ class ReadUnitTestingNullableOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146017,13 +159898,18 @@ class WriteUnitTestingNullableOctetString : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSData * _Nullable value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + NSData * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; + } [cluster writeAttributeNullableOctetStringWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146031,7 +159917,7 @@ class WriteUnitTestingNullableOctetString : public WriteAttribute { } private: - chip::ByteSpan mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableOctetString : public SubscribeAttribute { @@ -146070,6 +159956,11 @@ class SubscribeAttributeUnitTestingNullableOctetString : public SubscribeAttribu } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146103,8 +159994,11 @@ class ReadUnitTestingNullableCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableCharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableCharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146139,15 +160033,20 @@ class WriteUnitTestingNullableCharString : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSString * _Nullable value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSString * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [[NSString alloc] initWithBytes:mValue.Value().data() + length:mValue.Value().size() + encoding:NSUTF8StringEncoding]; + } [cluster writeAttributeNullableCharStringWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableCharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146155,7 +160054,7 @@ class WriteUnitTestingNullableCharString : public WriteAttribute { } private: - chip::ByteSpan mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableCharString : public SubscribeAttribute { @@ -146194,6 +160093,11 @@ class SubscribeAttributeUnitTestingNullableCharString : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableCharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146227,8 +160131,11 @@ class ReadUnitTestingNullableEnumAttr : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnumAttrWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnumAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnumAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146263,13 +160170,18 @@ class WriteUnitTestingNullableEnumAttr : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableEnumAttrWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnumAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146277,7 +160189,7 @@ class WriteUnitTestingNullableEnumAttr : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnumAttr : public SubscribeAttribute { @@ -146316,6 +160228,11 @@ class SubscribeAttributeUnitTestingNullableEnumAttr : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnumAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146350,8 +160267,11 @@ class ReadUnitTestingNullableStruct : public ReadAttribute { [cluster readAttributeNullableStructWithCompletion:^( MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableStruct response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146409,6 +160329,8 @@ class WriteUnitTestingNullableStruct : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableStruct write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146456,6 +160378,11 @@ class SubscribeAttributeUnitTestingNullableStruct : public SubscribeAttribute { } reportHandler:^(MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146489,8 +160416,11 @@ class ReadUnitTestingNullableRangeRestrictedInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146525,7 +160455,10 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:value params:params @@ -146533,6 +160466,8 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { if (error != nil) { LogNSError("UnitTesting NullableRangeRestrictedInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146540,7 +160475,7 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8u : public SubscribeAttribute { @@ -146579,6 +160514,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8u : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146612,8 +160552,11 @@ class ReadUnitTestingNullableRangeRestrictedInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146648,7 +160591,10 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithChar:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:value params:params @@ -146656,6 +160602,8 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { if (error != nil) { LogNSError("UnitTesting NullableRangeRestrictedInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146663,7 +160611,7 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { } private: - int8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8s : public SubscribeAttribute { @@ -146702,6 +160650,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8s : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146735,8 +160688,11 @@ class ReadUnitTestingNullableRangeRestrictedInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146771,7 +160727,10 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:value @@ -146780,6 +160739,8 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { if (error != nil) { LogNSError( "UnitTesting NullableRangeRestrictedInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146787,7 +160748,7 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16u : public SubscribeAttribute { @@ -146826,6 +160787,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16u : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146859,8 +160825,11 @@ class ReadUnitTestingNullableRangeRestrictedInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146895,7 +160864,10 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithShort:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:value @@ -146904,6 +160876,8 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { if (error != nil) { LogNSError( "UnitTesting NullableRangeRestrictedInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146911,7 +160885,7 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { } private: - int16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16s : public SubscribeAttribute { @@ -146950,6 +160924,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16s : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146983,8 +160962,11 @@ class ReadUnitTestingWriteOnlyInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWriteOnlyInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.WriteOnlyInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting WriteOnlyInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147026,6 +161008,8 @@ class WriteUnitTestingWriteOnlyInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting WriteOnlyInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147072,6 +161056,11 @@ class SubscribeAttributeUnitTestingWriteOnlyInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.WriteOnlyInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147105,8 +161094,11 @@ class ReadUnitTestingGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147150,6 +161142,11 @@ class SubscribeAttributeUnitTestingGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147183,8 +161180,11 @@ class ReadUnitTestingAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147228,6 +161228,11 @@ class SubscribeAttributeUnitTestingAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147263,8 +161268,11 @@ class ReadUnitTestingEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147308,6 +161316,11 @@ class SubscribeAttributeUnitTestingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147343,8 +161356,11 @@ class ReadUnitTestingAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147388,6 +161404,11 @@ class SubscribeAttributeUnitTestingAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147421,8 +161442,11 @@ class ReadUnitTestingFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147466,6 +161490,11 @@ class SubscribeAttributeUnitTestingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147499,8 +161528,11 @@ class ReadUnitTestingClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147544,6 +161576,11 @@ class SubscribeAttributeUnitTestingClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; From 4197b3e94cf062ce836cc185be45163a0b5d74f5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 7 Sep 2023 14:37:14 -0400 Subject: [PATCH 80/96] Silence warnings about descriptions not being handled when running YAML tests. (#29111) We kept getting these warnings: TEST ERR : WARNING:root:TAG configurator::cluster::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml:33:7 TEST ERR : WARNING:root:TAG configurator::cluster::command::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml:47:6 TEST ERR : WARNING:root:TAG configurator::clusterExtension::command::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml:21:104 The fix is to change DescriptionHandler to note that it's handling the tag. This also lets us switch events to also use DescriptionHandler. --- scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index 966d875c3355ed..9545d5ce8b51db 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -110,7 +110,7 @@ def GetNextProcessor(self, name: str, attrs): self._event.readacl = AttrsToAccessPrivilege(attrs) return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) elif name.lower() == 'description': - return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + return DescriptionHandler(self.context, self._event) else: return BaseHandler(self.context) @@ -347,7 +347,7 @@ class DescriptionHandler(BaseHandler): """ def __init__(self, context: Context, target: Any): - super().__init__(context) + super().__init__(context, handled=HandledDepth.ENTIRE_TREE) self.target = target def HandleContent(self, content): From 416bc51d269c37be364794d8311bd73d48ab17af Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 21:25:22 +0100 Subject: [PATCH 81/96] Setting the feature map of all concentration clusters to 0 in zapfile so that we don't accidentally pass CI if the cluster fails to encode it (#29104) --- .../all-clusters-app.matter | 20 +++++++++---------- .../all-clusters-common/all-clusters-app.zap | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 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 705324367f39e9..0350bdc758adcd 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 @@ -7233,7 +7233,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7252,7 +7252,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7271,7 +7271,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7290,7 +7290,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7309,7 +7309,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7328,7 +7328,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7347,7 +7347,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7366,7 +7366,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7385,7 +7385,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7404,7 +7404,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } 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 191519900a4990..6d4e6c60c4fec4 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 @@ -24162,7 +24162,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24486,7 +24486,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24810,7 +24810,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25134,7 +25134,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25458,7 +25458,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25782,7 +25782,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26106,7 +26106,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26430,7 +26430,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26754,7 +26754,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -27078,7 +27078,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From 9d95c4f8acfd44eee293d3c082a8d95ff12fd607 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 13:36:33 -0700 Subject: [PATCH 82/96] Typo fix in the API documentation (#29112) --- src/app/WriteClient.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 99c8682605c569..2323adc8a337e9 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -46,10 +46,10 @@ namespace app { class InteractionModelEngine; /** - * @brief The read client represents the initiator side of a Write Interaction, and is responsible + * @brief The write client represents the initiator side of a Write Interaction, and is responsible * for generating one Write Request for a particular set of attributes, and handling the Write response. - * Consumer can allocate one write client, then call PrepareAttribute, insert attribute value, followed by FinishAttribute for - * every attribute it wants to insert in write request, then call SendWriteRequest + * Consumer can allocate one write client, then call PrepareAttribute, insert attribute value, followed + * by FinishAttribute for every attribute it wants to insert in write request, then call SendWriteRequest * * Note: When writing lists, you may receive multiple write status responses for a single list. * Please see ChunkedWriteCallback.h for a high level API which will merge status codes for From 94b71b1f97549f6a6622e1775a43100633789a60 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:11:55 -0400 Subject: [PATCH 83/96] Added unit test for Early firing timers in the report scheduler (#29113) --- src/app/reporting/ReportScheduler.h | 1 + src/app/tests/TestReadInteraction.cpp | 143 ++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/src/app/reporting/ReportScheduler.h b/src/app/reporting/ReportScheduler.h index 54b0bb5062286f..43441be73bddf5 100644 --- a/src/app/reporting/ReportScheduler.h +++ b/src/app/reporting/ReportScheduler.h @@ -171,6 +171,7 @@ class ReportScheduler : public ReadHandler::Observer, public ICDStateObserver ReadHandlerNode * node = FindReadHandlerNode(aReadHandler); return node->GetMaxTimestamp(); } + ReadHandlerNode * GetReadHandlerNode(const ReadHandler * aReadHandler) { return FindReadHandlerNode(aReadHandler); } #endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST protected: diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index ea464c3d9471b0..7a6c88d2f04341 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -321,6 +321,9 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) class TestReadInteraction { + using Seconds16 = System::Clock::Seconds16; + using Milliseconds32 = System::Clock::Milliseconds32; + public: static void TestReadClient(nlTestSuite * apSuite, void * apContext); static void TestReadUnexpectedSubscriptionId(nlTestSuite * apSuite, void * apContext); @@ -349,6 +352,7 @@ class TestReadInteraction static void TestReadChunking(nlTestSuite * apSuite, void * apContext); static void TestSetDirtyBetweenChunks(nlTestSuite * apSuite, void * apContext); static void TestSubscribeRoundtrip(nlTestSuite * apSuite, void * apContext); + static void TestSubscribeEarlyReport(nlTestSuite * apSuite, void * apContext); static void TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite, void * apContext); static void TestSubscribeWildcard(nlTestSuite * apSuite, void * apContext); static void TestSubscribePartialOverlap(nlTestSuite * apSuite, void * apContext); @@ -2099,6 +2103,144 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } +void TestReadInteraction::TestSubscribeEarlyReport(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; + + Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); + // Shouldn't have anything in the retransmit table when starting the test. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + MockInteractionModelApp delegate; + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + ReportSchedulerImpl * reportScheduler = app::reporting::GetDefaultReportScheduler(); + err = engine->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable(), reportScheduler); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(apSuite, !delegate.mGotEventResponse); + + ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); + chip::app::EventPathParams eventPathParams[1]; + readPrepareParams.mpEventPathParamsList = eventPathParams; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; + + readPrepareParams.mEventPathParamsListSize = 1; + + readPrepareParams.mpAttributePathParamsList = nullptr; + readPrepareParams.mAttributePathParamsListSize = 0; + + readPrepareParams.mMinIntervalFloorSeconds = 1; + readPrepareParams.mMaxIntervalCeilingSeconds = 5; + + readPrepareParams.mKeepSubscriptions = true; + + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; + delegate.mGotEventResponse = false; + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + System::Clock::Timestamp startTime = gMockClock.GetMonotonicTimestamp(); + + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers() == 1); + NL_TEST_ASSERT(apSuite, engine->ActiveHandlerAt(0) != nullptr); + delegate.mpReadHandler = engine->ActiveHandlerAt(0); + + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); + + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + // Confirm that the node is scheduled to run + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + ReportScheduler::ReadHandlerNode * node = reportScheduler->GetReadHandlerNode(delegate.mpReadHandler); + NL_TEST_ASSERT(apSuite, node != nullptr); + + GenerateEvents(apSuite, apContext); + + // modify the node's min timestamp to be 50ms later than the timer expiration time + node->SetIntervalTimeStamps(delegate.mpReadHandler, startTime + Milliseconds32(50)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds) + + Milliseconds32(50)); + + NL_TEST_ASSERT(apSuite, reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) > startTime); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); + + // Advance monotonic timestamp for min interval to elapse + gMockClock.AdvanceMonotonic(Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Timer expired event + ctx.GetIOContext().DriveIO(); + + // Verify the ReadHandler is considered as reportable even if its node's min timestamp has not expired + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) > gMockClock.GetMonotonicTimestamp()); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportableNow(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + + // Service Engine Run + ctx.GetIOContext().DriveIO(); + // Service EventManagement event + ctx.GetIOContext().DriveIO(); + ctx.GetIOContext().DriveIO(); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + + // Check the logic works for timer expiring at maximum as well + NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->IsDirty()); + delegate.mGotEventResponse = false; + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + // Confirm that the node is scheduled to run + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, node != nullptr); + + // modify the node's max timestamp to be 50ms later than the timer expiration time + node->SetIntervalTimeStamps(delegate.mpReadHandler, gMockClock.GetMonotonicTimestamp() + Milliseconds32(50)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds) + + Milliseconds32(50)); + + // Advance monotonic timestamp for min interval to elapse + gMockClock.AdvanceMonotonic(Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Timer expired event + ctx.GetIOContext().DriveIO(); + + // Verify the ReadHandler is considered as reportable even if its node's min timestamp has not expired + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) > gMockClock.GetMonotonicTimestamp()); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportableNow(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->IsDirty()); + NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Engine Run + ctx.GetIOContext().DriveIO(); + // Service EventManagement event + ctx.GetIOContext().DriveIO(); + ctx.GetIOContext().DriveIO(); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + } +} + void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite, void * apContext) { TestContext & ctx = *static_cast(apContext); @@ -4796,6 +4938,7 @@ const nlTest sTests[] = NL_TEST_DEF("TestICDProcessSubscribeRequestInvalidIdleModeInterval", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeInterval), #endif // #if CHIP_CONFIG_ENABLE_ICD_SERVER NL_TEST_DEF("TestSubscribeRoundtrip", chip::app::TestReadInteraction::TestSubscribeRoundtrip), + NL_TEST_DEF("TestSubscribeEarlyReport", chip::app::TestReadInteraction::TestSubscribeEarlyReport), NL_TEST_DEF("TestPostSubscribeRoundtripChunkReport", chip::app::TestReadInteraction::TestPostSubscribeRoundtripChunkReport), NL_TEST_DEF("TestReadClientReceiveInvalidMessage", chip::app::TestReadInteraction::TestReadClientReceiveInvalidMessage), NL_TEST_DEF("TestSubscribeClientReceiveInvalidStatusResponse", chip::app::TestReadInteraction::TestSubscribeClientReceiveInvalidStatusResponse), From 9384bf66288674285ca2ae7c3195deead82c9efc Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 7 Sep 2023 19:44:26 -0400 Subject: [PATCH 84/96] Update description tag handling in xml (#29114) * Update description tag handling in xml * enable description on events * Fix test --- scripts/py_matter_idl/matter_idl/matter_idl_types.py | 1 + scripts/py_matter_idl/matter_idl/test_xml_parser.py | 1 + scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index eb86e3ec4b99fc..3a680058c5e24d 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -166,6 +166,7 @@ class Event: fields: List[Field] readacl: AccessPrivilege = AccessPrivilege.VIEW qualities: EventQuality = EventQuality.NONE + description: Optional[str] = None @property def is_fabric_sensitive(self): diff --git a/scripts/py_matter_idl/matter_idl/test_xml_parser.py b/scripts/py_matter_idl/matter_idl/test_xml_parser.py index d8c7bb0a6c5dc1..6f42ca3c71d6b7 100755 --- a/scripts/py_matter_idl/matter_idl/test_xml_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_xml_parser.py @@ -212,6 +212,7 @@ def testFabricScopedAndSensitive(self): events=[Event(priority=EventPriority.INFO, name='FabricEvent', code=0x1234, + description="This is a test event", fields=[Field(data_type=DataType(name='node_id'), code=1, name='AdminNodeID', diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index 9545d5ce8b51db..8150924efe1c4c 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -347,7 +347,7 @@ class DescriptionHandler(BaseHandler): """ def __init__(self, context: Context, target: Any): - super().__init__(context, handled=HandledDepth.ENTIRE_TREE) + super().__init__(context, handled=HandledDepth.SINGLE_TAG) self.target = target def HandleContent(self, content): From 013412713049332f886f589ca004fee31df49072 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 00:10:45 -0400 Subject: [PATCH 85/96] Update ZAP to v2023.09.05-nightly. (#29095) This should fix UI issues around enabling/disabling events. The .zap changes are from ZAP files that were last edited/generated with a too-old version of ZAP (from before v2023.08.30-nightly). --- .../rootnode_dishwasher_cc105034fe.zap | 3 +- .../rootnode_laundrywasher_fb10d238c8.zap | 3 +- .../chef/devices/rootnode_pump_5f904818cc.zap | 39 +++++++------------ ...emperaturecontrolledcabinet_ffdb696680.zap | 3 +- .../refrigerator-common/refrigerator-app.zap | 33 +++------------- .../resource-monitoring-app.zap | 15 ++++--- scripts/setup/zap.json | 4 +- scripts/setup/zap.version | 2 +- scripts/tools/zap/zap_execution.py | 2 +- 9 files changed, 34 insertions(+), 70 deletions(-) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index bdd388535f5020..df18b2b1ff5e45 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -10833,6 +10833,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 185729bcbfc1e3..85c94b1a55186b 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -11081,6 +11081,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index bd00cd5534b9fa..6966139ba33d50 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6244,7 +6239,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -6252,16 +6246,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -7689,7 +7679,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7705,7 +7695,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7721,7 +7711,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7737,7 +7727,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7981,7 +7971,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7997,7 +7987,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8013,7 +8003,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8029,7 +8019,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8193,7 +8183,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8209,7 +8199,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8225,7 +8215,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8241,7 +8231,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8302,6 +8292,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index c41e00c3ca48d6..449ce9ef3cd474 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -12727,6 +12727,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index feb4bcca1dda01..5752fd943abbd9 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 8, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 7, + "id": 2, "name": "MA-refrigerator", "deviceTypeRef": { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", "name": "MA-refrigerator" } ], - "deviceTypeRefs": [ - 48 - ], "deviceVersions": [ 1 ], @@ -11686,10 +11676,9 @@ ] }, { - "id": 5, + "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -11697,16 +11686,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12202,10 +12187,9 @@ ] }, { - "id": 6, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -12213,16 +12197,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12747,6 +12727,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 60857f16ab28e3..1124e42b5cc5f2 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -29,6 +23,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -6993,6 +6993,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index d763e123ff712b..3b1253b9ee0045 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.09.01-nightly.1"] + "tags": ["version:2@v2023.09.05-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.09.01-nightly.1"] + "tags": ["version:2@v2023.09.05-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 5af16d0daf37f9..f3a4acca4e93d2 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.09.01-nightly +v2023.09.05-nightly diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 5dbff86656cd17..bd5f609d4164d5 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.9.1' +MIN_ZAP_VERSION = '2023.9.5' class ZapTool: From ce66c4da38ac20070c0ab0e8701a3621d79fa831 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 00:59:45 -0400 Subject: [PATCH 86/96] Make MatterReportingAttributeChangeCallback calls in operational state server a bit smaller. (#29028) Having the path creation be inside the common out-of-line callee saves some codesize. --- .../operational-state-server.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index ea8ecd3df1f06f..0c8c4f907b1ab8 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -78,8 +78,7 @@ CHIP_ERROR Instance::SetCurrentPhase(const DataModel::Nullable & aPhase mCurrentPhase = aPhase; if (mCurrentPhase != oldPhase) { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::CurrentPhase::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::CurrentPhase::Id); } return CHIP_NO_ERROR; } @@ -95,16 +94,14 @@ CHIP_ERROR Instance::SetOperationalState(uint8_t aOpState) if (mOperationalError.errorStateID != to_underlying(ErrorStateEnum::kNoError)) { mOperationalError.Set(to_underlying(ErrorStateEnum::kNoError)); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalError::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalError::Id); } uint8_t oldState = mOperationalState; mOperationalState = aOpState; if (mOperationalState != oldState) { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalState::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalState::Id); } return CHIP_NO_ERROR; } @@ -130,17 +127,15 @@ void Instance::OnOperationalErrorDetected(const Structs::ErrorStateStruct::Type // Set the OperationalState attribute to Error if (mOperationalState != to_underlying(OperationalStateEnum::kError)) { - mOperationalState = to_underlying(OperationalStateEnum::kError); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalState::Id); - MatterReportingAttributeChangeCallback(path); + mOperationalState = to_underlying(OperationalStateEnum::kError); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalState::Id); } // Set the OperationalError attribute if (!mOperationalError.IsEqual(aError)) { mOperationalError.Set(aError.errorStateID, aError.errorStateLabel, aError.errorStateDetails); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalError::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalError::Id); } // Generate an ErrorDetected event From ecc0d63cf7eb91f4017bf8c264b53cf690420eb5 Mon Sep 17 00:00:00 2001 From: PSONALl <77670766+PSONALl@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:30:44 +0530 Subject: [PATCH 87/96] Add rule for esp-insights component (#29123) --- config/esp32/components/chip/CMakeLists.txt | 7 ++++++- config/esp32/components/chip/idf_component.yml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 2f8655b81130ee..61920102605cba 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -484,8 +484,13 @@ foreach(phy_blob ${phy_blobs}) endforeach() set(components_to_link esp_event hal esp_system soc efuse vfs driver esp_coex freertos) +idf_build_get_property(build_components BUILD_COMPONENTS) foreach(component ${components_to_link}) - idf_component_get_property(lib_name ${component} COMPONENT_LIB) + # Some of the components are not present in IDF v4.x + # So, Check if the component is in the list of build components + if("${component}" IN_LIST build_components) + idf_component_get_property(lib_name ${component} COMPONENT_LIB) + endif() list(APPEND chip_libraries $) endforeach() diff --git a/config/esp32/components/chip/idf_component.yml b/config/esp32/components/chip/idf_component.yml index d613993afff206..9b888d269c166e 100644 --- a/config/esp32/components/chip/idf_component.yml +++ b/config/esp32/components/chip/idf_component.yml @@ -20,3 +20,7 @@ dependencies: espressif/esp_insights: version: "1.0.1" require: public + # There is an issue with IDF-Component-Manager when ESP Insights is included. + # Issue: https://github.com/project-chip/connectedhomeip/issues/29125 + rules: + - if: "idf_version >=5.0" From 5ae3c657a8f17582d1af0c8abc9a8642c7185ad2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 13:19:40 -0400 Subject: [PATCH 88/96] Actually enable our YAML tests in the python-calls-chip-tool runner. (#29096) * Actually enable our YAML tests in the python-calls-chip-tool runner. We were now getting the right test list, but for each test we were not finding the test file. And the harness did not treat that as an error. * Address review comments. * Fix chip-repl CI --- .github/workflows/tests.yaml | 1 + scripts/tests/chiptest/__init__.py | 37 ++++++- scripts/tests/chiptest/test_definition.py | 1 + scripts/tests/run_test_suite.py | 1 + scripts/tests/yaml/runner.py | 6 +- .../tests/suites/TestClusterMultiFabric.yaml | 98 +++++++------------ src/app/tests/suites/TestEventsById.yaml | 18 ++-- 7 files changed, 87 insertions(+), 75 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 15057ec27b2b4d..ce0881ae6c1cec 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -223,6 +223,7 @@ jobs: --exclude-tags MANUAL \ --exclude-tags FLAKY \ --exclude-tags IN_DEVELOPMENT \ + --exclude-tags EXTRA_SLOW \ --exclude-tags SLOW \ run \ --iterations 1 \ diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index ce312d492beabd..6267ee037db863 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -47,6 +47,9 @@ class ManualTest: "PICS_Example.yaml", "Response_Example.yaml", "Test_Example.yaml", + "Test_Example_1.yaml", + "Test_Example_2.yaml", + "Test_Example_3.yaml", } @@ -127,6 +130,16 @@ def _GetSlowTests() -> Set[str]: } +def _GetExtraSlowTests() -> Set[str]: + """Generally tests using sleep() so much they should never run in CI. + + 1 minute seems like a good threshold to consider something extra slow + """ + return { + "Test_TC_DGGEN_2_1.yaml", # > 2 hours + } + + def _GetInDevelopmentTests() -> Set[str]: """Tests that fail in YAML for some reason.""" return { @@ -145,6 +158,8 @@ def _GetInDevelopmentTests() -> Set[str]: # TestEventTriggersEnabled is true, which it's not in CI. "Test_TC_SMOKECO_2_6.yaml", # chip-repl does not support local timeout (07/20/2023) and test assumes # TestEventTriggersEnabled is true, which it's not in CI. + "Test_TC_IDM_1_2.yaml", # Broken harness: https://github.com/project-chip/connectedhomeip/issues/29115 + "Test_TC_S_2_4.yaml", # https://github.com/project-chip/connectedhomeip/issues/29117 } @@ -177,6 +192,8 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 + "TestClusterMultiFabric.yaml", } @@ -243,10 +260,14 @@ def tests_with_command(chip_tool: str, is_manual: bool): ) -def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): +def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short_run_name: bool): + """ + use_short_run_name should be true if we want the run_name to be "Test_ABC" instead of "some/path/Test_ABC.yaml" + """ manual_tests = _GetManualTests() flaky_tests = _GetFlakyTests() slow_tests = _GetSlowTests() + extra_slow_tests = _GetExtraSlowTests() in_development_tests = _GetInDevelopmentTests() chip_repl_unsupported_tests = _GetChipReplUnsupportedTests() @@ -264,14 +285,22 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): if path.name in slow_tests: tags.add(TestTag.SLOW) + if path.name in extra_slow_tests: + tags.add(TestTag.EXTRA_SLOW) + if path.name in in_development_tests: tags.add(TestTag.IN_DEVELOPMENT) if treat_repl_unsupported_as_in_development and path.name in chip_repl_unsupported_tests: tags.add(TestTag.IN_DEVELOPMENT) + if use_short_run_name: + run_name = path.stem # `path.stem` converts "some/path/Test_ABC_1.2.yaml" to "Test_ABC.1.2" + else: + run_name = str(path) + yield TestDefinition( - run_name=str(path), + run_name=run_name, name=path.stem, # `path.stem` converts "some/path/Test_ABC_1.2.yaml" to "Test_ABC.1.2" target=target_for_name(path.name), tags=tags, @@ -279,12 +308,12 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): def AllReplYamlTests(): - for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True): + for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, use_short_run_name=False): yield test def AllChipToolYamlTests(): - for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False): + for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, use_short_run_name=True): yield test diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index 08f97c98a2ea4e..68f2323a3302fc 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -218,6 +218,7 @@ class TestTag(Enum): FLAKY = auto() # test is considered flaky (usually a bug/time dependent issue) IN_DEVELOPMENT = auto() # test may not pass or undergoes changes CHIP_TOOL_PYTHON_ONLY = auto() # test uses YAML features only supported by the CHIP_TOOL_PYTHON runner. + EXTRA_SLOW = auto() # test uses Sleep and is generally _very_ slow (>= 60s is a typical threshold) def to_s(self): for (k, v) in TestTag.__members__.items(): diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 643f13ce4d92af..ae5e569b36dd59 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -174,6 +174,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, TestTag.MANUAL, TestTag.IN_DEVELOPMENT, TestTag.FLAKY, + TestTag.EXTRA_SLOW } if runtime != TestRunTime.CHIP_TOOL_PYTHON: diff --git a/scripts/tests/yaml/runner.py b/scripts/tests/yaml/runner.py index 073726fa7e4813..746fc01656f135 100755 --- a/scripts/tests/yaml/runner.py +++ b/scripts/tests/yaml/runner.py @@ -260,8 +260,12 @@ def runner_base(ctx, configuration_directory: str, test_name: str, configuration specifications = SpecDefinitionsFromPaths(specifications_paths.split(','), pseudo_clusters) tests_finder = TestsFinder(configuration_directory, configuration_name) + test_list = tests_finder.get(test_name) + if len(test_list) == 0: + raise Exception(f"No tests found for test name '{test_name}'") + parser_config = TestParserConfig(pics, specifications, kwargs) - parser_builder_config = TestParserBuilderConfig(tests_finder.get(test_name), parser_config, hooks=TestParserLogger()) + parser_builder_config = TestParserBuilderConfig(test_list, parser_config, hooks=TestParserLogger()) parser_builder_config.options.stop_on_error = stop_on_error while ctx: ctx.obj = ParserGroup(parser_builder_config, pseudo_clusters) diff --git a/src/app/tests/suites/TestClusterMultiFabric.yaml b/src/app/tests/suites/TestClusterMultiFabric.yaml index 97b38ee103df85..8d3febcf410034 100644 --- a/src/app/tests/suites/TestClusterMultiFabric.yaml +++ b/src/app/tests/suites/TestClusterMultiFabric.yaml @@ -284,8 +284,7 @@ tests: # # TODO: This can be fixed using the `saveAs` function. # - value: - [ + value: [ { FabricIndex: 1, fabricSensitiveInt8u: 33, @@ -328,39 +327,29 @@ tests: }, { FabricIndex: 2, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 2, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, ] @@ -371,43 +360,32 @@ tests: fabricFiltered: false attribute: "list_fabric_scoped" response: - value: - [ + value: [ { FabricIndex: 1, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 1, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 2, diff --git a/src/app/tests/suites/TestEventsById.yaml b/src/app/tests/suites/TestEventsById.yaml index 29224f92e3e7ac..fa772eacb1d56e 100644 --- a/src/app/tests/suites/TestEventsById.yaml +++ b/src/app/tests/suites/TestEventsById.yaml @@ -48,7 +48,8 @@ tests: value: ReadRequestMessage.Cluster - name: "EventId" value: ReadRequestMessage.Event - response: [] + response: + error: UNSUPPORTED_ENDPOINT - label: "Read Request Message with a path that indicates a specific cluster @@ -62,11 +63,12 @@ tests: value: UnsupportedCluster - name: "EventId" value: ReadRequestMessage.Event - response: [] + response: + error: UNSUPPORTED_CLUSTER - label: - "Read Request Message with a path that indicates a specific endpoint - that is unsupported" + "Read Request Message with a path that indicates a specific event that + is unsupported" cluster: "AnyCommands" command: "ReadEventById" endpoint: ReadRequestMessage.EndPoint @@ -256,9 +258,5 @@ tests: - name: "EventId" value: ReadRequestMessage.EndPoint response: - - values: - - value: { arg1: 1, arg2: 2, arg3: true } - - values: - - value: { arg1: 3, arg2: 1, arg3: false } - - values: - - value: { arg1: 4, arg2: 3, arg3: true } + # Not a valid event request path. + error: FAILURE From b043fae1d2a5c411029d6cf893ccf9abca0de048 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 20:37:02 -0400 Subject: [PATCH 89/96] Add CI testing for purposeful YAML failures. (#29099) This should catch cases when for some reason we are _not_ running the YAML tests right, and tests that should fail do not fail. --- .github/workflows/tests.yaml | 31 +++++++++++++ scripts/tests/chiptest/__init__.py | 11 +++++ scripts/tests/chiptest/test_definition.py | 1 + scripts/tests/run_test_suite.py | 33 +++++++++++--- .../TestPurposefulFailureEqualities.yaml | 44 +++++++++++++++++++ 5 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 src/app/tests/suites/TestPurposefulFailureEqualities.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ce0881ae6c1cec..aa54505bbae9ab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -214,6 +214,21 @@ jobs: --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ " + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 1 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + - name: Run Tests using chip-repl (skip slow) if: github.event_name == 'pull_request' run: | @@ -225,6 +240,7 @@ jobs: --exclude-tags IN_DEVELOPMENT \ --exclude-tags EXTRA_SLOW \ --exclude-tags SLOW \ + --exclude-tags PURPOSEFUL_FAILURE \ run \ --iterations 1 \ --test-timeout-seconds 120 \ @@ -337,6 +353,21 @@ jobs: --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ " + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 1 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 6267ee037db863..eda65d58438abe 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -197,6 +197,13 @@ def _GetChipReplUnsupportedTests() -> Set[str]: } +def _GetPurposefulFailureTests() -> Set[str]: + """Tests that fail in YAML on purpose.""" + return { + "TestPurposefulFailureEqualities.yaml" + } + + def _AllYamlTests(): yaml_test_suite_path = Path(_YAML_TEST_SUITE_PATH) @@ -270,6 +277,7 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short extra_slow_tests = _GetExtraSlowTests() in_development_tests = _GetInDevelopmentTests() chip_repl_unsupported_tests = _GetChipReplUnsupportedTests() + purposeful_failure_tests = _GetPurposefulFailureTests() for path in _AllYamlTests(): if not _IsValidYamlTest(path.name): @@ -291,6 +299,9 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short if path.name in in_development_tests: tags.add(TestTag.IN_DEVELOPMENT) + if path.name in purposeful_failure_tests: + tags.add(TestTag.PURPOSEFUL_FAILURE) + if treat_repl_unsupported_as_in_development and path.name in chip_repl_unsupported_tests: tags.add(TestTag.IN_DEVELOPMENT) diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index 68f2323a3302fc..694f8c7e75feb1 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -219,6 +219,7 @@ class TestTag(Enum): IN_DEVELOPMENT = auto() # test may not pass or undergoes changes CHIP_TOOL_PYTHON_ONLY = auto() # test uses YAML features only supported by the CHIP_TOOL_PYTHON runner. EXTRA_SLOW = auto() # test uses Sleep and is generally _very_ slow (>= 60s is a typical threshold) + PURPOSEFUL_FAILURE = auto() # test fails on purpose def to_s(self): for (k, v) in TestTag.__members__.items(): diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index ae5e569b36dd59..17124a6d9b24c1 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -174,7 +174,8 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, TestTag.MANUAL, TestTag.IN_DEVELOPMENT, TestTag.FLAKY, - TestTag.EXTRA_SLOW + TestTag.EXTRA_SLOW, + TestTag.PURPOSEFUL_FAILURE, } if runtime != TestRunTime.CHIP_TOOL_PYTHON: @@ -273,9 +274,19 @@ def cmd_list(context): default=None, type=int, help='If provided, fail if a test runs for longer than this time') +@click.option( + '--expected-failures', + type=int, + default=0, + show_default=True, + help='Number of tests that are expected to fail in each iteration. Overall test will pass if the number of failures matches this. Nonzero values require --keep-going') @click.pass_context def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app, - tv_app, bridge_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds): + tv_app, bridge_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures): + if expected_failures != 0 and not keep_going: + logging.exception(f"'--expected-failures {expected_failures}' used without '--keep-going'") + sys.exit(2) + runner = chiptest.runner.Runner() paths_finder = PathsFinder() @@ -327,8 +338,14 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o apps_register = AppsRegister() apps_register.init() + def cleanup(): + apps_register.uninit() + if sys.platform == 'linux': + chiptest.linux.ShutdownNamespaceForTestExecution() + for i in range(iterations): logging.info("Starting iteration %d" % (i+1)) + observed_failures = 0 for test in context.obj.tests: if context.obj.include_tags: if not (test.tags & context.obj.include_tags): @@ -357,13 +374,17 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o test_end = time.monotonic() logging.exception('%-30s - FAILED in %0.2f seconds' % (test.name, (test_end - test_start))) + observed_failures += 1 if not keep_going: - apps_register.uninit() + cleanup() sys.exit(2) - apps_register.uninit() - if sys.platform == 'linux': - chiptest.linux.ShutdownNamespaceForTestExecution() + if observed_failures != expected_failures: + logging.exception(f'Iteration {i}: expected failure count {expected_failures}, but got {observed_failures}') + cleanup() + sys.exit(2) + + cleanup() # On linux, allow an execution shell to be prepared diff --git a/src/app/tests/suites/TestPurposefulFailureEqualities.yaml b/src/app/tests/suites/TestPurposefulFailureEqualities.yaml new file mode 100644 index 00000000000000..14e886437d678e --- /dev/null +++ b/src/app/tests/suites/TestPurposefulFailureEqualities.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2023 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. + +name: Test that purposefully fails in EqualityCommands + +config: + nodeId: 0x12344321 + cluster: "EqualityCommands" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Compute the result of comparing 0 to 1 and claim that they are equal" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: 0 + - name: "Value2" + value: 1 + response: + - values: + - name: "Equals" + # This is the wrong value on purpose, so this test will fail. + value: true From ecba41d5fd1f7c3d7476693e54b8f64140731425 Mon Sep 17 00:00:00 2001 From: jrhees-cae <61466710+jrhees-cae@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:41:04 -0400 Subject: [PATCH 90/96] Fix partial revert of https://github.com/project-chip/connectedhomeip/commit/94c3882388c77e214f502aad94a518a340bb7f24 (#29144) caused by subsequent PR https://github.com/project-chip/connectedhomeip/commit/76848fe25811fbf55a9c6b92da5d0b77a46221b4 : - Allow SupportedOperatingModes attribute to be any of the valid combinations --- .../tests/suites/certification/Test_TC_DRLK_2_1.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index cc67a0908626ac..e54dbd3b2af7f0 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -945,10 +945,20 @@ tests: command: "readAttribute" attribute: "SupportedOperatingModes" response: - value: 0xFFF6 saveAs: Current_Supported constraints: type: enum16 + anyOf: + [ + 0xFFF6, + 0xFFF4, + 0xFFF2, + 0xFFF0, + 0xFFE6, + 0xFFE4, + 0xFFE2, + 0xFFE0, + ] - label: "Step 23b: TH writes Supported OperatingModes attribute as bit 0 is From fba066dd784b8f84babad2736b589ac889850b62 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 11 Sep 2023 13:01:39 +0800 Subject: [PATCH 91/96] Fix esp32 platform bluedroid, should send indication instead of notification. (#28923) * Fix esp32 platform bluedroid implementation, should send indication instead of notification * Add comments * Restyled by clang-format --------- Co-authored-by: Ryan Ma --- src/platform/ESP32/bluedroid/BLEManagerImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp index ef9cbece6f5fd4..b18ca5d9e7b997 100644 --- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp +++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp @@ -852,7 +852,9 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU ChipLogDetail(Ble, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, data->DataLength()); #endif - err = MapBLEError(esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), false)); + // Set param need_confirm as false will send notification, otherwise indication. + err = MapBLEError( + esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), true /* need_confirm */)); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "esp_ble_gatts_send_indicate() failed: %s", ErrorStr(err)); From e29cd6ab2f15553888de34f621ae2bb04c197129 Mon Sep 17 00:00:00 2001 From: Jaehoon-You <55170115+Jaehoon-You@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:09:04 +0900 Subject: [PATCH 92/96] virtual-device-app: Add Doorlock/PowerSource repository (#29127) Signed-off-by: Jaehoon You Signed-off-by: Charles Kim --- .../device/app/core/data/di/DataModule.kt | 13 ++++++++++ .../cluster/DoorLockManagerRepository.kt | 11 +++++++++ .../cluster/DoorLockManagerRepositoryImpl.kt | 24 +++++++++++++++++++ .../cluster/PowerSourceManagerRepository.kt | 9 +++++++ .../PowerSourceManagerRepositoryImpl.kt | 19 +++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt index 8168f632c10275..d6dadd00f2cb87 100644 --- a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt @@ -1,8 +1,12 @@ package com.matter.virtual.device.app.core.data.di import com.matter.virtual.device.app.core.data.repository.* +import com.matter.virtual.device.app.core.data.repository.cluster.DoorLockManagerRepository +import com.matter.virtual.device.app.core.data.repository.cluster.DoorLockManagerRepositoryImpl import com.matter.virtual.device.app.core.data.repository.cluster.OnOffManagerRepository import com.matter.virtual.device.app.core.data.repository.cluster.OnOffManagerRepositoryImpl +import com.matter.virtual.device.app.core.data.repository.cluster.PowerSourceManagerRepository +import com.matter.virtual.device.app.core.data.repository.cluster.PowerSourceManagerRepositoryImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn @@ -11,12 +15,21 @@ import dagger.hilt.components.SingletonComponent @InstallIn(SingletonComponent::class) @Module internal abstract class DataModule { + @Binds + abstract fun bindDoorLockManagerRepository( + repository: DoorLockManagerRepositoryImpl + ): DoorLockManagerRepository @Binds abstract fun bindOnOffManagerRepository( repository: OnOffManagerRepositoryImpl ): OnOffManagerRepository + @Binds + abstract fun bindPowerSourceManagerRepository( + repository: PowerSourceManagerRepositoryImpl + ): PowerSourceManagerRepository + @Binds abstract fun bindMatterRepository(repository: MatterRepositoryImpl): MatterRepository @Binds abstract fun bindNetworkRepository(repository: NetworkRepositoryImpl): NetworkRepository diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt new file mode 100644 index 00000000000000..cdc7e380a94699 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt @@ -0,0 +1,11 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import kotlinx.coroutines.flow.StateFlow + +interface DoorLockManagerRepository { + fun getLockStateFlow(): StateFlow + + suspend fun setLockState(value: Boolean) + + suspend fun sendLockAlarmEvent() +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt new file mode 100644 index 00000000000000..4dfa15a01717e3 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt @@ -0,0 +1,24 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import com.matter.virtual.device.app.core.matter.manager.DoorLockManagerStub +import javax.inject.Inject +import kotlinx.coroutines.flow.StateFlow +import timber.log.Timber + +internal class DoorLockManagerRepositoryImpl +@Inject +constructor(private val doorLockManagerStub: DoorLockManagerStub) : DoorLockManagerRepository { + + override fun getLockStateFlow(): StateFlow { + return doorLockManagerStub.lockState + } + + override suspend fun setLockState(value: Boolean) { + Timber.d("setLockState():$value") + doorLockManagerStub.setLockState(value) + } + + override suspend fun sendLockAlarmEvent() { + doorLockManagerStub.sendLockAlarmEvent() + } +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt new file mode 100644 index 00000000000000..3948f797e622a5 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt @@ -0,0 +1,9 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import kotlinx.coroutines.flow.StateFlow + +interface PowerSourceManagerRepository { + fun getBatPercent(): StateFlow + + suspend fun setBatPercentRemaining(batteryPercentRemaining: Int) +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt new file mode 100644 index 00000000000000..d180e182b89853 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt @@ -0,0 +1,19 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import com.matter.virtual.device.app.core.matter.manager.PowerSourceManagerStub +import javax.inject.Inject +import kotlinx.coroutines.flow.StateFlow + +internal class PowerSourceManagerRepositoryImpl +@Inject +constructor(private val powerSourceManagerStub: PowerSourceManagerStub) : + PowerSourceManagerRepository { + + override fun getBatPercent(): StateFlow { + return powerSourceManagerStub.batPercent + } + + override suspend fun setBatPercentRemaining(batteryPercentRemaining: Int) { + powerSourceManagerStub.setBatPercentRemaining(batteryPercentRemaining) + } +} From 458ffe212ab42c4df6ddbe9b7c2b0321ee5595de Mon Sep 17 00:00:00 2001 From: EricZijian_SiterWell Date: Mon, 11 Sep 2023 19:46:50 +0800 Subject: [PATCH 93/96] Fix Smoke CO Alarm Cluster SDK (#28961) * Remove redundant pics values * Avoid unsupported attributes affecting other --------- Co-authored-by: Hare --- .../smoke-co-alarm-server.cpp | 60 +++++++++++-------- src/app/tests/suites/certification/PICS.yaml | 11 +--- .../tests/suites/certification/ci-pics-values | 41 +------------ 3 files changed, 37 insertions(+), 75 deletions(-) diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp index 67c927c202730d..2d5ae5fe2a2480 100644 --- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp +++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp @@ -46,43 +46,44 @@ SmokeCoAlarmServer & SmokeCoAlarmServer::Instance() void SmokeCoAlarmServer::SetExpressedStateByPriority(EndpointId endpointId, const std::array & priorityOrder) { - AlarmStateEnum alarmState = AlarmStateEnum::kNormal; - EndOfServiceEnum endOfServiceState = EndOfServiceEnum::kNormal; - bool active = false; - for (ExpressedStateEnum priority : priorityOrder) { + AlarmStateEnum alarmState = AlarmStateEnum::kNormal; + EndOfServiceEnum endOfServiceState = EndOfServiceEnum::kNormal; + bool active = false; + bool success = false; + switch (priority) { case ExpressedStateEnum::kSmokeAlarm: - VerifyOrReturn(GetSmokeState(endpointId, alarmState)); + success = GetSmokeState(endpointId, alarmState); break; case ExpressedStateEnum::kCOAlarm: - VerifyOrReturn(GetCOState(endpointId, alarmState)); + success = GetCOState(endpointId, alarmState); break; case ExpressedStateEnum::kBatteryAlert: - VerifyOrReturn(GetBatteryAlert(endpointId, alarmState)); + success = GetBatteryAlert(endpointId, alarmState); break; case ExpressedStateEnum::kTesting: - VerifyOrReturn(GetTestInProgress(endpointId, active)); + success = GetTestInProgress(endpointId, active); break; case ExpressedStateEnum::kHardwareFault: - VerifyOrReturn(GetHardwareFaultAlert(endpointId, active)); + success = GetHardwareFaultAlert(endpointId, active); break; case ExpressedStateEnum::kEndOfService: - VerifyOrReturn(GetEndOfServiceAlert(endpointId, endOfServiceState)); + success = GetEndOfServiceAlert(endpointId, endOfServiceState); break; case ExpressedStateEnum::kInterconnectSmoke: - VerifyOrReturn(GetInterconnectSmokeAlarm(endpointId, alarmState)); + success = GetInterconnectSmokeAlarm(endpointId, alarmState); break; case ExpressedStateEnum::kInterconnectCO: - VerifyOrReturn(GetInterconnectCOAlarm(endpointId, alarmState)); + success = GetInterconnectCOAlarm(endpointId, alarmState); break; default: break; } - if ((alarmState != AlarmStateEnum::kNormal) || (endOfServiceState != EndOfServiceEnum::kNormal) || active) + if (success && ((alarmState != AlarmStateEnum::kNormal) || (endOfServiceState != EndOfServiceEnum::kNormal) || active)) { SetExpressedState(endpointId, priority); return; @@ -186,20 +187,22 @@ bool SmokeCoAlarmServer::SetDeviceMuted(EndpointId endpointId, MuteStateEnum new { AlarmStateEnum alarmState; - VerifyOrReturnValue(GetAttribute(endpointId, SmokeState::Id, SmokeState::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + // If the attribute has been read and the attribute is Critical, return false - VerifyOrReturnValue(GetAttribute(endpointId, COState::Id, COState::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + bool success = GetSmokeState(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, BatteryAlert::Id, BatteryAlert::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetCOState(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, InterconnectSmokeAlarm::Id, InterconnectSmokeAlarm::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetBatteryAlert(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, InterconnectCOAlarm::Id, InterconnectCOAlarm::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetInterconnectSmokeAlarm(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); + + success = GetInterconnectCOAlarm(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); } VerifyOrReturnValue(SetAttribute(endpointId, DeviceMuted::Id, DeviceMuted::Set, newDeviceMuted), false); @@ -466,10 +469,15 @@ template bool SmokeCoAlarmServer::GetAttribute(EndpointId endpointId, AttributeId attributeId, EmberAfStatus (*getFn)(EndpointId endpointId, T * value), T & value) const { - EmberAfStatus status = getFn(endpointId, &value); - bool success = (EMBER_ZCL_STATUS_SUCCESS == status); + EmberAfStatus status = getFn(endpointId, &value); + bool success = (EMBER_ZCL_STATUS_SUCCESS == status); + bool unsupportedStatus = (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status); - if (!success) + if (unsupportedStatus) + { + ChipLogProgress(Zcl, "Read unsupported SmokeCOAlarm attribute: attribute=" ChipLogFormatMEI, ChipLogValueMEI(attributeId)); + } + else if (!success) { ChipLogError(Zcl, "Failed to read SmokeCOAlarm attribute: attribute=" ChipLogFormatMEI ", status=0x%x", ChipLogValueMEI(attributeId), to_underlying(status)); diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index b3d8e330b10113..d26d399904833e 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -8901,15 +8901,6 @@ PICS: - label: "Does the device implement the InterconnectCOAlarm attribute?" id: SMOKECO.S.A0009 - - label: "Does the device implement the ContaminationState attribute?" - id: SMOKECO.S.A0010 - - - label: "Does the device implement the SensitivityLevel attribute?" - id: SMOKECO.S.A0011 - - - label: "Does the device implement the ExpiryDate attribute?" - id: SMOKECO.S.A0012 - - label: "Does the device implement the ContaminationState attribute?" id: SMOKECO.S.A000a @@ -8953,7 +8944,7 @@ PICS: id: SMOKECO.S.E09 - label: "Does the device implement the AllClear event?" - id: SMOKECO.S.E10 + id: SMOKECO.S.E0a # # server / manually diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 66b40dbe81572d..d709e8f55d907b 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -700,40 +700,6 @@ S.C.AM-WRITE=0 S.C.AO-READ=0 S.C.AO-WRITE=0 -# Smoke CO Alarm Cluster -SMOKECO.S=1 -SMOKECO.S.F00=1 -SMOKECO.S.F01=1 -SMOKECO.S.A0000=1 -SMOKECO.S.A0001=1 -SMOKECO.S.A0002=1 -SMOKECO.S.A0003=1 -SMOKECO.S.A0004=1 -SMOKECO.S.A0005=1 -SMOKECO.S.A0006=1 -SMOKECO.S.A0007=1 -SMOKECO.S.A0008=1 -SMOKECO.S.A0009=1 -SMOKECO.S.A000a=1 -SMOKECO.S.A000b=1 -SMOKECO.S.A000c=1 -SMOKECO.S.E00=1 -SMOKECO.S.E01=1 -SMOKECO.S.E02=1 -SMOKECO.S.E03=1 -SMOKECO.S.E04=1 -SMOKECO.S.E05=1 -SMOKECO.S.E06=1 -SMOKECO.S.E07=1 -SMOKECO.S.E08=1 -SMOKECO.S.E09=1 -SMOKECO.S.E0a=1 -SMOKECO.M.ManuallyControlledTest=1 -SMOKECO.M.ManuallyControlledMute=1 -SMOKECO.S.C00.Rsp=1 - -SMOKECO.C=1 - # Switch Cluster SWTCH.S=1 SWTCH.S.F00=1 @@ -2607,6 +2573,7 @@ ICDM.S.C01.Tx=1 # Smoke CO Alarm Cluster SMOKECO.S=1 +SMOKECO.C=1 SMOKECO.S.F00=1 SMOKECO.S.F01=1 SMOKECO.S.A0000=1 @@ -2619,9 +2586,6 @@ SMOKECO.S.A0006=1 SMOKECO.S.A0007=1 SMOKECO.S.A0008=1 SMOKECO.S.A0009=1 -SMOKECO.S.A0010=1 -SMOKECO.S.A0011=1 -SMOKECO.S.A0012=1 SMOKECO.S.A000a=1 SMOKECO.S.A000b=1 SMOKECO.S.A000c=1 @@ -2635,11 +2599,10 @@ SMOKECO.S.E06=1 SMOKECO.S.E07=1 SMOKECO.S.E08=1 SMOKECO.S.E09=1 -SMOKECO.S.E10=1 +SMOKECO.S.E0a=1 SMOKECO.M.ManuallyControlledTest=1 SMOKECO.M.ManuallyControlledMute=1 SMOKECO.S.C00.Rsp=1 -SMOKECO.C=1 #Temperature Controlled Cabinet Mode Cluster TCCM.S=1 From 771d55c1cd60b17beb74d3daf66835bd21b640d0 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 11 Sep 2023 13:40:31 +0100 Subject: [PATCH 94/96] Add rvc example app (#29103) * Added an RVC app example containg the RvcRunMode and RvcClean clusters. * Regenerated zap code. * Added the RvcRunMode and RvcClean clusters' logic to the RVC app example. * Added the RvcOpState cluster's logic to the RVC app example. * Added documentation about the RVC example app. * Added an implementation for the GetCoutdownTime virtual function. * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Added constants for the Cluster's endpoints. Adde vendor mode tags for the mapping mode. * Restyled by clang-format * Fixed the feature value for the RvcRun and RvcClean clusters. * Restyled by clang-format * zap regen after pull. * Removed unused clusters form the zap and matter files. * RVC App: Removed unneccissary error checking. * RVC App: Changed how the RVC cluster endpoint IDs are set. * RVC App: refactored method parameter names. * Update examples/rvc-app/linux/include/CHIPProjectAppConfig.h Co-authored-by: Boris Zbarsky --------- Co-authored-by: Restyled.io Co-authored-by: Matt Hazley Co-authored-by: Boris Zbarsky --- .../rvc-app/RVC_app_state_diagram_drawio.xml | 2 + examples/rvc-app/linux/.gn | 25 + examples/rvc-app/linux/BUILD.gn | 53 + examples/rvc-app/linux/args.gni | 25 + examples/rvc-app/linux/build_overrides | 1 + .../linux/include/CHIPProjectAppConfig.h | 34 + examples/rvc-app/linux/main.cpp | 48 + .../rvc-app/linux/third_party/connectedhomeip | 1 + examples/rvc-app/rvc-common/BUILD.gn | 27 + .../rvc-app/rvc-common/include/rvc-device.h | 75 + .../rvc-common/include/rvc-mode-delegates.h | 159 + .../include/rvc-operational-state-delegate.h | 137 + examples/rvc-app/rvc-common/rvc-app.matter | 1202 ++ examples/rvc-app/rvc-common/rvc-app.zap | 10896 ++++++++++++++++ .../rvc-app/rvc-common/src/rvc-device.cpp | 83 + .../rvc-common/src/rvc-mode-delegates.cpp | 123 + .../src/rvc-operational-state-delegate.cpp | 55 + 17 files changed, 12946 insertions(+) create mode 100644 examples/rvc-app/RVC_app_state_diagram_drawio.xml create mode 100644 examples/rvc-app/linux/.gn create mode 100644 examples/rvc-app/linux/BUILD.gn create mode 100644 examples/rvc-app/linux/args.gni create mode 120000 examples/rvc-app/linux/build_overrides create mode 100644 examples/rvc-app/linux/include/CHIPProjectAppConfig.h create mode 100644 examples/rvc-app/linux/main.cpp create mode 120000 examples/rvc-app/linux/third_party/connectedhomeip create mode 100644 examples/rvc-app/rvc-common/BUILD.gn create mode 100644 examples/rvc-app/rvc-common/include/rvc-device.h create mode 100644 examples/rvc-app/rvc-common/include/rvc-mode-delegates.h create mode 100644 examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h create mode 100644 examples/rvc-app/rvc-common/rvc-app.matter create mode 100644 examples/rvc-app/rvc-common/rvc-app.zap create mode 100644 examples/rvc-app/rvc-common/src/rvc-device.cpp create mode 100644 examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp create mode 100644 examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp diff --git a/examples/rvc-app/RVC_app_state_diagram_drawio.xml b/examples/rvc-app/RVC_app_state_diagram_drawio.xml new file mode 100644 index 00000000000000..590f1db1d542bd --- /dev/null +++ b/examples/rvc-app/RVC_app_state_diagram_drawio.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/examples/rvc-app/linux/.gn b/examples/rvc-app/linux/.gn new file mode 100644 index 00000000000000..5d1ce757507582 --- /dev/null +++ b/examples/rvc-app/linux/.gn @@ -0,0 +1,25 @@ +# 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") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + import("//args.gni") +} diff --git a/examples/rvc-app/linux/BUILD.gn b/examples/rvc-app/linux/BUILD.gn new file mode 100644 index 00000000000000..7c865a380c9a9c --- /dev/null +++ b/examples/rvc-app/linux/BUILD.gn @@ -0,0 +1,53 @@ +# 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_overrides/chip.gni") + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("chip-rvc-app") { + sources = [ + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-device.cpp", + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp", + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp", + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/examples/rvc-app/rvc-common", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "include", + "${chip_root}/examples/rvc-app/rvc-common/include", + ] + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":chip-rvc-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/rvc-app/linux/args.gni b/examples/rvc-app/linux/args.gni new file mode 100644 index 00000000000000..a94a8482760fbc --- /dev/null +++ b/examples/rvc-app/linux/args.gni @@ -0,0 +1,25 @@ +# 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/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/rvc-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/rvc-app/linux/build_overrides b/examples/rvc-app/linux/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/rvc-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/rvc-app/linux/include/CHIPProjectAppConfig.h b/examples/rvc-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..d6d0e5146b144b --- /dev/null +++ b/examples/rvc-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2023 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. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 116 // 0x0074 = 116 = Matter Robotic Vacuum Cleaner +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test RVC" diff --git a/examples/rvc-app/linux/main.cpp b/examples/rvc-app/linux/main.cpp new file mode 100644 index 00000000000000..462bc6febfec29 --- /dev/null +++ b/examples/rvc-app/linux/main.cpp @@ -0,0 +1,48 @@ +/* + * + * Copyright (c) 2023 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 "rvc-device.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +RvcDevice * rvcDevice = nullptr; + +void ApplicationInit() +{ + rvcDevice = new RvcDevice(1); + rvcDevice->Init(); +} + +void ApplicationShutdown() +{ + delete rvcDevice; + rvcDevice = nullptr; +} + +int main(int argc, char * argv[]) +{ + if (ChipLinuxAppInit(argc, argv) != 0) + { + return -1; + } + + ChipLinuxAppMainLoop(); + return 0; +} diff --git a/examples/rvc-app/linux/third_party/connectedhomeip b/examples/rvc-app/linux/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/rvc-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/BUILD.gn b/examples/rvc-app/rvc-common/BUILD.gn new file mode 100644 index 00000000000000..d567043f3ee346 --- /dev/null +++ b/examples/rvc-app/rvc-common/BUILD.gn @@ -0,0 +1,27 @@ +# 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/chip.gni") +import("${chip_root}/src/app/chip_data_model.gni") + +config("config") { + include_dirs = [ "include" ] +} + +chip_data_model("rvc-common") { + zap_file = "rvc-app.zap" + + zap_pregenerated_dir = "${chip_root}/zzz_generated/rvc-app/zap-generated" + is_server = true +} diff --git a/examples/rvc-app/rvc-common/include/rvc-device.h b/examples/rvc-app/rvc-common/include/rvc-device.h new file mode 100644 index 00000000000000..9ded6e76b8fbee --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-device.h @@ -0,0 +1,75 @@ +#pragma once + +#include "rvc-mode-delegates.h" +#include "rvc-operational-state-delegate.h" +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice +{ +private: + RvcRunMode::RvcRunModeDelegate mRunModeDelegate; + ModeBase::Instance mRunModeInstance; + + RvcCleanMode::RvcCleanModeDelegate mCleanModeDelegate; + ModeBase::Instance mCleanModeInstance; + + RvcOperationalState::RvcOperationalStateDelegate mOperationalStateDelegate; + OperationalState::Instance mOperationalStateInstance; + +public: + /** + * This class is responsible for initialising all the RVC clusters and manging the interactions between them as required by + * the specific "business logic". See the state machine diagram. + * @param aRvcClustersEndpoint The endpoint ID where all the RVC clusters exist. + */ + explicit RvcDevice(EndpointId aRvcClustersEndpoint) : + mRunModeDelegate(), mRunModeInstance(&mRunModeDelegate, aRvcClustersEndpoint, RvcRunMode::Id, 0), mCleanModeDelegate(), + mCleanModeInstance(&mCleanModeDelegate, aRvcClustersEndpoint, RvcCleanMode::Id, 0), mOperationalStateDelegate(), + mOperationalStateInstance(&mOperationalStateDelegate, aRvcClustersEndpoint, RvcOperationalState::Id) + { + // set the current-mode at start-up + mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle); + // Assume that the device is not docked. + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + // set callback functions + mRunModeDelegate.SetHandleChangeToMode(&RvcDevice::HandleRvcRunChangeToMode, this); + mCleanModeDelegate.SetHandleChangeToMode(&RvcDevice::HandleRvcCleanChangeToMode, this); + mOperationalStateDelegate.SetPauseCallback(&RvcDevice::HandleOpStatePauseCallback, this); + mOperationalStateDelegate.SetResumeCallback(&RvcDevice::HandleOpStateResumeCallback, this); + } + + /** + * Init all the clusters used by this device. + */ + void Init(); + + /** + * Handles the RvcRunMode command requesting a mode change. + */ + void HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + + /** + * Handles the RvcCleanMode command requesting a mode change. + */ + void HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + + /** + * Handles the RvcOperationalState pause command. + */ + void HandleOpStatePauseCallback(Clusters::OperationalState::GenericOperationalError & err); + + /** + * Handles the RvcOperationalState resume command. + */ + void HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err); +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h new file mode 100644 index 00000000000000..f1c3d7b22586a7 --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (c) 2023 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 +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice; + +typedef void (RvcDevice::*HandleChangeToModeA)(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + +namespace RvcRunMode { + +const uint8_t ModeIdle = 0; +const uint8_t ModeCleaning = 1; +const uint8_t ModeMapping = 2; + +/// This is an application level delegate to handle RvcRun commands according to the specific business logic. +class RvcRunModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType ModeTagsIdle[1] = { { .value = to_underlying(ModeTag::kIdle) } }; + ModeTagStructType ModeTagsCleaning[1] = { { .value = to_underlying(ModeTag::kCleaning) } }; + ModeTagStructType ModeTagsMapping[1] = { { .mfgCode = MakeOptional(TestVendor1), .value = 0x8001 } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Idle"), + .mode = ModeIdle, + .modeTags = DataModel::List(ModeTagsIdle) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Cleaning"), + .mode = ModeCleaning, + .modeTags = DataModel::List(ModeTagsCleaning) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Mapping"), + .mode = ModeMapping, + .modeTags = DataModel::List(ModeTagsMapping) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + + RvcDevice * mRvcDeviceInstance; + HandleChangeToModeA mCallback; + +public: + void SetHandleChangeToMode(HandleChangeToModeA aCallback, RvcDevice * aInstance) + { + mCallback = aCallback; + mRvcDeviceInstance = aInstance; + }; + + ~RvcRunModeDelegate() override = default; +}; + +void Shutdown(); + +} // namespace RvcRunMode + +namespace RvcCleanMode { + +const uint8_t ModeQuick = 0; +const uint8_t ModeAuto = 1; +const uint8_t ModeDeepClean = 2; +const uint8_t ModeQuiet = 3; +const uint8_t ModeMaxVac = 4; + +/// This is an application level delegate to handle RvcClean commands according to the specific business logic. +class RvcCleanModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsQuick[2] = { { .value = to_underlying(ModeTag::kVacuum) }, + { .value = to_underlying(ModeBase::ModeTag::kQuick) } }; + + ModeTagStructType modeTagsAuto[2] = { { .value = to_underlying(ModeBase::ModeTag::kAuto) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsDeepClean[3] = { { .value = to_underlying(ModeTag::kMop) }, + { .value = to_underlying(ModeTag::kDeepClean) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsQuiet[2] = { { .value = to_underlying(ModeBase::ModeTag::kQuiet) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsMaxVac[2] = { { .value = to_underlying(ModeTag::kVacuum) }, + { .value = to_underlying(ModeTag::kDeepClean) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[5] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Quick"), + .mode = ModeQuick, + .modeTags = DataModel::List(modeTagsQuick) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Auto"), + .mode = ModeAuto, + .modeTags = DataModel::List(modeTagsAuto) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Deep Clean"), + .mode = ModeDeepClean, + .modeTags = DataModel::List(modeTagsDeepClean) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Quiet"), + .mode = ModeQuiet, + .modeTags = DataModel::List(modeTagsQuiet) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Max Vac"), + .mode = ModeMaxVac, + .modeTags = DataModel::List(modeTagsMaxVac) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + + RvcDevice * mRvcDeviceInstance; + HandleChangeToModeA mCallback; + +public: + void SetHandleChangeToMode(HandleChangeToModeA aCallback, RvcDevice * aInstance) + { + mCallback = aCallback; + mRvcDeviceInstance = aInstance; + }; + + ~RvcCleanModeDelegate() override = default; +}; + +void Shutdown(); + +} // namespace RvcCleanMode + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h new file mode 100644 index 00000000000000..b2737a0c34b27f --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h @@ -0,0 +1,137 @@ +/* + * + * Copyright (c) 2023 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 +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice; + +typedef void (RvcDevice::*HandleOpStateCommand)(Clusters::OperationalState::GenericOperationalError & err); + +namespace RvcOperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class RvcOperationalStateDelegate : public OperationalState::Delegate +{ +private: + const Clusters::OperationalState::GenericOperationalState mOperationalStateList[7] = { + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), + OperationalState::GenericOperationalState( + to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), + }; + + const Clusters::OperationalState::GenericOperationalPhase mOperationalPhaseList[1] = { + // Phase List is null + OperationalState::GenericOperationalPhase(DataModel::Nullable()), + }; + + RvcDevice * mPauseRvcDeviceInstance; + HandleOpStateCommand mPauseCallback; + RvcDevice * mResumeRvcDeviceInstance; + HandleOpStateCommand mResumeCallback; + +public: + /** + * Get the countdown time. This attribute is not supported in our example RVC app. + * @return Null. + */ + DataModel::Nullable GetCountdownTime() override { return {}; }; + + /** + * Fills in the provided GenericOperationalState with the state at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * Note: This is used by the SDK to populate the operational state list attribute. If the contents of this list changes, + * the device SHALL call the Instance's ReportOperationalStateListChange method to report that this attribute has changed. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ + CHIP_ERROR GetOperationalStateAtIndex(size_t index, + Clusters::OperationalState::GenericOperationalState & operationalState) override; + + /** + * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the + * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed. + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The GenericOperationalPhase is filled. + */ + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, + Clusters::OperationalState::GenericOperationalPhase & operationalPhase) override; + + // command callback + /** + * Handle Command Callback in application: Pause + * @param[out] get operational error after callback. + */ + void HandlePauseStateCallback(Clusters::OperationalState::GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Resume + * @param[out] get operational error after callback. + */ + void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Start + * @param[out] get operational error after callback. + */ + void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{ + // This command in not supported. + }; + + /** + * Handle Command Callback in application: Stop + * @param[out] get operational error after callback. + */ + void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{ + // This command in not supported. + }; + + void SetPauseCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance) + { + mPauseCallback = aCallback; + mPauseRvcDeviceInstance = aInstance; + }; + + void SetResumeCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance) + { + mResumeCallback = aCallback; + mResumeRvcDeviceInstance = aInstance; + }; +}; + +void Shutdown(); + +} // namespace RvcOperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter new file mode 100644 index 00000000000000..fae920d56cafae --- /dev/null +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -0,0 +1,1202 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : ENUM8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : ENUM8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : ENUM8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +server cluster RvcRunMode = 84 { + enum ModeTag : ENUM16 { + kIdle = 16384; + kCleaning = 16385; + } + + enum StatusCode : ENUM8 { + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + kBatteryLow = 72; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + INT8U newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + ENUM8 status = 0; + optional CHAR_STRING statusText = 1; + } + + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +server cluster RvcCleanMode = 85 { + enum ModeTag : ENUM16 { + kDeepClean = 16384; + kVacuum = 16385; + kMop = 16386; + } + + enum StatusCode : ENUM8 { + kCleaningInProgress = 64; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + INT8U newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + ENUM8 status = 0; + optional CHAR_STRING statusText = 1; + } + + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ +server cluster RvcOperationalState = 97 { + enum ErrorStateEnum : ENUM8 { + kFailedToFindChargingDock = 64; + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + } + + enum OperationalStateEnum : ENUM8 { + kSeekingCharger = 64; + kCharging = 65; + kDocked = 66; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ENUM8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable CHAR_STRING phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute enum8 operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + command Pause(): OperationalCommandResponse = 0; + command Resume(): OperationalCommandResponse = 3; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_robotic_vacuum_cleaner = 116, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster Descriptor { + callback attribute deviceTypeList default = 0; + callback attribute serverList default = 0; + callback attribute clientList default = 0; + callback attribute partsList default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcRunMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcCleanMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcOperationalState { + emits event OperationalError; + emits event OperationCompletion; + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap new file mode 100644 index 00000000000000..34580f98854834 --- /dev/null +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -0,0 +1,10896 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 12, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 177 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 11, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 225, + "code": 116, + "profileId": 259, + "label": "MA-robotic-vacuum-cleaner", + "name": "MA-robotic-vacuum-cleaner" + }, + "deviceTypes": [ + { + "id": 225, + "code": 116, + "profileId": 259, + "label": "MA-robotic-vacuum-cleaner", + "name": "MA-robotic-vacuum-cleaner" + } + ], + "deviceTypeRefs": [ + 225 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 116 + ], + "deviceTypeName": "MA-robotic-vacuum-cleaner", + "deviceTypeCode": 116, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConfiguredBy", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "node_id", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Run Mode", + "code": 84, + "mfgCode": null, + "define": "RVC_RUN_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Run Mode", + "code": 84, + "mfgCode": null, + "define": "RVC_RUN_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Clean Mode", + "code": 85, + "mfgCode": null, + "define": "RVC_CLEAN_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Clean Mode", + "code": 85, + "mfgCode": null, + "define": "RVC_CLEAN_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "LockDoor", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UnlockDoor", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetUser", + "code": 26, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetUser", + "code": 27, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearUser", + "code": 29, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetCredential", + "code": 34, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearCredential", + "code": 38, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "7", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "GetUserResponse", + "code": 28, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetCredentialResponse", + "code": 35, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "LockState", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "DlLockState", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LockType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "DlLockType", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActuatorEnabled", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorState", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "DoorStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorOpenEvents", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorClosedEvents", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OpenPeriod", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfTotalUsersSupported", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPINUsersSupported", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfRFIDUsersSupported", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfWeekDaySchedulesSupportedPerUser", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfYearDaySchedulesSupportedPerUser", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfHolidaySchedulesSupported", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPINCodeLength", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinPINCodeLength", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxRFIDCodeLength", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinRFIDCodeLength", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CredentialRulesSupport", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "DlCredentialRuleMask", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfCredentialsSupportedPerUser", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Language", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LEDSettings", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AutoRelockTime", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoundVolume", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperatingMode", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "OperatingModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedOperatingModes", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "DlSupportedOperatingModes", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFF6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultConfigurationRegister", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "DlDefaultConfigurationRegister", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableLocalProgramming", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableOneTouchLocking", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableInsideStatusLED", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnablePrivacyModeButton", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocalProgrammingFeatures", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "DlLocalProgrammingFeatures", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WrongCodeEntryLimit", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserCodeTemporaryDisableTime", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SendPINOverTheAir", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RequirePINforRemoteOperation", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ExpiringUserTimeout", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "7", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "BarrierControlGoToPercent", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "BarrierControlStop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "barrier moving state", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier safety status", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier capabilities", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier open events", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier close events", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier command open events", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier command close events", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier open period", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier close period", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier position", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentHue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentSaturation", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentX", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentY", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DriftCompensation", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CompensationText", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTemperatureMireds", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPrimaries", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1X", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Y", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2X", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Y", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3X", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Y", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4X", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Y", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5X", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Y", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6X", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Y", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointX", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointY", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRX", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRY", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRIntensity", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGX", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGY", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGIntensity", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBX", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBY", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBIntensity", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedCurrentHue", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedColorMode", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopActive", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopDirection", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopTime", + "code": 16388, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopStartEnhancedHue", + "code": 16389, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopStoredEnhancedHue", + "code": 16390, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorCapabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMinMireds", + "code": 16395, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMaxMireds", + "code": 16396, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CoupleColorTempToLevelMinMireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpColorTemperatureMireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIROccupiedToUnoccupiedDelay", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedDelay", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedThreshold", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicOccupiedToUnoccupiedDelay", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedDelay", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedThreshold", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactOccupiedToUnoccupiedDelay", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedDelay", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedThreshold", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp new file mode 100644 index 00000000000000..f085e6dada9f1c --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -0,0 +1,83 @@ +#include "rvc-device.h" + +using namespace chip::app::Clusters; + +void RvcDevice::Init() +{ + mRunModeInstance.Init(); + mCleanModeInstance.Init(); + mOperationalStateInstance.Init(); +} + +void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + uint8_t currentMode = mRunModeInstance.GetCurrentMode(); + + switch (newMode) + { + case RvcRunMode::ModeMapping: { + // change to mapping only allowed from the Idle state. + if (currentMode != RvcRunMode::ModeIdle) + { + response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.statusText.SetValue(chip::CharSpan::fromCharString("Change to the mapping mode is only allowed from idle")); + return; + } + + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + break; + } + case RvcRunMode::ModeCleaning: { + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + } + break; + case RvcRunMode::ModeIdle: { + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + } + } + + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +void RvcDevice::HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + uint8_t rvcRunCurrentMode = mRunModeInstance.GetCurrentMode(); + + if (rvcRunCurrentMode != RvcRunMode::ModeIdle) + { + response.status = to_underlying(RvcCleanMode::StatusCode::kCleaningInProgress); + response.statusText.SetValue(chip::CharSpan::fromCharString("Change of the cleaning mode is only allowed in Idle.")); + return; + } + + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +void RvcDevice::HandleOpStatePauseCallback(Clusters::OperationalState::GenericOperationalError & err) +{ + auto error = mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +void RvcDevice::HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err) +{ + auto error = mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); + } +} diff --git a/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp b/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp new file mode 100644 index 00000000000000..8757b5e1666f58 --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp @@ -0,0 +1,123 @@ +/* + * + * Copyright (c) 2023 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 + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RvcRunMode; +using namespace chip::app::Clusters::RvcCleanMode; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; + +// RVC Run +CHIP_ERROR RvcRunModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RvcRunModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + (mRvcDeviceInstance->*mCallback)(NewMode, response); +} + +CHIP_ERROR RvcRunModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RvcRunModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcRunModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +// RVC Clean + +CHIP_ERROR RvcCleanModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + (mRvcDeviceInstance->*mCallback)(NewMode, response); +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} diff --git a/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp b/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp new file mode 100644 index 00000000000000..c94de8f231bbe4 --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2023 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 + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RvcOperationalState; + +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalStateAtIndex(size_t index, + OperationalState::GenericOperationalState & operationalState) +{ + if (index >= ArraySize(mOperationalStateList)) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalState = mOperationalStateList[index]; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, + OperationalState::GenericOperationalPhase & operationalPhase) +{ + if (index >= ArraySize(mOperationalPhaseList)) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalPhase = mOperationalPhaseList[index]; + return CHIP_NO_ERROR; +} + +void RvcOperationalStateDelegate::HandlePauseStateCallback(OperationalState::GenericOperationalError & err) +{ + (mPauseRvcDeviceInstance->*mPauseCallback)(err); +} + +void RvcOperationalStateDelegate::HandleResumeStateCallback(OperationalState::GenericOperationalError & err) +{ + (mResumeRvcDeviceInstance->*mResumeCallback)(err); +} From 8d15e0182f19c3d19229ea3380f4081537657e60 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Sep 2023 10:56:53 -0400 Subject: [PATCH 95/96] Update Mode Select ClusterRevision to 2. (#29140) Fixes https://github.com/project-chip/connectedhomeip/issues/26445 --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 7 +++---- .../all-clusters-minimal-app.matter | 2 +- .../all-clusters-minimal-app.zap | 4 ++-- .../devices/rootnode_dishwasher_cc105034fe.zap | 4 ++-- .../devices/rootnode_laundrywasher_fb10d238c8.zap | 4 ++-- ...et_temperaturecontrolledcabinet_ffdb696680.zap | 4 ++-- .../test_files/sample_zap_file.zap | 15 ++------------- .../dishwasher-common/dishwasher-app.zap | 4 ++-- .../placeholder/linux/apps/app1/config.matter | 2 +- examples/placeholder/linux/apps/app1/config.zap | 4 ++-- .../placeholder/linux/apps/app2/config.matter | 2 +- examples/placeholder/linux/apps/app2/config.zap | 4 ++-- .../refrigerator-common/refrigerator-app.zap | 4 ++-- .../tools/zap/tests/inputs/all-clusters-app.zap | 4 ++-- .../app-templates/endpoint_config.h | 2 +- .../zcl/data-model/chip/mode-select-cluster.xml | 3 +++ src/controller/data_model/controller-clusters.zap | 4 ++-- 18 files changed, 33 insertions(+), 42 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 0350bdc758adcd..f8619b6f400a60 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 @@ -6722,7 +6722,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 1; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; ram attribute manufacturerExtension default = 255; } 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 6d4e6c60c4fec4..785e3aaef11fe8 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 @@ -14787,7 +14787,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14973,7 +14973,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -35392,6 +35392,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index d7c370d760f689..d514d42061268a 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -4426,7 +4426,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster TemperatureControl { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index f2658e0fb018c8..083a0b4b543559 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -13821,7 +13821,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14007,7 +14007,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index df18b2b1ff5e45..e3343e5584a29a 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -8395,7 +8395,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8597,7 +8597,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 85c94b1a55186b..5a340b0e9a37a5 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -8411,7 +8411,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8613,7 +8613,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index 449ce9ef3cd474..1fffb622c1af4a 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -8475,7 +8475,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8677,7 +8677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index fe32b0c929b0a7..7de53320310a9b 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5372,7 +5367,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5380,16 +5374,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7782,6 +7772,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index c07689aff2ef84..3832adf0bb7d01 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -8395,7 +8395,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8597,7 +8597,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index be49149c26e9dd..fa283c471267b3 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6940,7 +6940,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster DoorLock { diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index a6d4b3a1c028c9..d3c3fec0f6ff7a 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -6657,7 +6657,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6827,7 +6827,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 40f35329b7a5d2..78a45b3636cede 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6906,7 +6906,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster DoorLock { diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index abdf3ac2e318f4..a9abe620d374c6 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -6741,7 +6741,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6911,7 +6911,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index 5752fd943abbd9..733e241cdf1e6f 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -8475,7 +8475,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8677,7 +8677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 9e73cd21902857..bd003251162fc8 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -14053,7 +14053,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14239,7 +14239,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index f8834f17d60bc0..88401280135ed7 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -884,7 +884,7 @@ { ZAP_SIMPLE_DEFAULT(255), 0x00000005, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* OnMode */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ { ZAP_SIMPLE_DEFAULT(2), 0x00000000, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LockState */ \ diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index 7bf4c972972635..76b056acf50ea6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -37,6 +37,9 @@ limitations under the License. MODE_SELECT_CLUSTER true true + + + Attributes and commands for selecting a mode from a list of supported options. Description diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 5a1c9afa03a6d6..77f9d90aa108f6 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -10532,7 +10532,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10734,7 +10734,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From 82a37e1fc03e46b2c9a37c29e0fe16186ad4bfca Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Sep 2023 10:58:15 -0400 Subject: [PATCH 96/96] Update Interaction Model revision to spec. (#29135) Spec got stealth-bumped (no corresponding SDK issue) to 11 last month sometime. --- src/app/InteractionModelRevision.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/InteractionModelRevision.h b/src/app/InteractionModelRevision.h index 7e92d7c2d58aba..9cc9fc66de0796 100644 --- a/src/app/InteractionModelRevision.h +++ b/src/app/InteractionModelRevision.h @@ -29,7 +29,7 @@ * Specification" chapter of the core Matter specification. */ #ifndef CHIP_DEVICE_INTERACTION_MODEL_REVISION -#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 10 +#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 11 #endif constexpr uint8_t kInteractionModelRevisionTag = 0xFF;