From 47b875fc31831b0d67d86e3480f9fde4614ead90 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 24 Jan 2023 17:03:02 +0530 Subject: [PATCH 01/10] Fix the boot loop crash on M5Stack (#24607) * Fix the boot loop crash on M5Stack This is the regression from #24547, which is accessing the attributes even before Server is ready. Moved the lock initialization after service is initialized * Fix the typo for chip error format --- examples/all-clusters-app/esp32/main/AppTask.cpp | 14 +++++++++----- .../all-clusters-app/esp32/main/include/AppTask.h | 1 + examples/all-clusters-app/esp32/main/main.cpp | 7 +++++++ examples/platform/esp32/lock/BoltLockManager.cpp | 3 --- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/AppTask.cpp b/examples/all-clusters-app/esp32/main/AppTask.cpp index 2111d7cb32df47..9a04b23c689d4c 100644 --- a/examples/all-clusters-app/esp32/main/AppTask.cpp +++ b/examples/all-clusters-app/esp32/main/AppTask.cpp @@ -161,6 +161,13 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) } } +CHIP_ERROR AppTask::LockInit() +{ + ReturnErrorOnFailure(BoltLockMgr().InitLockState()); + BoltLockMgr().SetCallbacks(ActionInitiated, ActionCompleted); + return CHIP_NO_ERROR; +} + CHIP_ERROR AppTask::Init() { /* Print chip information */ @@ -179,10 +186,7 @@ CHIP_ERROR AppTask::Init() (void *) this, // init timer id = app task obj context TimerEventHandler // timer callback handler ); - - CHIP_ERROR err = BoltLockMgr().InitLockState(); - - BoltLockMgr().SetCallbacks(ActionInitiated, ActionCompleted); + VerifyOrReturnError(sFunctionTimer != NULL, CHIP_ERROR_NO_MEMORY, ESP_LOGE(TAG, "Failed to create function selection timer")); statusLED1.Init(STATUS_LED_GPIO_NUM); // Our second LED doesn't map to any physical LEDs so far, just to virtual @@ -199,7 +203,7 @@ CHIP_ERROR AppTask::Init() InitDeviceDisplay(); #endif - return err; + return CHIP_NO_ERROR; } void AppTask::AppTaskMain(void * pvParameter) diff --git a/examples/all-clusters-app/esp32/main/include/AppTask.h b/examples/all-clusters-app/esp32/main/include/AppTask.h index 8a72b2d47e5777..779e7e990c12a7 100644 --- a/examples/all-clusters-app/esp32/main/include/AppTask.h +++ b/examples/all-clusters-app/esp32/main/include/AppTask.h @@ -39,6 +39,7 @@ class AppTask void PostEvent(const AppEvent * event); void ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction); static void ButtonPressedAction(AppEvent * aEvent); + CHIP_ERROR LockInit(); private: CHIP_ERROR Init(); diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp index 1447638bcce0b1..62563025279cbf 100644 --- a/examples/all-clusters-app/esp32/main/main.cpp +++ b/examples/all-clusters-app/esp32/main/main.cpp @@ -115,6 +115,13 @@ static void InitServer(intptr_t context) emberAfEndpointEnableDisable(kNetworkCommissioningEndpointSecondary, false); InitBindingHandlers(); + + CHIP_ERROR err = GetAppTask().LockInit(); + if (err != CHIP_NO_ERROR) + { + ESP_LOGE(TAG, "Failed to initialize app task lock, err:%" CHIP_ERROR_FORMAT, err.Format()); + } + #if CONFIG_DEVICE_TYPE_M5STACK SetupPretendDevices(); #endif diff --git a/examples/platform/esp32/lock/BoltLockManager.cpp b/examples/platform/esp32/lock/BoltLockManager.cpp index 48c355f24eaca4..6115c15b1bf75d 100644 --- a/examples/platform/esp32/lock/BoltLockManager.cpp +++ b/examples/platform/esp32/lock/BoltLockManager.cpp @@ -764,7 +764,6 @@ CHIP_ERROR BoltLockManager::InitLockState() // Initial lock state chip::app::DataModel::Nullable state; chip::EndpointId endpointId{ 1 }; - chip::DeviceLayer::PlatformMgr().LockChipStack(); chip::app::Clusters::DoorLock::Attributes::LockState::Get(endpointId, state); uint8_t numberOfCredentialsPerUser = 0; @@ -816,8 +815,6 @@ CHIP_ERROR BoltLockManager::InitLockState() numberOfHolidaySchedules = 10; } - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - CHIP_ERROR err = BoltLockMgr().Init(state, ParamBuilder() .SetNumberOfUsers(numberOfUsers) From b856d8b417009609bf30217a72440e4b257d9c03 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 24 Jan 2023 13:34:55 +0100 Subject: [PATCH 02/10] [HotFix] Rename PlaybackPosition structure to PlaybackPositionStruct after #24509 (#24611) --- .../App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp index c15521b9db383c..eb19010ea33853 100644 --- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp +++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp @@ -252,11 +252,11 @@ jobject SampledPositionSuccessHandlerJNI::ConvertToJObject( jobject jSampledPosition = nullptr; if (!responseData.IsNull()) { - const chip::app::Clusters::MediaPlayback::Structs::PlaybackPosition::DecodableType & playbackPosition = + const chip::app::Clusters::MediaPlayback::Structs::PlaybackPositionStruct::DecodableType & playbackPosition = responseData.Value(); jclass responseTypeClass = nullptr; - CHIP_ERROR err = JniReferences::GetInstance().GetClassRef(env, "com/chip/casting/MediaPlaybackTypes$PlaybackPosition", + CHIP_ERROR err = JniReferences::GetInstance().GetClassRef(env, "com/chip/casting/MediaPlaybackTypes$PlaybackPositionStruct", responseTypeClass); if (err != CHIP_NO_ERROR) { From 9de347fbadc98acbe3360b7cf8e3a0de1a6a3766 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 24 Jan 2023 14:21:59 +0100 Subject: [PATCH 03/10] Fix Android build failure no member named 'StatusName' in namespace 'chip::Protocols::InteractionModel' (#24610) --- examples/chip-tool/BUILD.gn | 2 + .../commands/clusters/ClusterCommand.h | 6 +- .../commands/clusters/DataModelLogger.h | 130 +-------------- .../commands/clusters/ReportCommand.h | 6 +- .../commands/clusters/WriteAttributeCommand.h | 4 +- .../commands/common/RemoteDataModelLogger.cpp | 155 ++++++++++++++++++ .../commands/common/RemoteDataModelLogger.h | 42 +++++ .../interactive/InteractiveCommands.cpp | 2 +- .../interactive/InteractiveCommands.h | 4 +- .../logging/DataModelLogger-src.zapt | 2 - .../tv-casting-app/tv-casting-common/BUILD.gn | 2 + .../cluster/logging/DataModelLogger.cpp | 2 - 12 files changed, 213 insertions(+), 144 deletions(-) create mode 100644 examples/chip-tool/commands/common/RemoteDataModelLogger.cpp create mode 100644 examples/chip-tool/commands/common/RemoteDataModelLogger.h diff --git a/examples/chip-tool/BUILD.gn b/examples/chip-tool/BUILD.gn index aea4fe99ff02e2..76ec22f40c8223 100644 --- a/examples/chip-tool/BUILD.gn +++ b/examples/chip-tool/BUILD.gn @@ -59,6 +59,8 @@ static_library("chip-tool-utils") { "commands/common/Commands.h", "commands/common/CredentialIssuerCommands.h", "commands/common/HexConversion.h", + "commands/common/RemoteDataModelLogger.cpp", + "commands/common/RemoteDataModelLogger.h", "commands/delay/SleepCommand.cpp", "commands/delay/WaitForCommissioneeCommand.cpp", "commands/discover/DiscoverCommand.cpp", diff --git a/examples/chip-tool/commands/clusters/ClusterCommand.h b/examples/chip-tool/commands/clusters/ClusterCommand.h index 4ea55a2786df6d..eb9a7167948bf5 100644 --- a/examples/chip-tool/commands/clusters/ClusterCommand.h +++ b/examples/chip-tool/commands/clusters/ClusterCommand.h @@ -74,7 +74,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(path, status)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -83,7 +83,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub if (data != nullptr) { - ReturnOnFailure(DataModelLogger::LogCommandAsJSON(path, data)); + ReturnOnFailure(RemoteDataModelLogger::LogCommandAsJSON(path, data)); error = DataModelLogger::LogCommand(path, data); if (CHIP_NO_ERROR != error) @@ -97,7 +97,7 @@ class ClusterCommand : public InteractionModelCommands, public ModelCommand, pub virtual void OnError(const chip::app::CommandSender * client, CHIP_ERROR error) override { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(error)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/commands/clusters/DataModelLogger.h b/examples/chip-tool/commands/clusters/DataModelLogger.h index 5c8e01cdecba00..5ffb775d0bf01a 100644 --- a/examples/chip-tool/commands/clusters/DataModelLogger.h +++ b/examples/chip-tool/commands/clusters/DataModelLogger.h @@ -26,23 +26,8 @@ #include #include #include +#include #include -#include - -constexpr const char * kClusterIdKey = "clusterId"; -constexpr const char * kEndpointIdKey = "endpointId"; -constexpr const char * kAttributeIdKey = "attributeId"; -constexpr const char * kEventIdKey = "eventId"; -constexpr const char * kCommandIdKey = "commandId"; -constexpr const char * kErrorIdKey = "error"; -constexpr const char * kClusterErrorIdKey = "clusterError"; - -class DataModelLoggerJSONDelegate -{ -public: - CHIP_ERROR virtual LogJSON(const char *) = 0; - virtual ~DataModelLoggerJSONDelegate(){}; -}; class DataModelLogger { @@ -51,119 +36,7 @@ class DataModelLogger static CHIP_ERROR LogCommand(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data); static CHIP_ERROR LogEvent(const chip::app::EventHeader & header, chip::TLV::TLVReader * data); - static CHIP_ERROR LogAttributeAsJSON(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = path.mClusterId; - value[kEndpointIdKey] = path.mEndpointId; - value[kAttributeIdKey] = path.mAttributeId; - - chip::TLV::TLVReader reader; - reader.Init(*data); - ReturnErrorOnFailure(chip::TlvToJson(reader, value)); - - auto valueStr = chip::JsonToString(value); - return mJSONDelegate->LogJSON(valueStr.c_str()); - } - - static CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteDataAttributePath & path, const chip::app::StatusIB & status) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = path.mClusterId; - value[kEndpointIdKey] = path.mEndpointId; - value[kAttributeIdKey] = path.mAttributeId; - - return LogError(value, status); - } - - static CHIP_ERROR LogCommandAsJSON(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = path.mClusterId; - value[kEndpointIdKey] = path.mEndpointId; - value[kCommandIdKey] = path.mCommandId; - - chip::TLV::TLVReader reader; - reader.Init(*data); - ReturnErrorOnFailure(chip::TlvToJson(reader, value)); - - auto valueStr = chip::JsonToString(value); - return mJSONDelegate->LogJSON(valueStr.c_str()); - } - - static CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteCommandPath & path, const chip::app::StatusIB & status) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = path.mClusterId; - value[kEndpointIdKey] = path.mEndpointId; - value[kCommandIdKey] = path.mCommandId; - - return LogError(value, status); - } - - static CHIP_ERROR LogEventAsJSON(const chip::app::EventHeader & header, chip::TLV::TLVReader * data) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = header.mPath.mClusterId; - value[kEndpointIdKey] = header.mPath.mEndpointId; - value[kEventIdKey] = header.mPath.mEventId; - - chip::TLV::TLVReader reader; - reader.Init(*data); - ReturnErrorOnFailure(chip::TlvToJson(reader, value)); - - auto valueStr = chip::JsonToString(value); - return mJSONDelegate->LogJSON(valueStr.c_str()); - } - - static CHIP_ERROR LogErrorAsJSON(const chip::app::EventHeader & header, const chip::app::StatusIB & status) - { - VerifyOrReturnError(mJSONDelegate != nullptr, CHIP_NO_ERROR); - - Json::Value value; - value[kClusterIdKey] = header.mPath.mClusterId; - value[kEndpointIdKey] = header.mPath.mEndpointId; - value[kEventIdKey] = header.mPath.mEventId; - - return LogError(value, status); - } - - static CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) - { - Json::Value value; - chip::app::StatusIB status; - status.InitFromChipError(error); - return LogError(value, status); - } - - static void SetJSONDelegate(DataModelLoggerJSONDelegate * delegate) { mJSONDelegate = delegate; } - private: - static CHIP_ERROR LogError(Json::Value & value, const chip::app::StatusIB & status) - { - if (status.mClusterStatus.HasValue()) - { - auto statusValue = status.mClusterStatus.Value(); - value[kClusterErrorIdKey] = statusValue; - } - - auto statusName = chip::Protocols::InteractionModel::StatusName(status.mStatus); - value[kErrorIdKey] = statusName; - - auto valueStr = chip::JsonToString(value); - return mJSONDelegate->LogJSON(valueStr.c_str()); - } - static CHIP_ERROR LogValue(const char * label, size_t indent, bool value) { DataModelLogger::LogString(label, indent, value ? "TRUE" : "FALSE"); @@ -323,5 +196,4 @@ class DataModelLogger } static size_t ComputePrefixSize(const std::string label, size_t indent) { return ComputePrefix(label, indent).size(); } - static DataModelLoggerJSONDelegate * mJSONDelegate; }; diff --git a/examples/chip-tool/commands/clusters/ReportCommand.h b/examples/chip-tool/commands/clusters/ReportCommand.h index e4177f87a02bf8..98a51cd7232e93 100644 --- a/examples/chip-tool/commands/clusters/ReportCommand.h +++ b/examples/chip-tool/commands/clusters/ReportCommand.h @@ -37,7 +37,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(path, status)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -51,7 +51,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi return; } - ReturnOnFailure(DataModelLogger::LogAttributeAsJSON(path, data)); + ReturnOnFailure(RemoteDataModelLogger::LogAttributeAsJSON(path, data)); error = DataModelLogger::LogAttribute(path, data); if (CHIP_NO_ERROR != error) @@ -70,7 +70,7 @@ class ReportCommand : public InteractionModelReports, public ModelCommand, publi CHIP_ERROR error = status->ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(eventHeader, *status)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(eventHeader, *status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h index f3f9233a854815..1b92da403d3dab 100644 --- a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h +++ b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h @@ -109,7 +109,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi CHIP_ERROR error = status.ToChipError(); if (CHIP_NO_ERROR != error) { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(path, status)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(path, status)); ChipLogError(chipTool, "Response Failure: %s", chip::ErrorStr(error)); mError = error; @@ -118,7 +118,7 @@ class WriteAttribute : public InteractionModelWriter, public ModelCommand, publi void OnError(const chip::app::WriteClient * client, CHIP_ERROR error) override { - ReturnOnFailure(DataModelLogger::LogErrorAsJSON(error)); + ReturnOnFailure(RemoteDataModelLogger::LogErrorAsJSON(error)); ChipLogProgress(chipTool, "Error: %s", chip::ErrorStr(error)); mError = error; diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp new file mode 100644 index 00000000000000..512a28e5ae80c9 --- /dev/null +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp @@ -0,0 +1,155 @@ +/* + * 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" + +#include + +constexpr const char * kClusterIdKey = "clusterId"; +constexpr const char * kEndpointIdKey = "endpointId"; +constexpr const char * kAttributeIdKey = "attributeId"; +constexpr const char * kEventIdKey = "eventId"; +constexpr const char * kCommandIdKey = "commandId"; +constexpr const char * kErrorIdKey = "error"; +constexpr const char * kClusterErrorIdKey = "clusterError"; + +namespace { +RemoteDataModelLoggerDelegate * gDelegate; + +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 = chip::JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} +} // namespace + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = path.mClusterId; + value[kEndpointIdKey] = path.mEndpointId; + value[kAttributeIdKey] = path.mAttributeId; + + chip::TLV::TLVReader reader; + reader.Init(*data); + ReturnErrorOnFailure(chip::TlvToJson(reader, value)); + + auto valueStr = chip::JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteDataAttributePath & path, const chip::app::StatusIB & status) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = path.mClusterId; + value[kEndpointIdKey] = path.mEndpointId; + value[kAttributeIdKey] = path.mAttributeId; + + return LogError(value, status); +} + +CHIP_ERROR LogCommandAsJSON(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = path.mClusterId; + value[kEndpointIdKey] = path.mEndpointId; + value[kCommandIdKey] = path.mCommandId; + + chip::TLV::TLVReader reader; + reader.Init(*data); + ReturnErrorOnFailure(chip::TlvToJson(reader, value)); + + auto valueStr = chip::JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteCommandPath & path, const chip::app::StatusIB & status) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = path.mClusterId; + value[kEndpointIdKey] = path.mEndpointId; + value[kCommandIdKey] = path.mCommandId; + + return LogError(value, status); +} + +CHIP_ERROR LogEventAsJSON(const chip::app::EventHeader & header, chip::TLV::TLVReader * data) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = header.mPath.mClusterId; + value[kEndpointIdKey] = header.mPath.mEndpointId; + value[kEventIdKey] = header.mPath.mEventId; + + chip::TLV::TLVReader reader; + reader.Init(*data); + ReturnErrorOnFailure(chip::TlvToJson(reader, value)); + + auto valueStr = chip::JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogErrorAsJSON(const chip::app::EventHeader & header, const chip::app::StatusIB & status) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kClusterIdKey] = header.mPath.mClusterId; + value[kEndpointIdKey] = header.mPath.mEndpointId; + value[kEventIdKey] = header.mPath.mEventId; + + return LogError(value, status); +} + +CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error) +{ + Json::Value value; + chip::app::StatusIB status; + status.InitFromChipError(error); + return LogError(value, status); +} + +void SetDelegate(RemoteDataModelLoggerDelegate * delegate) +{ + gDelegate = delegate; +} +}; // namespace RemoteDataModelLogger diff --git a/examples/chip-tool/commands/common/RemoteDataModelLogger.h b/examples/chip-tool/commands/common/RemoteDataModelLogger.h new file mode 100644 index 00000000000000..ed9cb1fe09b52d --- /dev/null +++ b/examples/chip-tool/commands/common/RemoteDataModelLogger.h @@ -0,0 +1,42 @@ +/* + * 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 RemoteDataModelLoggerDelegate +{ +public: + CHIP_ERROR virtual LogJSON(const char *) = 0; + virtual ~RemoteDataModelLoggerDelegate(){}; +}; + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data); +CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteDataAttributePath & path, const chip::app::StatusIB & status); +CHIP_ERROR LogCommandAsJSON(const chip::app::ConcreteCommandPath & path, chip::TLV::TLVReader * data); +CHIP_ERROR LogErrorAsJSON(const chip::app::ConcreteCommandPath & path, const chip::app::StatusIB & status); +CHIP_ERROR LogEventAsJSON(const chip::app::EventHeader & header, chip::TLV::TLVReader * data); +CHIP_ERROR LogErrorAsJSON(const chip::app::EventHeader & header, const chip::app::StatusIB & status); +CHIP_ERROR LogErrorAsJSON(const CHIP_ERROR & error); +void SetDelegate(RemoteDataModelLoggerDelegate * delegate); +}; // namespace RemoteDataModelLogger diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp index 4bcbc5c28e4565..f3c76c28881fb1 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp @@ -197,7 +197,7 @@ CHIP_ERROR InteractiveServerCommand::RunCommand() // is dumped to stdout while the user is typing a command. chip::Logging::SetLogRedirectCallback(InteractiveServerLoggingCallback); - DataModelLogger::SetJSONDelegate(this); + RemoteDataModelLogger::SetDelegate(this); ReturnErrorOnFailure(mWebSocketServer.Run(mPort, this)); gInteractiveServerResult.Reset(); diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.h b/examples/chip-tool/commands/interactive/InteractiveCommands.h index 6de3a7a8bf8242..5e611e6895d2b2 100644 --- a/examples/chip-tool/commands/interactive/InteractiveCommands.h +++ b/examples/chip-tool/commands/interactive/InteractiveCommands.h @@ -53,7 +53,7 @@ class InteractiveStartCommand : public InteractiveCommand CHIP_ERROR RunCommand() override; }; -class InteractiveServerCommand : public InteractiveCommand, public WebSocketServerDelegate, public DataModelLoggerJSONDelegate +class InteractiveServerCommand : public InteractiveCommand, public WebSocketServerDelegate, public RemoteDataModelLoggerDelegate { public: InteractiveServerCommand(Commands * commandsHandler, CredentialIssuerCommands * credsIssuerConfig) : @@ -68,7 +68,7 @@ class InteractiveServerCommand : public InteractiveCommand, public WebSocketServ /////////// WebSocketServerDelegate Interface ///////// bool OnWebSocketMessageReceived(char * msg) override; - /////////// DataModelLoggerJSONDelegate interface ///////// + /////////// RemoteDataModelLoggerDelegate interface ///////// CHIP_ERROR LogJSON(const char * json) override; private: diff --git a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt index e984cb63680e3a..5bff45c9951f7d 100644 --- a/examples/chip-tool/templates/logging/DataModelLogger-src.zapt +++ b/examples/chip-tool/templates/logging/DataModelLogger-src.zapt @@ -4,8 +4,6 @@ using namespace chip::app::Clusters; -DataModelLoggerJSONDelegate * DataModelLogger::mJSONDelegate = nullptr; - {{#structs_with_clusters groupByStructName=1}} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::{{#unless (is_number_greater_than structClusterCount 1)}}{{as_camel_cased clusterName false}}{{else}}detail{{/unless}}::Structs::{{name}}::DecodableType & value) { diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 920203bc86c72e..b08c23e5e810c7 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -44,6 +44,8 @@ chip_data_model("tv-casting-common") { "${chip_root}/examples/chip-tool/commands/common/Commands.h", "${chip_root}/examples/chip-tool/commands/common/CredentialIssuerCommands.h", "${chip_root}/examples/chip-tool/commands/common/HexConversion.h", + "${chip_root}/examples/chip-tool/commands/common/RemoteDataModelLogger.cpp", + "${chip_root}/examples/chip-tool/commands/common/RemoteDataModelLogger.h", "${chip_root}/src/controller/ExamplePersistentStorage.cpp", "${chip_root}/src/controller/ExamplePersistentStorage.h", "${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index d811b7a504cd33..2c26495971e1fe 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -21,8 +21,6 @@ using namespace chip::app::Clusters; -DataModelLoggerJSONDelegate * DataModelLogger::mJSONDelegate = nullptr; - CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::AccessControl::Structs::AccessControlEntryStruct::DecodableType & value) From c9311eb159715145155aa8983d69d8b1b881a8ed Mon Sep 17 00:00:00 2001 From: amitnj <74272437+amitnj@users.noreply.github.com> Date: Tue, 24 Jan 2023 06:19:01 -0800 Subject: [PATCH 04/10] Add ability to run tv casting app cert tests from the UI (#24559) * Add ability to run tv casting app cert tests from the UI * Restyled by clang-format * Remove some comments added by the IDE Co-authored-by: Restyled.io --- .../CastingServerBridge.h | 47 +++ .../CastingServerBridge.mm | 70 ++++ .../TvCasting.xcodeproj/project.pbxproj | 12 +- .../TvCasting/TvCasting/CertTestView.swift | 69 ++++ .../TvCasting/CertTestViewModel.swift | 377 ++++++++++++++++++ .../TvCasting/ClusterSelectorView.swift | 11 + 6 files changed, 584 insertions(+), 2 deletions(-) create mode 100644 examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift create mode 100644 examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h index 9c7a4abcb9cdb7..2e1b9801cc03c2 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.h @@ -1137,5 +1137,52 @@ requestSentHandler:(void (^_Nonnull)(MatterError * _Nonnull))requestSentHandler successCallback:(void (^_Nonnull)(NSString * _Nonnull))successCallback failureCallback:(void (^_Nonnull)(MatterError * _Nonnull))failureCallback; +/*! + @brief Send a OnOff:On request to a TV + + @param contentApp Content app endpoint to target + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to invoke callbacks on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)onOff_on:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a OnOff:Off request to a TV + + @param contentApp Content app endpoint to target + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to invoke callbacks on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)onOff_off:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; + +/*! + @brief Send a OnOff:Toggle request to a TV + + @param contentApp Content app endpoint to target + + @param responseCallback Callback for when the response has been received + + @param clientQueue Queue to invoke callbacks on + + @param requestSentHandler Handler to call on sending the request + */ +- (void)onOff_toggle:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler; @end #endif /* CastingServerBridge_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm index 72bcb8c9e706ac..6e64a999feaaf9 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/CastingServerBridge.mm @@ -2156,4 +2156,74 @@ - (void)applicationBasic_readApplicationVersion:(ContentApp * _Nonnull)contentAp }); } +- (void)onOff_on:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress(AppServer, "CastingServerBridge().onOff_on() called on Content App with endpoint ID %d", contentApp.endpointId); + + [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_on"]; + dispatch_async(_chipWorkQueue, ^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->OnOff_On(&endpoint, [](CHIP_ERROR err) { + void (^responseCallback)(bool) = + [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_on"]; + responseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)onOff_off:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress( + AppServer, "CastingServerBridge().onOff_off() called on Content App with endpoint ID %d", contentApp.endpointId); + + [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_off"]; + dispatch_async(_chipWorkQueue, ^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->OnOff_Off(&endpoint, [](CHIP_ERROR err) { + void (^responseCallback)(bool) = + [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_off"]; + responseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} + +- (void)onOff_toggle:(ContentApp * _Nonnull)contentApp + responseCallback:(void (^_Nonnull)(bool))responseCallback + clientQueue:(dispatch_queue_t _Nonnull)clientQueue + requestSentHandler:(void (^_Nonnull)(bool))requestSentHandler +{ + ChipLogProgress( + AppServer, "CastingServerBridge().onOff_toggle() called on Content App with endpoint ID %d", contentApp.endpointId); + + [_commandResponseCallbacks setObject:responseCallback forKey:@"onOff_toggle"]; + dispatch_async(_chipWorkQueue, ^{ + TargetEndpointInfo endpoint; + [ConversionUtils convertToCppTargetEndpointInfoFrom:contentApp outTargetEndpointInfo:endpoint]; + + CHIP_ERROR err = CastingServer::GetInstance()->OnOff_Toggle(&endpoint, [](CHIP_ERROR err) { + void (^responseCallback)(bool) = + [[CastingServerBridge getSharedInstance].commandResponseCallbacks objectForKey:@"onOff_toggle"]; + responseCallback(CHIP_NO_ERROR == err); + }); + dispatch_async(clientQueue, ^{ + requestSentHandler(CHIP_NO_ERROR == err); + }); + }); +} @end 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 6252d2cb145612..5ddb457fc7464f 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj @@ -26,6 +26,8 @@ 3CCB8748286A5D0F00771BAD /* CommissioningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C7507B82853EFF000D7DB3A /* CommissioningViewModel.swift */; }; 3CCB8749286A5D0F00771BAD /* ContentLauncherView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CA19434285BA780004768D5 /* ContentLauncherView.swift */; }; 3CCB874A286A5D0F00771BAD /* ContentLauncherViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CA19436285BA877004768D5 /* ContentLauncherViewModel.swift */; }; + EAF14299296D561900E17793 /* CertTestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF14298296D561900E17793 /* CertTestView.swift */; }; + EAF1429B296D57DF00E17793 /* CertTestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAF1429A296D57DF00E17793 /* CertTestViewModel.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -64,6 +66,8 @@ 3CC0E9002841DD3500EC6A18 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 3CC0E90C2841DECC00EC6A18 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 3CCB872A28690A5D00771BAD /* MatterTvCastingBridge.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MatterTvCastingBridge.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EAF14298296D561900E17793 /* CertTestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertTestView.swift; sourceTree = ""; }; + EAF1429A296D57DF00E17793 /* CertTestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertTestViewModel.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -109,6 +113,8 @@ children = ( 3CC0E8FD2841DD3500EC6A18 /* Assets.xcassets */, 3C75075E284C1DF800D7DB3A /* TvCasting.entitlements */, + EAF14298296D561900E17793 /* CertTestView.swift */, + EAF1429A296D57DF00E17793 /* CertTestViewModel.swift */, 3CC0E8F92841DD3400EC6A18 /* TvCastingApp.swift */, 3CC0E8FB2841DD3400EC6A18 /* ContentView.swift */, 3C81C75228F8C79E001CB9D1 /* StartFromCacheView.swift */, @@ -226,11 +232,13 @@ 3CCB8746286A5D0F00771BAD /* CommissionerDiscoveryViewModel.swift in Sources */, 3C81C75928F8E42D001CB9D1 /* ConnectionViewModel.swift in Sources */, 3CA1CA7A28E281080023ED44 /* ClusterSelectorView.swift in Sources */, + EAF14299296D561900E17793 /* CertTestView.swift in Sources */, 3CCB8747286A5D0F00771BAD /* CommissioningView.swift in Sources */, 3CCB8748286A5D0F00771BAD /* CommissioningViewModel.swift in Sources */, 3CA1CA7E28E284950023ED44 /* MediaPlaybackViewModel.swift in Sources */, 3CCB8749286A5D0F00771BAD /* ContentLauncherView.swift in Sources */, 3CCB874A286A5D0F00771BAD /* ContentLauncherViewModel.swift in Sources */, + EAF1429B296D57DF00E17793 /* CertTestViewModel.swift in Sources */, 3C81C75728F8E418001CB9D1 /* ConnectionView.swift in Sources */, 3CC0E8FC2841DD3400EC6A18 /* ContentView.swift in Sources */, 3CA1CA7C28E282150023ED44 /* MediaPlaybackView.swift in Sources */, @@ -371,7 +379,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"TvCasting/Preview Content\""; - DEVELOPMENT_TEAM = R7NUZ7N74U; + DEVELOPMENT_TEAM = KCRB72LX9T; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -441,7 +449,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"TvCasting/Preview Content\""; - DEVELOPMENT_TEAM = R7NUZ7N74U; + DEVELOPMENT_TEAM = KCRB72LX9T; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift new file mode 100644 index 00000000000000..f38e84a7ac30fc --- /dev/null +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestView.swift @@ -0,0 +1,69 @@ + +/** + * + * Copyright (c) 2020-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. + */ + +import SwiftUI + +struct CertTestView: View { + @StateObject var viewModel = CertTestViewModel() + @State private var targetContentAppId: String = "" + + var body: some View { + VStack(alignment: .leading) { + if(viewModel.contentAppIds.isEmpty) + { + Text("No Content Launcher cluster supporting content apps found on this video player!") + } + else + { + HStack() { + Text("Content App Endpoint Id") + + VStack() + { + Picker("Select", selection: $targetContentAppId) { + Text("Select").tag(nil as String?) + ForEach(viewModel.contentAppIds, id: \.self) { contentAppId in + Text(String(contentAppId)) + } + } + .pickerStyle(.menu) + .padding(2) + } + .border(.secondary) + } + + Button("Launch Test") { + viewModel.launchTest(targetContentAppId: targetContentAppId) + } + .background(Color.blue) + .foregroundColor(Color.white) + .cornerRadius(4) + .border(Color.black, width: 1) + .padding() + + Text(viewModel.status ?? "") + } + + } + .navigationTitle("Cert Test Launcher") + .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .top) + .onAppear(perform: { + viewModel.populateAndInitializeEndpoints() + }) + } +} diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift new file mode 100644 index 00000000000000..154c8156f22d97 --- /dev/null +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/CertTestViewModel.swift @@ -0,0 +1,377 @@ +/** + * + * Copyright (c) 2020-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. + */ + +import Foundation +import os.log + +class CallbackHelper { + var testCaseName: String; + var certTestViewModel: CertTestViewModel; + let Log = Logger(subsystem: "com.matter.casting", + category: "CertTestViewModel") + + init(testCaseName: String, certTestViewModel: CertTestViewModel) { + self.testCaseName = testCaseName + self.certTestViewModel = certTestViewModel + } + + func responseCallback(result: Bool) + { + self.Log.info("CertTestViewModel.responseCallback.\(self.testCaseName) result \(result)") + DispatchQueue.main.async { + self.certTestViewModel.status = result ? "Test \(self.testCaseName) successful" : "Test \(self.testCaseName) failed" + } + } + + func requestSentHandler(result: Bool) + { + self.Log.info("CertTestViewModel.requestSentHandler.\(self.testCaseName) result \(result)") + } + + func successCallbackString(result: String) + { + self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + DispatchQueue.main.async { + self.certTestViewModel.status = "Test \(self.testCaseName) successful" + } + } + + func successCallbackInteger(result: UInt16) + { + self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + DispatchQueue.main.async { + self.certTestViewModel.status = "Test \(self.testCaseName) successful" + } + } + + func successCallbackNumber(result: NSNumber) + { + self.Log.info("CertTestViewModel.successCallback.\(self.testCaseName) result \(result)") + DispatchQueue.main.async { + self.certTestViewModel.status = "Test \(self.testCaseName) successful" + } + } + + func failureCallback(result: MatterError) + { + self.Log.info("CertTestViewModel.failureCallback.\(self.testCaseName) failed. Code : \(result.code). Message : \(result.message ?? "")") + DispatchQueue.main.async { + self.certTestViewModel.status = "Test \(self.testCaseName) failed. Code : \(result.code). Message : \(result.message ?? "")" + } + } + + func requestSentHandlerError(result: MatterError) + { + self.Log.info("CertTestViewModel.requestSentHandler.\(self.testCaseName). Code : \(result.code). Message : result.message") + } + +} + +class CertTestViewModel: ObservableObject { + let Log = Logger(subsystem: "com.matter.casting", + category: "CertTestViewModel") + + @Published var status: String?; + + @Published var contentAppIds: [String] = []; + + var targetVideoPlayer: VideoPlayer?; + var deviceEndpoint: ContentApp?; + var deviceSpeakerEndpoint: ContentApp?; + var testCaseName: String = ""; + + func runCertTest(testCaseName: String, test: (CallbackHelper) -> ()) + { + self.testCaseName = testCaseName; + test(CallbackHelper(testCaseName: testCaseName, certTestViewModel: self)); + } + + func launchTest(targetContentAppId: String?) + { + if (targetContentAppId != nil && !targetContentAppId!.isEmpty) + { + var targetContentApp: ContentApp? + for contentApp in (targetVideoPlayer!.contentApps as! [ContentApp]) { + if(UInt16(targetContentAppId!) == contentApp.endpointId) + { + targetContentApp = contentApp + break + } + } + + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + runCertTest(testCaseName: "keypadInput_sendKey", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.keypadInput_sendKey(deviceEndpoint!, keyCode: 10, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "applicationLauncher_launch", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationLauncher_launch(deviceEndpoint!, catalogVendorId: 123, applicationId: "exampleid", data: nil, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "applicationLauncher_stop", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationLauncher_stop(deviceEndpoint!, + catalogVendorId: 123, applicationId: "exampleid", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "applicationLauncher_hide", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationLauncher_hide(deviceEndpoint!, + catalogVendorId: 123, applicationId: "exampleid", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "targetNavigator_navigateTarget", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.targetNavigator_navigateTarget(deviceEndpoint!, + target: 1, data: "", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "contentLauncher_launchUrl", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.contentLauncher_launchUrl(targetContentApp!, + contentUrl: "https://dummyurl", + contentDisplayStr: "Dummy Content", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "contentLauncher_launchContent", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.contentLauncher_launchContent(targetContentApp!, + contentSearch: ContentLauncher_ContentSearch(parameterList: [ContentLauncher_Parameter(type: ContentLauncher_ParameterEnum.Video, value: "Dummy Video", externalIDList: [ContentLauncher_AdditionalInfo(name: "imdb", value: "dummyId"),]),]), + autoPlay: true, data: "", + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_play", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_play(targetContentApp!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_next", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_next(targetContentApp!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_skipForward", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_skipForward(targetContentApp!, + deltaPositionMilliseconds: 10000, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_skipBackward", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_skipBackward(targetContentApp!, + deltaPositionMilliseconds: 10000, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_pause", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_pause(targetContentApp!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "mediaPlayback_stopPlayback", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.mediaPlayback_stopPlayback(targetContentApp!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "onOff_on", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.onOff_(on: deviceEndpoint!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "onOff_off", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.onOff_off(deviceEndpoint!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "onOff_toggle", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.onOff_toggle(deviceEndpoint!, + responseCallback:callbackHelper.responseCallback, + clientQueue: DispatchQueue.main, + requestSentHandler:callbackHelper.requestSentHandler + ) + } + ) + + runCertTest(testCaseName: "applicationBasic_readApplicationVersion", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationBasic_readApplicationVersion(targetContentApp!, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + } + ) + + runCertTest(testCaseName: "applicationBasic_readVendorName", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationBasic_readVendorName(targetContentApp!, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + } + ) + + runCertTest(testCaseName: "applicationBasic_readApplicationName", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationBasic_readApplicationName(targetContentApp!, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackString, + failureCallback: callbackHelper.failureCallback + ) + } + ) + + runCertTest(testCaseName: "applicationBasic_readVendorID", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationBasic_readVendorID(targetContentApp!, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackNumber, + failureCallback: callbackHelper.failureCallback + ) + } + ) + + runCertTest(testCaseName: "applicationBasic_readProductID", + test: { (callbackHelper: CallbackHelper) -> () in + castingServerBridge.applicationBasic_readProductID(targetContentApp!, + clientQueue: DispatchQueue.main, + requestSentHandler: callbackHelper.requestSentHandlerError, + successCallback: callbackHelper.successCallbackInteger, + failureCallback: callbackHelper.failureCallback + ) + } + ) + } + } + else + { + Log.debug("CertTestViewModel.launchTest input(s) missing!") + self.status = "Missing input parameter(s)!" + } + } + + func populateAndInitializeEndpoints() + { + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + castingServerBridge.getActiveTargetVideoPlayers(DispatchQueue.main, + activeTargetVideoPlayersHandler: { (targetVideoPlayers: NSMutableArray?) -> () in + let targetVideoPlayer: VideoPlayer = targetVideoPlayers![0] as! VideoPlayer + if(targetVideoPlayer.isInitialized && targetVideoPlayer.isConnected) + { + self.targetVideoPlayer = targetVideoPlayer + for contentApp in (targetVideoPlayer.contentApps as! [ContentApp]) + { + if(contentApp.endpointId == 1) + { + self.deviceEndpoint = contentApp + } else if(contentApp.endpointId == 2) + { + self.deviceSpeakerEndpoint = contentApp + } else + { + self.contentAppIds.append(String(contentApp.endpointId)) + } + } + } + }) + } + } +} diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/ClusterSelectorView.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/ClusterSelectorView.swift index d7285e82ec1a2b..9dbc9f16d84fa6 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/ClusterSelectorView.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/ClusterSelectorView.swift @@ -41,6 +41,17 @@ struct ClusterSelectorView: View { ).background(Color.blue) .foregroundColor(Color.white) .padding() + + NavigationLink( + destination: CertTestView(), + label: { + Text("Certification Tests") + .frame(width: 300, height: 30, alignment: .center) + .border(Color.black, width: 1) + } + ).background(Color.blue) + .foregroundColor(Color.white) + .padding() } .navigationTitle("Cluster selection") .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity, alignment: .top) From 7c17463e61d604b76d5966e15d524be6378d234e Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 24 Jan 2023 15:20:40 +0100 Subject: [PATCH 05/10] [matter_yamltests] Ensure that the PICSChecker code does not throw if no file is used (#24614) --- scripts/py_matter_yamltests/matter_yamltests/pics_checker.py | 5 +++-- scripts/py_matter_yamltests/test_pics_checker.py | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/pics_checker.py b/scripts/py_matter_yamltests/matter_yamltests/pics_checker.py index 580c83dfd696c6..5c1fca1101240d 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/pics_checker.py +++ b/scripts/py_matter_yamltests/matter_yamltests/pics_checker.py @@ -39,10 +39,11 @@ class InvalidPICSParsingError(Exception): class PICSChecker(): """Class to compute a PICS expression""" - __pics: None - __expression_index: 0 def __init__(self, pics_file: str): + self.__pics = {} + self.__expression_index = 0 + if pics_file is not None: self.__pics = self.__parse(pics_file) diff --git a/scripts/py_matter_yamltests/test_pics_checker.py b/scripts/py_matter_yamltests/test_pics_checker.py index df3364c0d21c4b..39f2dcd10b6806 100644 --- a/scripts/py_matter_yamltests/test_pics_checker.py +++ b/scripts/py_matter_yamltests/test_pics_checker.py @@ -67,6 +67,11 @@ class TestPICSChecker(unittest.TestCase): + def test_no_file(self): + pics_checker = PICSChecker(None) + self.assertIsInstance(pics_checker, PICSChecker) + self.assertFalse(pics_checker.check('A.A')) + @patch('builtins.open', mock_open(read_data=empty_config)) def test_empty_config(self): pics_checker = PICSChecker('') From 49e5e377ca3ab768c1c6ea56fc5783662b32f796 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 24 Jan 2023 10:04:00 -0500 Subject: [PATCH 06/10] Align naming in Application Basic cluster XML with the spec. (#24602) * Align naming in Application Basic cluster XML with the spec. * Auto-update ZAP files. * Regenerate generated code. --- .../all-clusters-common/all-clusters-app.zap | 2 +- .../all-clusters-minimal-app.matter | 17 +- .../all-clusters-minimal-app.zap | 10 +- .../placeholder/linux/apps/app1/config.matter | 16 +- .../placeholder/linux/apps/app1/config.zap | 2 +- .../placeholder/linux/apps/app2/config.matter | 16 +- .../placeholder/linux/apps/app2/config.zap | 2 +- examples/tv-app/tv-common/tv-app.matter | 17 +- examples/tv-app/tv-common/tv-app.zap | 2 +- .../zap/tests/inputs/all-clusters-app.zap | 165 +++++++++--------- .../tools/zap/tests/inputs/lighting-app.zap | 64 +++---- scripts/tools/zap_convert_all.py | 2 +- .../application-basic-delegate.h | 5 +- .../application-basic-server.cpp | 10 +- .../common/templates/legacy-struct-list.yaml | 1 - .../suites/TV_ApplicationBasicCluster.yaml | 2 +- .../certification/Test_TC_APBSC_9_1.yaml | 2 +- .../chip/application-basic-cluster.xml | 11 +- .../chip/application-launcher-cluster.xml | 5 + .../data_model/controller-clusters.matter | 17 +- .../data_model/controller-clusters.zap | 4 +- .../CHIPAttributeTLVValueDecoder.cpp | 39 ++--- .../chip/devicecontroller/ChipStructs.java | 23 ++- .../python/chip/clusters/Objects.py | 18 +- .../CHIP/templates/availability.yaml | 22 +++ .../MTRAttributeTLVValueDecoder.mm | 10 +- .../CHIP/zap-generated/MTRBaseClusters.h | 9 +- .../CHIP/zap-generated/MTRBaseClusters.mm | 23 ++- .../CHIP/zap-generated/MTRCallbackBridge.h | 7 +- .../CHIP/zap-generated/MTRCallbackBridge.mm | 12 +- .../CHIP/zap-generated/MTRStructsObjc.h | 13 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 39 ++++- .../app-common/zap-generated/af-structs.h | 7 - .../zap-generated/cluster-objects.cpp | 135 +++++--------- .../zap-generated/cluster-objects.h | 77 +++----- .../cluster/ComplexArgumentParser.cpp | 31 +--- .../cluster/ComplexArgumentParser.h | 9 +- .../cluster/logging/DataModelLogger.cpp | 32 +--- .../cluster/logging/DataModelLogger.h | 5 +- .../chip-tool/zap-generated/test/Commands.h | 10 +- .../zap-generated/cluster/Commands.h | 4 +- .../zap-generated/test/Commands.h | 14 +- 42 files changed, 406 insertions(+), 505 deletions(-) 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 f78714be1c9ea4..727730b6b6045a 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 @@ -16819,7 +16819,7 @@ "reportableChange": 0 }, { - "name": "IntrinsicBalanceFactor", + "name": "IntrinsicBallastFactor", "code": 20, "mfgCode": null, "side": "server", 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 6980d7afb3f3f6..6f9667a26450e3 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 @@ -6,6 +6,11 @@ struct LabelStruct { char_string<16> value = 1; } +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + server cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { kBlink = 0; @@ -2928,11 +2933,6 @@ server cluster ApplicationLauncher = 1292 { kApplicationPlatform = 0x1; } - struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; - } - readonly attribute bitmap32 featureMap = 65532; readonly attribute int16u clusterRevision = 65533; @@ -2967,13 +2967,8 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; - } - readonly attribute char_string<32> applicationName = 2; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; 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 e82b98e527c6b0..ef03195bd8b49b 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 @@ -16311,7 +16311,7 @@ "reportableChange": 0 }, { - "name": "IntrinsicBalanceFactor", + "name": "IntrinsicBallastFactor", "code": 20, "mfgCode": null, "side": "server", @@ -16461,7 +16461,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -16477,7 +16477,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -16493,7 +16493,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -18865,7 +18865,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationBasicApplication", + "type": "ApplicationStruct", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index edf4aed790aad1..9beb7e35e56454 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -2692,16 +2692,16 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; @@ -2720,16 +2720,16 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 200c328a48fa82..97bb36fb1b1997 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -6683,7 +6683,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationBasicApplication", + "type": "ApplicationStruct", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 619978a24acf5d..c74463df762bbd 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -2669,16 +2669,16 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; @@ -2697,16 +2697,16 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; + struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; } readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 57f3dbe7c191a3..1410b0308db2d0 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -6967,7 +6967,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationBasicApplication", + "type": "ApplicationStruct", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index b9c62d4df6a064..d8ec1ac03e2590 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -6,6 +6,11 @@ struct LabelStruct { char_string<16> value = 1; } +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + server cluster OnOff = 6 { enum OnOffDelayedAllOffEffectVariant : ENUM8 { kFadeToOffIn0p8Seconds = 0; @@ -2055,11 +2060,6 @@ server cluster ApplicationLauncher = 1292 { optional endpoint_no endpoint = 1; } - struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; - } - readonly attribute INT16U catalogList[] = 0; attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -2099,16 +2099,11 @@ server cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; - } - readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index a5f300545b0c6b..605115daa66e57 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -12063,7 +12063,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationBasicApplication", + "type": "ApplicationStruct", "included": 1, "storageOption": "External", "singleton": 0, diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 221866e755482b..a60b4ef82f760c 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": 87, + "featureLevel": 89, "creator": "zap", "keyValuePairs": [ { @@ -91,7 +91,7 @@ "enabled": 1, "attributes": [ { - "name": "identify time", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", @@ -107,7 +107,7 @@ "reportableChange": 0 }, { - "name": "identify type", + "name": "IdentifyType", "code": 1, "mfgCode": null, "side": "server", @@ -1139,10 +1139,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "client", "enabled": 0, "attributes": [ @@ -1165,10 +1165,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "server", "enabled": 1, "attributes": [ @@ -1663,7 +1663,7 @@ "enabled": 0, "commands": [ { - "name": "AnnounceOtaProvider", + "name": "AnnounceOTAProvider", "code": 0, "mfgCode": null, "source": "client", @@ -1699,7 +1699,7 @@ "enabled": 1, "attributes": [ { - "name": "DefaultOtaProviders", + "name": "DefaultOTAProviders", "code": 0, "mfgCode": null, "side": "server", @@ -3415,11 +3415,11 @@ "reportableChange": 0 }, { - "name": "BootReasons", + "name": "BootReason", "code": 4, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BootReasonEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -3745,7 +3745,7 @@ "enabled": 1, "attributes": [ { - "name": "channel", + "name": "Channel", "code": 0, "mfgCode": null, "side": "server", @@ -3857,7 +3857,7 @@ "reportableChange": 0 }, { - "name": "NeighborTableList", + "name": "NeighborTable", "code": 7, "mfgCode": null, "side": "server", @@ -3873,7 +3873,7 @@ "reportableChange": 0 }, { - "name": "RouteTableList", + "name": "RouteTable", "code": 8, "mfgCode": null, "side": "server", @@ -3905,7 +3905,7 @@ "reportableChange": 0 }, { - "name": "weighting", + "name": "Weighting", "code": 10, "mfgCode": null, "side": "server", @@ -4831,7 +4831,7 @@ "enabled": 1, "attributes": [ { - "name": "bssid", + "name": "BSSID", "code": 0, "mfgCode": null, "side": "server", @@ -4895,7 +4895,7 @@ "reportableChange": 0 }, { - "name": "Rssi", + "name": "RSSI", "code": 4, "mfgCode": null, "side": "server", @@ -5121,7 +5121,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "PHYRateType", + "type": "PHYRateEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -5329,7 +5329,7 @@ "enabled": 0, "attributes": [ { - "name": "number of positions", + "name": "NumberOfPositions", "code": 0, "mfgCode": null, "side": "server", @@ -5345,7 +5345,7 @@ "reportableChange": 0 }, { - "name": "current position", + "name": "CurrentPosition", "code": 1, "mfgCode": null, "side": "server", @@ -5361,7 +5361,7 @@ "reportableChange": 0 }, { - "name": "multi press max", + "name": "MultiPressMax", "code": 2, "mfgCode": null, "side": "server", @@ -5395,7 +5395,7 @@ ] }, { - "name": "AdministratorCommissioning", + "name": "Administrator Commissioning", "code": 60, "mfgCode": null, "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", @@ -5447,7 +5447,7 @@ ] }, { - "name": "AdministratorCommissioning", + "name": "Administrator Commissioning", "code": 60, "mfgCode": null, "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", @@ -5459,7 +5459,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "CommissioningWindowStatus", + "type": "CommissioningWindowStatusEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -6001,7 +6001,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -6067,7 +6067,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -6221,7 +6221,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "DlDoorState", + "type": "DoorStateEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -6301,7 +6301,7 @@ "code": 37, "mfgCode": null, "side": "server", - "type": "DlOperatingMode", + "type": "OperatingModeEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -7857,7 +7857,7 @@ "enabled": 1, "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -7873,7 +7873,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -7889,7 +7889,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -7905,7 +7905,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -7989,7 +7989,7 @@ "enabled": 0, "attributes": [ { - "name": "occupancy", + "name": "Occupancy", "code": 0, "mfgCode": null, "side": "server", @@ -8005,7 +8005,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type", + "name": "OccupancySensorType", "code": 1, "mfgCode": null, "side": "server", @@ -8021,7 +8021,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type bitmap", + "name": "OccupancySensorTypeBitmap", "code": 2, "mfgCode": null, "side": "server", @@ -8657,7 +8657,7 @@ "enabled": 1, "attributes": [ { - "name": "identify time", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", @@ -8673,7 +8673,7 @@ "reportableChange": 0 }, { - "name": "identify type", + "name": "IdentifyType", "code": 1, "mfgCode": null, "side": "server", @@ -10395,10 +10395,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "client", "enabled": 0, "attributes": [ @@ -10421,10 +10421,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "server", "enabled": 0, "attributes": [ @@ -11953,7 +11953,7 @@ "enabled": 1, "attributes": [ { - "name": "number of positions", + "name": "NumberOfPositions", "code": 0, "mfgCode": null, "side": "server", @@ -11969,7 +11969,7 @@ "reportableChange": 0 }, { - "name": "current position", + "name": "CurrentPosition", "code": 1, "mfgCode": null, "side": "server", @@ -11985,7 +11985,7 @@ "reportableChange": 0 }, { - "name": "multi press max", + "name": "MultiPressMax", "code": 2, "mfgCode": null, "side": "server", @@ -12153,7 +12153,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -12219,7 +12219,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -12817,7 +12817,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "DlDoorState", + "type": "DoorStateEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -13137,7 +13137,7 @@ "code": 37, "mfgCode": null, "side": "server", - "type": "DlOperatingMode", + "type": "OperatingModeEnum", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -15047,7 +15047,7 @@ "enabled": 1, "attributes": [ { - "name": "fan mode", + "name": "FanMode", "code": 0, "mfgCode": null, "side": "server", @@ -15063,7 +15063,7 @@ "reportableChange": 0 }, { - "name": "fan mode sequence", + "name": "FanModeSequence", "code": 1, "mfgCode": null, "side": "server", @@ -15079,7 +15079,7 @@ "reportableChange": 0 }, { - "name": "percent setting", + "name": "PercentSetting", "code": 2, "mfgCode": null, "side": "server", @@ -15095,7 +15095,7 @@ "reportableChange": 0 }, { - "name": "percent current", + "name": "PercentCurrent", "code": 3, "mfgCode": null, "side": "server", @@ -15111,7 +15111,7 @@ "reportableChange": 0 }, { - "name": "speed max", + "name": "SpeedMax", "code": 4, "mfgCode": null, "side": "server", @@ -15127,7 +15127,7 @@ "reportableChange": 0 }, { - "name": "speed setting", + "name": "SpeedSetting", "code": 5, "mfgCode": null, "side": "server", @@ -15143,7 +15143,7 @@ "reportableChange": 0 }, { - "name": "speed current", + "name": "SpeedCurrent", "code": 6, "mfgCode": null, "side": "server", @@ -15159,7 +15159,7 @@ "reportableChange": 0 }, { - "name": "rock support", + "name": "RockSupport", "code": 7, "mfgCode": null, "side": "server", @@ -15175,7 +15175,7 @@ "reportableChange": 0 }, { - "name": "rock setting", + "name": "RockSetting", "code": 8, "mfgCode": null, "side": "server", @@ -15191,7 +15191,7 @@ "reportableChange": 0 }, { - "name": "wind support", + "name": "WindSupport", "code": 9, "mfgCode": null, "side": "server", @@ -15207,7 +15207,7 @@ "reportableChange": 0 }, { - "name": "wind setting", + "name": "WindSetting", "code": 10, "mfgCode": null, "side": "server", @@ -15339,7 +15339,7 @@ "enabled": 1, "attributes": [ { - "name": "temperature display mode", + "name": "TemperatureDisplayMode", "code": 0, "mfgCode": null, "side": "server", @@ -15355,7 +15355,7 @@ "reportableChange": 0 }, { - "name": "keypad lockout", + "name": "KeypadLockout", "code": 1, "mfgCode": null, "side": "server", @@ -15371,7 +15371,7 @@ "reportableChange": 0 }, { - "name": "schedule programming visibility", + "name": "ScheduleProgrammingVisibility", "code": 2, "mfgCode": null, "side": "server", @@ -17085,7 +17085,7 @@ "enabled": 1, "attributes": [ { - "name": "measured value", + "name": "MeasuredValue", "code": 0, "mfgCode": null, "side": "server", @@ -17101,7 +17101,7 @@ "reportableChange": 0 }, { - "name": "min measured value", + "name": "MinMeasuredValue", "code": 1, "mfgCode": null, "side": "server", @@ -17117,7 +17117,7 @@ "reportableChange": 0 }, { - "name": "max measured value", + "name": "MaxMeasuredValue", "code": 2, "mfgCode": null, "side": "server", @@ -17133,7 +17133,7 @@ "reportableChange": 0 }, { - "name": "tolerance", + "name": "Tolerance", "code": 3, "mfgCode": null, "side": "server", @@ -17217,7 +17217,7 @@ "enabled": 1, "attributes": [ { - "name": "occupancy", + "name": "Occupancy", "code": 0, "mfgCode": null, "side": "server", @@ -17233,7 +17233,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type", + "name": "OccupancySensorType", "code": 1, "mfgCode": null, "side": "server", @@ -17249,7 +17249,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type bitmap", + "name": "OccupancySensorTypeBitmap", "code": 2, "mfgCode": null, "side": "server", @@ -17503,7 +17503,7 @@ "code": 1, "mfgCode": null, "side": "server", - "type": "LineupInfo", + "type": "LineupInfoStruct", "included": 0, "storageOption": "External", "singleton": 0, @@ -17519,7 +17519,7 @@ "code": 2, "mfgCode": null, "side": "server", - "type": "ChannelInfo", + "type": "ChannelInfoStruct", "included": 0, "storageOption": "External", "singleton": 0, @@ -20819,7 +20819,7 @@ "enabled": 0, "attributes": [ { - "name": "identify time", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", @@ -21701,10 +21701,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "client", "enabled": 0, "attributes": [ @@ -21727,10 +21727,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "server", "enabled": 0, "attributes": [ @@ -22771,7 +22771,7 @@ "code": 3, "mfgCode": null, "side": "server", - "type": "DlDoorState", + "type": "DoorStateEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -22851,7 +22851,7 @@ "code": 37, "mfgCode": null, "side": "server", - "type": "DlOperatingMode", + "type": "OperatingModeEnum", "included": 0, "storageOption": "RAM", "singleton": 0, @@ -24275,7 +24275,7 @@ "enabled": 1, "attributes": [ { - "name": "occupancy", + "name": "Occupancy", "code": 0, "mfgCode": null, "side": "server", @@ -24291,7 +24291,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type", + "name": "OccupancySensorType", "code": 1, "mfgCode": null, "side": "server", @@ -24307,7 +24307,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type bitmap", + "name": "OccupancySensorTypeBitmap", "code": 2, "mfgCode": null, "side": "server", @@ -24740,6 +24740,5 @@ "endpointVersion": 1, "deviceIdentifier": 61442 } - ], - "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 46f17b66d6dfcf..0b024705ad9d1c 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 81, + "featureLevel": 89, "creator": "zap", "keyValuePairs": [ { @@ -83,7 +83,7 @@ "enabled": 0, "attributes": [ { - "name": "identify time", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", @@ -1133,10 +1133,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "client", "enabled": 0, "attributes": [ @@ -1159,10 +1159,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "server", "enabled": 1, "attributes": [ @@ -1657,7 +1657,7 @@ "enabled": 0, "commands": [ { - "name": "AnnounceOtaProvider", + "name": "AnnounceOTAProvider", "code": 0, "mfgCode": null, "source": "client", @@ -1693,7 +1693,7 @@ "enabled": 1, "attributes": [ { - "name": "DefaultOtaProviders", + "name": "DefaultOTAProviders", "code": 0, "mfgCode": null, "side": "server", @@ -2685,11 +2685,11 @@ "reportableChange": 0 }, { - "name": "BootReasons", + "name": "BootReason", "code": 4, "mfgCode": null, "side": "server", - "type": "enum8", + "type": "BootReasonEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -2985,7 +2985,7 @@ "enabled": 1, "attributes": [ { - "name": "channel", + "name": "Channel", "code": 0, "mfgCode": null, "side": "server", @@ -3097,7 +3097,7 @@ "reportableChange": 0 }, { - "name": "NeighborTableList", + "name": "NeighborTable", "code": 7, "mfgCode": null, "side": "server", @@ -3113,7 +3113,7 @@ "reportableChange": 0 }, { - "name": "RouteTableList", + "name": "RouteTable", "code": 8, "mfgCode": null, "side": "server", @@ -3145,7 +3145,7 @@ "reportableChange": 0 }, { - "name": "weighting", + "name": "Weighting", "code": 10, "mfgCode": null, "side": "server", @@ -4071,7 +4071,7 @@ "enabled": 1, "attributes": [ { - "name": "bssid", + "name": "BSSID", "code": 0, "mfgCode": null, "side": "server", @@ -4135,7 +4135,7 @@ "reportableChange": 0 }, { - "name": "Rssi", + "name": "RSSI", "code": 4, "mfgCode": null, "side": "server", @@ -4361,7 +4361,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "PHYRateType", + "type": "PHYRateEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -4585,7 +4585,7 @@ ] }, { - "name": "AdministratorCommissioning", + "name": "Administrator Commissioning", "code": 60, "mfgCode": null, "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", @@ -4637,7 +4637,7 @@ ] }, { - "name": "AdministratorCommissioning", + "name": "Administrator Commissioning", "code": 60, "mfgCode": null, "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", @@ -4649,7 +4649,7 @@ "code": 0, "mfgCode": null, "side": "server", - "type": "CommissioningWindowStatus", + "type": "CommissioningWindowStatusEnum", "included": 1, "storageOption": "External", "singleton": 0, @@ -5173,7 +5173,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -5239,7 +5239,7 @@ "enabled": 1, "attributes": [ { - "name": "label list", + "name": "LabelList", "code": 0, "mfgCode": null, "side": "server", @@ -5349,7 +5349,7 @@ "enabled": 1, "attributes": [ { - "name": "identify time", + "name": "IdentifyTime", "code": 0, "mfgCode": null, "side": "server", @@ -5365,7 +5365,7 @@ "reportableChange": 0 }, { - "name": "identify type", + "name": "IdentifyType", "code": 1, "mfgCode": null, "side": "server", @@ -6261,7 +6261,7 @@ "code": 15, "mfgCode": null, "side": "server", - "type": "bitmap8", + "type": "LevelControlOptions", "included": 1, "storageOption": "RAM", "singleton": 0, @@ -6583,10 +6583,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "client", "enabled": 0, "attributes": [ @@ -6609,10 +6609,10 @@ ] }, { - "name": "Basic", + "name": "Basic Information", "code": 40, "mfgCode": null, - "define": "BASIC_CLUSTER", + "define": "BASIC_INFORMATION_CLUSTER", "side": "server", "enabled": 0, "attributes": [ @@ -8091,7 +8091,7 @@ "enabled": 1, "attributes": [ { - "name": "occupancy", + "name": "Occupancy", "code": 0, "mfgCode": null, "side": "server", @@ -8107,7 +8107,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type", + "name": "OccupancySensorType", "code": 1, "mfgCode": null, "side": "server", @@ -8123,7 +8123,7 @@ "reportableChange": 0 }, { - "name": "occupancy sensor type bitmap", + "name": "OccupancySensorTypeBitmap", "code": 2, "mfgCode": null, "side": "server", diff --git a/scripts/tools/zap_convert_all.py b/scripts/tools/zap_convert_all.py index 222a5c7a23c713..677067c93dc123 100755 --- a/scripts/tools/zap_convert_all.py +++ b/scripts/tools/zap_convert_all.py @@ -78,7 +78,7 @@ def convertOne(target): """ Helper method that may be run in parallel to convert a single target. """ - subprocess.check_call(['./scripts/tools/zap/convert.py'] + target) + subprocess.check_call(['./scripts/tools/zap/convert.py'] + [target]) def main(): diff --git a/src/app/clusters/application-basic-server/application-basic-delegate.h b/src/app/clusters/application-basic-server/application-basic-delegate.h index 6c847a775f0cb7..82696b5b77a674 100644 --- a/src/app/clusters/application-basic-server/application-basic-delegate.h +++ b/src/app/clusters/application-basic-server/application-basic-delegate.h @@ -18,7 +18,6 @@ #pragma once -#include #include #include @@ -30,7 +29,7 @@ namespace app { namespace Clusters { namespace ApplicationBasic { -using ApplicationBasicApplicationType = chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type; +using ApplicationBasicApplicationType = chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type; class DLL_EXPORT CatalogVendorApp { @@ -81,7 +80,7 @@ class Delegate virtual CHIP_ERROR HandleGetAllowedVendorList(app::AttributeValueEncoder & aEncoder) = 0; inline void SetApplicationStatus(ApplicationStatusEnum status) { mApplicationStatus = status; } - bool Matches(ApplicationBasicApplication match); + bool Matches(const ApplicationBasicApplicationType & match); inline CatalogVendorApp * GetCatalogVendorApp() { return &mCatalogVendorApp; } virtual std::list GetAllowedVendorList() = 0; diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index b7e3820ab47287..e98a28c04dea6a 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -107,15 +107,15 @@ Delegate * GetDefaultDelegate(EndpointId endpoint) CHIP_ERROR Delegate::HandleGetApplication(app::AttributeValueEncoder & aEncoder) { ApplicationBasicApplicationType application; - application.catalogVendorId = mCatalogVendorApp.catalogVendorId; - application.applicationId = CharSpan(mCatalogVendorApp.applicationId, strlen(mCatalogVendorApp.applicationId)); + application.catalogVendorID = mCatalogVendorApp.catalogVendorId; + application.applicationID = CharSpan(mCatalogVendorApp.applicationId, strlen(mCatalogVendorApp.applicationId)); return aEncoder.Encode(application); } -bool Delegate::Matches(ApplicationBasicApplication match) +bool Delegate::Matches(const ApplicationBasicApplicationType & match) { - std::string appId(match.applicationId.data(), match.applicationId.size()); - CatalogVendorApp matchApp(match.catalogVendorId, appId.c_str()); + std::string appId(match.applicationID.data(), match.applicationID.size()); + CatalogVendorApp matchApp(match.catalogVendorID, appId.c_str()); return mCatalogVendorApp.Matches(&matchApp); } diff --git a/src/app/common/templates/legacy-struct-list.yaml b/src/app/common/templates/legacy-struct-list.yaml index 9ad0cfec369a94..a879485e168bdf 100644 --- a/src/app/common/templates/legacy-struct-list.yaml +++ b/src/app/common/templates/legacy-struct-list.yaml @@ -1,4 +1,3 @@ # List of structs for which we output a legacy definition in af-structs.h # Ideally this list should become empty. - CredentialStruct -- ApplicationBasicApplication diff --git a/src/app/tests/suites/TV_ApplicationBasicCluster.yaml b/src/app/tests/suites/TV_ApplicationBasicCluster.yaml index 4fd7f37f256ff5..1ddc54e9dcbf9d 100644 --- a/src/app/tests/suites/TV_ApplicationBasicCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationBasicCluster.yaml @@ -64,7 +64,7 @@ tests: command: "readAttribute" attribute: "Application" response: - value: { catalogVendorId: 123, applicationId: "applicationId" } + value: { CatalogVendorID: 123, ApplicationID: "applicationId" } # TODO(#14054): Support chars validation - label: "Read attribute application version" diff --git a/src/app/tests/suites/certification/Test_TC_APBSC_9_1.yaml b/src/app/tests/suites/certification/Test_TC_APBSC_9_1.yaml index d59fd14fbe73ce..badac9c7700c03 100644 --- a/src/app/tests/suites/certification/Test_TC_APBSC_9_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_APBSC_9_1.yaml @@ -73,7 +73,7 @@ tests: attribute: "Application" response: constraints: - type: ApplicationBasicApplication + type: ApplicationStruct - label: "Reads the Status attribute" PICS: APBSC.S.A0005 diff --git a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml index b9ef8a0b06a4bd..c8f9f218ed2ddb 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-basic-cluster.xml @@ -28,18 +28,19 @@ limitations under the License. VendorID ApplicationName ProductID - Application + Application Status ApplicationVersion AllowedVendorList - + diff --git a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml index 0577790159d904..41f08d8a1123c5 100644 --- a/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/application-launcher-cluster.xml @@ -60,6 +60,11 @@ limitations under the License. + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index aa8ac48901b021..a5ea74f9a50c3f 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6,6 +6,11 @@ struct LabelStruct { char_string<16> value = 1; } +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + client cluster Identify = 3 { enum IdentifyEffectIdentifier : ENUM8 { kBlink = 0; @@ -4016,11 +4021,6 @@ client cluster ApplicationLauncher = 1292 { optional endpoint_no endpoint = 1; } - struct ApplicationStruct { - int16u catalogVendorID = 0; - char_string applicationID = 1; - } - readonly attribute INT16U catalogList[] = 0; attribute nullable ApplicationEPStruct currentApp = 1; readonly attribute command_id generatedCommandList[] = 65528; @@ -4060,16 +4060,11 @@ client cluster ApplicationBasic = 1293 { kActiveVisibleNotFocus = 3; } - struct ApplicationBasicApplication { - int16u catalogVendorId = 0; - char_string applicationId = 1; - } - readonly attribute char_string<32> vendorName = 0; readonly attribute vendor_id vendorID = 1; readonly attribute char_string<32> applicationName = 2; readonly attribute int16u productID = 3; - readonly attribute ApplicationBasicApplication application = 4; + readonly attribute ApplicationStruct application = 4; readonly attribute ApplicationStatusEnum status = 5; readonly attribute char_string<32> applicationVersion = 6; readonly attribute vendor_id allowedVendorList[] = 7; diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index b183913a61f64b..45a873ac15cfa0 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -13635,7 +13635,7 @@ "reportableChange": 0 }, { - "name": "IntrinsicBalanceFactor", + "name": "IntrinsicBallastFactor", "code": 20, "mfgCode": null, "side": "server", @@ -17161,7 +17161,7 @@ "code": 4, "mfgCode": null, "side": "server", - "type": "ApplicationBasicApplication", + "type": "ApplicationStruct", "included": 1, "storageOption": "RAM", "singleton": 0, diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 5e811283489618..c5757a97b5cd30 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -16518,35 +16518,34 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - jobject value_catalogVendorId; - std::string value_catalogVendorIdClassName = "java/lang/Integer"; - std::string value_catalogVendorIdCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIdClassName.c_str(), - value_catalogVendorIdCtorSignature.c_str(), - cppValue.catalogVendorId, value_catalogVendorId); - jobject value_applicationId; - value_applicationId = - env->NewStringUTF(std::string(cppValue.applicationId.data(), cppValue.applicationId.size()).c_str()); - - jclass applicationBasicApplicationStructClass_0; + jobject value_catalogVendorID; + std::string value_catalogVendorIDClassName = "java/lang/Integer"; + std::string value_catalogVendorIDCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject(value_catalogVendorIDClassName.c_str(), + value_catalogVendorIDCtorSignature.c_str(), + cppValue.catalogVendorID, value_catalogVendorID); + jobject value_applicationID; + value_applicationID = + env->NewStringUTF(std::string(cppValue.applicationID.data(), cppValue.applicationID.size()).c_str()); + + jclass applicationStructStructClass_0; err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationBasicApplication", - applicationBasicApplicationStructClass_0); + env, "chip/devicecontroller/ChipStructs$ApplicationBasicClusterApplicationStruct", applicationStructStructClass_0); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationBasicApplication"); + ChipLogError(Zcl, "Could not find class ChipStructs$ApplicationBasicClusterApplicationStruct"); return nullptr; } - jmethodID applicationBasicApplicationStructCtor_0 = - env->GetMethodID(applicationBasicApplicationStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (applicationBasicApplicationStructCtor_0 == nullptr) + jmethodID applicationStructStructCtor_0 = + env->GetMethodID(applicationStructStructClass_0, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (applicationStructStructCtor_0 == nullptr) { - ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationBasicApplication constructor"); + ChipLogError(Zcl, "Could not find ChipStructs$ApplicationBasicClusterApplicationStruct constructor"); return nullptr; } - value = env->NewObject(applicationBasicApplicationStructClass_0, applicationBasicApplicationStructCtor_0, - value_catalogVendorId, value_applicationId); + value = env->NewObject(applicationStructStructClass_0, applicationStructStructCtor_0, value_catalogVendorID, + value_applicationID); return value; } case Attributes::Status::Id: { diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java index 8aced0eeec990d..c5ada81ecbf732 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipStructs.java @@ -1806,25 +1806,24 @@ public String toString() { } } - public static class ApplicationBasicClusterApplicationBasicApplication { - public Integer catalogVendorId; - public String applicationId; + public static class ApplicationBasicClusterApplicationStruct { + public Integer catalogVendorID; + public String applicationID; - public ApplicationBasicClusterApplicationBasicApplication( - Integer catalogVendorId, String applicationId) { - this.catalogVendorId = catalogVendorId; - this.applicationId = applicationId; + public ApplicationBasicClusterApplicationStruct(Integer catalogVendorID, String applicationID) { + this.catalogVendorID = catalogVendorID; + this.applicationID = applicationID; } @Override public String toString() { StringBuilder output = new StringBuilder(); - output.append("ApplicationBasicClusterApplicationBasicApplication {\n"); - output.append("\tcatalogVendorId: "); - output.append(catalogVendorId); + output.append("ApplicationBasicClusterApplicationStruct {\n"); + output.append("\tcatalogVendorID: "); + output.append(catalogVendorID); output.append("\n"); - output.append("\tapplicationId: "); - output.append(applicationId); + output.append("\tapplicationID: "); + output.append(applicationID); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2559e05ecdab26..43cd0c91eb995b 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -24950,7 +24950,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="vendorID", Tag=0x00000001, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="applicationName", Tag=0x00000002, Type=str), ClusterObjectFieldDescriptor(Label="productID", Tag=0x00000003, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="application", Tag=0x00000004, Type=ApplicationBasic.Structs.ApplicationBasicApplication), + ClusterObjectFieldDescriptor(Label="application", Tag=0x00000004, Type=ApplicationBasic.Structs.ApplicationStruct), ClusterObjectFieldDescriptor(Label="status", Tag=0x00000005, Type=ApplicationBasic.Enums.ApplicationStatusEnum), ClusterObjectFieldDescriptor(Label="applicationVersion", Tag=0x00000006, Type=str), ClusterObjectFieldDescriptor(Label="allowedVendorList", Tag=0x00000007, Type=typing.List[uint]), @@ -24965,7 +24965,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: vendorID: 'typing.Optional[uint]' = None applicationName: 'str' = None productID: 'typing.Optional[uint]' = None - application: 'ApplicationBasic.Structs.ApplicationBasicApplication' = None + application: 'ApplicationBasic.Structs.ApplicationStruct' = None status: 'ApplicationBasic.Enums.ApplicationStatusEnum' = None applicationVersion: 'str' = None allowedVendorList: 'typing.List[uint]' = None @@ -24991,17 +24991,17 @@ class ApplicationStatusEnum(MatterIntEnum): class Structs: @dataclass - class ApplicationBasicApplication(ClusterObject): + class ApplicationStruct(ClusterObject): @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields = [ - ClusterObjectFieldDescriptor(Label="catalogVendorId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationId", Tag=1, Type=str), + ClusterObjectFieldDescriptor(Label="catalogVendorID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="applicationID", Tag=1, Type=str), ]) - catalogVendorId: 'uint' = 0 - applicationId: 'str' = "" + catalogVendorID: 'uint' = 0 + applicationID: 'str' = "" @@ -25083,9 +25083,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=ApplicationBasic.Structs.ApplicationBasicApplication) + return ClusterObjectFieldDescriptor(Type=ApplicationBasic.Structs.ApplicationStruct) - value: 'ApplicationBasic.Structs.ApplicationBasicApplication' = field(default_factory=lambda: ApplicationBasic.Structs.ApplicationBasicApplication()) + value: 'ApplicationBasic.Structs.ApplicationStruct' = field(default_factory=lambda: ApplicationBasic.Structs.ApplicationStruct()) @dataclass class Status(ClusterAttributeDescriptor): diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 5752ce6ad5d190..cdbb55f85fd97a 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -5089,6 +5089,8 @@ ApplicationLauncher: - ApplicationStruct - ApplicationEPStruct + ApplicationBasic: + - ApplicationStruct struct fields: UnitTesting: SimpleStruct: @@ -5274,6 +5276,14 @@ ApplicationEPStruct: - application - endpoint + ApplicationBasic: + ApplicationStruct: + - catalogVendorID + - applicationID + # Values that are actually deprecated, but we effectively + # introduced them in this release. + - catalogVendorId + - applicationId events: OTASoftwareUpdateRequestor: - StateTransition @@ -5809,6 +5819,8 @@ ApplicationLauncher: - Application - ApplicationEP + ApplicationBasic: + - ApplicationBasicApplication struct fields: Descriptor: DeviceTypeStruct: @@ -5825,6 +5837,10 @@ ApplicationStruct: - catalogVendorId - applicationId + ApplicationBasic: + ApplicationStruct: + - catalogVendorId + - applicationId event fields: Switch: MultiPressComplete: @@ -6109,6 +6125,8 @@ ApplicationLauncher: ApplicationStruct: Application ApplicationEPStruct: ApplicationEP + ApplicationBasic: + ApplicationStruct: ApplicationBasicApplication struct fields: Descriptor: DeviceTypeStruct: @@ -6125,6 +6143,10 @@ ApplicationStruct: catalogVendorID: catalogVendorId applicationID: applicationId + ApplicationBasic: + ApplicationStruct: + catalogVendorID: catalogVendorId + applicationID: applicationId event fields: Switch: MultiPressComplete: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 095d73fa19c2c4..f73a5ae049cba8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -14294,11 +14294,11 @@ id MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & if (*aError != CHIP_NO_ERROR) { return nil; } - MTRApplicationBasicClusterApplicationBasicApplication * _Nonnull value; - value = [MTRApplicationBasicClusterApplicationBasicApplication new]; - value.catalogVendorId = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorId]; - value.applicationId = [[NSString alloc] initWithBytes:cppValue.applicationId.data() - length:cppValue.applicationId.size() + MTRApplicationBasicClusterApplicationStruct * _Nonnull value; + value = [MTRApplicationBasicClusterApplicationStruct new]; + value.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorID]; + value.applicationID = [[NSString alloc] initWithBytes:cppValue.applicationID.data() + length:cppValue.applicationID.size() encoding:NSUTF8StringEncoding]; return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 6cfe17c47d1795..1318ae27d76b17 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -13381,18 +13381,17 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; -- (void)readAttributeApplicationWithCompletion:(void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, +- (void)readAttributeApplicationWithCompletion:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)subscribeAttributeApplicationWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, + reportHandler:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_NEWLY_AVAILABLE; + (void)readAttributeApplicationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue - completion: - (void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, - NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; + completion:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, + NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; - (void)readAttributeStatusWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_NEWLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 5e02ba9e64f6b0..4f3e7c997a6012 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -91397,33 +91397,32 @@ + (void)readAttributeProductIDWithClusterStateCache:(MTRClusterStateCacheContain }); } -- (void)readAttributeApplicationWithCompletion:(void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, +- (void)readAttributeApplicationWithCompletion:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error))completion { MTRReadParams * params = [[MTRReadParams alloc] init]; using TypeInfo = ApplicationBasic::Attributes::Application::TypeInfo; return MTRReadAttribute( + MTRApplicationBasicClusterApplicationStruct, TypeInfo::DecodableType>( params, completion, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } - (void)subscribeAttributeApplicationWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, + reportHandler:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error))reportHandler { using TypeInfo = ApplicationBasic::Attributes::Application::TypeInfo; MTRSubscribeAttribute(params, subscriptionEstablished, - reportHandler, self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); + MTRApplicationBasicClusterApplicationStruct, TypeInfo::DecodableType>(params, subscriptionEstablished, reportHandler, + self.callbackQueue, self.device, self->_endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); } + (void)readAttributeApplicationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue - completion: - (void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, - NSError * _Nullable error))completion + completion:(void (^)(MTRApplicationBasicClusterApplicationStruct * _Nullable value, + NSError * _Nullable error))completion { auto * bridge = new MTRApplicationBasicApplicationStructAttributeCallbackBridge(queue, completion); std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, @@ -91976,7 +91975,7 @@ - (void)readAttributeApplicationWithCompletionHandler: (void (^)(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error))completionHandler { [self readAttributeApplicationWithCompletion:^( - MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error) { + MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. completionHandler(static_cast(value), error); }]; @@ -91998,8 +91997,8 @@ - (void)subscribeAttributeApplicationWithMinInterval:(NSNumber * _Nonnull)minInt } [self subscribeAttributeApplicationWithParams:subscribeParams subscriptionEstablished:subscriptionEstablishedHandler - reportHandler:^(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, - NSError * _Nullable error) { + reportHandler:^( + MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. reportHandler( static_cast(value), error); @@ -92015,7 +92014,7 @@ + (void)readAttributeApplicationWithAttributeCache:(MTRAttributeCacheContainer * [self readAttributeApplicationWithClusterStateCache:attributeCacheContainer.realContainer endpoint:endpoint queue:queue - completion:^(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, + completion:^(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { // Cast is safe because subclass does not add any selectors. completionHandler( diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 936886fb99dff3..a42ab726be8bcd 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -1054,7 +1054,7 @@ typedef void (*ApplicationLauncherAcceptedCommandListListAttributeCallback)( typedef void (*ApplicationLauncherAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ApplicationBasicApplicationStructAttributeCallback)( - void *, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType &); + void *, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType &); typedef void (*ApplicationBasicAllowedVendorListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ApplicationBasicGeneratedCommandListListAttributeCallback)( @@ -9889,9 +9889,8 @@ class MTRApplicationBasicApplicationStructAttributeCallbackBridge MTRActionBlock action) : MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; - static void - OnSuccessFn(void * context, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value); + static void OnSuccessFn(void * context, + const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value); }; class MTRApplicationBasicApplicationStructAttributeCallbackSubscriptionBridge diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 9e524f6b19655f..e0ad62db1c9967 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -10010,13 +10010,13 @@ } void MTRApplicationBasicApplicationStructAttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) + void * context, const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType & value) { - MTRApplicationBasicClusterApplicationBasicApplication * _Nonnull objCValue; - objCValue = [MTRApplicationBasicClusterApplicationBasicApplication new]; - objCValue.catalogVendorId = [NSNumber numberWithUnsignedShort:value.catalogVendorId]; - objCValue.applicationId = [[NSString alloc] initWithBytes:value.applicationId.data() - length:value.applicationId.size() + MTRApplicationBasicClusterApplicationStruct * _Nonnull objCValue; + objCValue = [MTRApplicationBasicClusterApplicationStruct new]; + objCValue.catalogVendorID = [NSNumber numberWithUnsignedShort:value.catalogVendorID]; + objCValue.applicationID = [[NSString alloc] initWithBytes:value.applicationID.data() + length:value.applicationID.size() encoding:NSUTF8StringEncoding]; DispatchSuccess(context, objCValue); }; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 50b52a10d9efc5..ded81da62c0444 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -937,10 +937,17 @@ MTR_NEWLY_DEPRECATED("Please use MTRApplicationLauncherClusterApplicationEPStruc @interface MTRApplicationLauncherClusterApplicationEP : MTRApplicationLauncherClusterApplicationEPStruct @end +MTR_NEWLY_AVAILABLE +@interface MTRApplicationBasicClusterApplicationStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull applicationID MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull applicationId MTR_NEWLY_AVAILABLE; +@end + API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) -@interface MTRApplicationBasicClusterApplicationBasicApplication : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull catalogVendorId API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -@property (nonatomic, copy) NSString * _Nonnull applicationId API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +MTR_NEWLY_DEPRECATED("Please use MTRApplicationBasicClusterApplicationStruct") +@interface MTRApplicationBasicClusterApplicationBasicApplication : MTRApplicationBasicClusterApplicationStruct @end MTR_NEWLY_AVAILABLE diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 2ed5f682094daf..21c96d9e460ed1 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -3784,35 +3784,58 @@ - (NSString *)description @implementation MTRApplicationLauncherClusterApplicationEP : MTRApplicationLauncherClusterApplicationEPStruct @end -@implementation MTRApplicationBasicClusterApplicationBasicApplication +@implementation MTRApplicationBasicClusterApplicationStruct - (instancetype)init { if (self = [super init]) { - _catalogVendorId = @(0); + _catalogVendorID = @(0); - _applicationId = @""; + _applicationID = @""; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone { - auto other = [[MTRApplicationBasicClusterApplicationBasicApplication alloc] init]; + auto other = [[MTRApplicationBasicClusterApplicationStruct alloc] init]; - other.catalogVendorId = self.catalogVendorId; - other.applicationId = self.applicationId; + other.catalogVendorID = self.catalogVendorID; + other.applicationID = self.applicationID; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: catalogVendorId:%@; applicationId:%@; >", - NSStringFromClass([self class]), _catalogVendorId, _applicationId]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: catalogVendorID:%@; applicationID:%@; >", + NSStringFromClass([self class]), _catalogVendorID, _applicationID]; return descriptionString; } +- (void)setCatalogVendorId:(NSNumber * _Nonnull)catalogVendorId +{ + self.catalogVendorID = catalogVendorId; +} + +- (NSNumber * _Nonnull)catalogVendorId +{ + return self.catalogVendorID; +} + +- (void)setApplicationId:(NSString * _Nonnull)applicationId +{ + self.applicationID = applicationId; +} + +- (NSString * _Nonnull)applicationId +{ + return self.applicationID; +} + +@end + +@implementation MTRApplicationBasicClusterApplicationBasicApplication : MTRApplicationBasicClusterApplicationStruct @end @implementation MTRUnitTestingClusterSimpleStruct diff --git a/zzz_generated/app-common/app-common/zap-generated/af-structs.h b/zzz_generated/app-common/app-common/zap-generated/af-structs.h index 5bc0a86b450639..013c0a0246a95b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/af-structs.h +++ b/zzz_generated/app-common/app-common/zap-generated/af-structs.h @@ -30,13 +30,6 @@ #include "enums.h" -// Struct for ApplicationBasicApplication -typedef struct _ApplicationBasicApplication -{ - uint16_t catalogVendorId; - chip::CharSpan applicationId; -} ApplicationBasicApplication; - // Struct for CredentialStruct typedef struct _CredentialStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index afe1586d8a736e..8ce0b83858e360 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -26,6 +26,50 @@ namespace Clusters { namespace detail { // Structs shared across multiple clusters. namespace Structs { +namespace ApplicationStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorID)), catalogVendorID)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationID)), applicationID)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + err = reader.EnterContainer(outer); + ReturnErrorOnFailure(err); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kCatalogVendorID): + ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorID)); + break; + case to_underlying(Fields::kApplicationID): + ReturnErrorOnFailure(DataModel::Decode(reader, applicationID)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + + return CHIP_NO_ERROR; +} + +} // namespace ApplicationStruct namespace LabelStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -17407,50 +17451,6 @@ namespace Events {} // namespace Events } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace ApplicationStruct { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorID)), catalogVendorID)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationID)), applicationID)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kCatalogVendorID): - ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorID)); - break; - case to_underlying(Fields::kApplicationID): - ReturnErrorOnFailure(DataModel::Decode(reader, applicationID)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - - return CHIP_NO_ERROR; -} - -} // namespace ApplicationStruct namespace ApplicationEPStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const { @@ -17694,52 +17694,7 @@ namespace Events {} // namespace Events } // namespace ApplicationLauncher namespace ApplicationBasic { -namespace Structs { -namespace ApplicationBasicApplication { -CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const -{ - TLV::TLVType outer; - ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kCatalogVendorId)), catalogVendorId)); - ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(to_underlying(Fields::kApplicationId)), applicationId)); - ReturnErrorOnFailure(writer.EndContainer(outer)); - return CHIP_NO_ERROR; -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - TLV::TLVType outer; - VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); - err = reader.EnterContainer(outer); - ReturnErrorOnFailure(err); - while ((err = reader.Next()) == CHIP_NO_ERROR) - { - if (!TLV::IsContextTag(reader.GetTag())) - { - continue; - } - switch (TLV::TagNumFromTag(reader.GetTag())) - { - case to_underlying(Fields::kCatalogVendorId): - ReturnErrorOnFailure(DataModel::Decode(reader, catalogVendorId)); - break; - case to_underlying(Fields::kApplicationId): - ReturnErrorOnFailure(DataModel::Decode(reader, applicationId)); - break; - default: - break; - } - } - - VerifyOrReturnError(err == CHIP_END_OF_TLV, err); - ReturnErrorOnFailure(reader.ExitContainer(outer)); - - return CHIP_NO_ERROR; -} - -} // namespace ApplicationBasicApplication -} // namespace Structs +namespace Structs {} // namespace Structs namespace Commands {} // namespace Commands diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2117cbbbf24fbe..ee11788b87948d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -43,6 +43,29 @@ namespace Clusters { namespace detail { // Structs shared across multiple clusters. namespace Structs { +namespace ApplicationStruct { +enum class Fields +{ + kCatalogVendorID = 0, + kApplicationID = 1, +}; + +struct Type +{ +public: + uint16_t catalogVendorID = static_cast(0); + chip::CharSpan applicationID; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace ApplicationStruct namespace LabelStruct { enum class Fields { @@ -22706,29 +22729,7 @@ struct TypeInfo } // namespace AudioOutput namespace ApplicationLauncher { namespace Structs { -namespace ApplicationStruct { -enum class Fields -{ - kCatalogVendorID = 0, - kApplicationID = 1, -}; - -struct Type -{ -public: - uint16_t catalogVendorID = static_cast(0); - chip::CharSpan applicationID; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace ApplicationStruct +namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct; namespace ApplicationEPStruct { enum class Fields { @@ -22996,29 +22997,7 @@ struct TypeInfo } // namespace ApplicationLauncher namespace ApplicationBasic { namespace Structs { -namespace ApplicationBasicApplication { -enum class Fields -{ - kCatalogVendorId = 0, - kApplicationId = 1, -}; - -struct Type -{ -public: - uint16_t catalogVendorId = static_cast(0); - chip::CharSpan applicationId; - - CHIP_ERROR Decode(TLV::TLVReader & reader); - - static constexpr bool kIsFabricScoped = false; - - CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; -}; - -using DecodableType = Type; - -} // namespace ApplicationBasicApplication +namespace ApplicationStruct = Clusters::detail::Structs::ApplicationStruct; } // namespace Structs namespace Attributes { @@ -23076,9 +23055,9 @@ struct TypeInfo namespace Application { struct TypeInfo { - using Type = chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type; - using DecodableType = chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType; - using DecodableArgType = const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType &; + using Type = chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::Type; + using DecodableType = chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType; + using DecodableArgType = const chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType &; static constexpr ClusterId GetClusterId() { return Clusters::ApplicationBasic::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Application::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 84ca3fdd6c8c4e..571f7c0ec3f1da 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -160,32 +160,6 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentLauncher::Struc ComplexArgumentParser::Finalize(request.name); ComplexArgumentParser::Finalize(request.value); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request, - Json::Value & value) -{ - VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); - - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationBasicApplication.catalogVendorId", "catalogVendorId", - value.isMember("catalogVendorId"))); - ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ApplicationBasicApplication.applicationId", "applicationId", - value.isMember("applicationId"))); - - char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "catalogVendorId"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.catalogVendorId, value["catalogVendorId"])); - - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "applicationId"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.applicationId, value["applicationId"])); - - return CHIP_NO_ERROR; -} - -void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request) -{ - ComplexArgumentParser::Finalize(request.catalogVendorId); - ComplexArgumentParser::Finalize(request.applicationId); -} CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, Json::Value & value) @@ -213,8 +187,7 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::S ComplexArgumentParser::Finalize(request.application); ComplexArgumentParser::Finalize(request.endpoint); } -CHIP_ERROR ComplexArgumentParser::Setup(const char * label, - chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request, Json::Value & value) { VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); @@ -234,7 +207,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, return CHIP_NO_ERROR; } -void ComplexArgumentParser::Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request) +void ComplexArgumentParser::Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request) { ComplexArgumentParser::Finalize(request.catalogVendorID); ComplexArgumentParser::Finalize(request.applicationID); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index fa38afafbced6f..f901a9c4186368 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -39,19 +39,14 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentLauncher Json::Value & value); static void Finalize(chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::Type & request); -static CHIP_ERROR Setup(const char * label, - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request, - Json::Value & value); - -static void Finalize(chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request, Json::Value & value); static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::Type & request); -static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request, +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request, Json::Value & value); -static void Finalize(chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::Type & request); +static void Finalize(chip::app::Clusters::detail::Structs::ApplicationStruct::Type & request); static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Scenes::Structs::AttributeValuePair::Type & request, Json::Value & value); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 2c26495971e1fe..fd7004071e454e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -177,31 +177,6 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - { - CHIP_ERROR err = LogValue("CatalogVendorId", indent + 1, value.catalogVendorId); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'CatalogVendorId'"); - return err; - } - } - { - CHIP_ERROR err = LogValue("ApplicationId", indent + 1, value.applicationId); - if (err != CHIP_NO_ERROR) - { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ApplicationId'"); - return err; - } - } - DataModelLogger::LogString(indent, "}"); - - return CHIP_NO_ERROR; -} -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value) { @@ -226,9 +201,8 @@ DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value) +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value) { DataModelLogger::LogString(label, indent, "{"); { @@ -8938,7 +8912,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("ProductID", 1, value); } case ApplicationBasic::Attributes::Application::Id: { - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType value; + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Application", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index fe650c8154a921..c57766c79a2227 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -28,13 +28,10 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Actions::Structs::ActionStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentLauncher::Structs::AdditionalInfoStruct::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationEPStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, - const chip::app::Clusters::ApplicationLauncher::Structs::ApplicationStruct::DecodableType & value); + const chip::app::Clusters::detail::Structs::ApplicationStruct::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Scenes::Structs::AttributeValuePair::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 0c2ea2750e50f7..19bfd3944e968b 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -34781,9 +34781,9 @@ class Test_TC_APBSC_9_1Suite : public TestCommand case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType value; + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckConstraintType("value", "ApplicationBasicApplication", "ApplicationBasicApplication")); + VerifyOrReturn(CheckConstraintType("value", "ApplicationStruct", "ApplicationStruct")); } break; case 6: @@ -55006,11 +55006,11 @@ class TV_ApplicationBasicClusterSuite : public TestCommand case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::Clusters::ApplicationBasic::Structs::ApplicationBasicApplication::DecodableType value; + chip::app::Clusters::ApplicationBasic::Structs::ApplicationStruct::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); - VerifyOrReturn(CheckValue("application.catalogVendorId", value.catalogVendorId, 123U)); + VerifyOrReturn(CheckValue("application.catalogVendorID", value.catalogVendorID, 123U)); VerifyOrReturn( - CheckValueAsString("application.applicationId", value.applicationId, chip::CharSpan("applicationId", 13))); + CheckValueAsString("application.applicationID", value.applicationID, chip::CharSpan("applicationId", 13))); } break; case 7: 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 df076cdad399d6..809f1bda6d0e4b 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -75052,7 +75052,7 @@ class ReadApplicationBasicApplication : public ReadAttribute { endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeApplicationWithCompletion:^( - MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error) { + MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); if (error != nil) { LogNSError("ApplicationBasic Application read Error", error); @@ -75093,7 +75093,7 @@ class SubscribeAttributeApplicationBasicApplication : public SubscribeAttribute subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable error) { + reportHandler:^(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); SetCommandExitStatus(error); }]; 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 d3dedf286e8655..c1da84a01f8349 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -46584,12 +46584,12 @@ class Test_TC_APBSC_9_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeApplicationWithCompletion:^( - MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { + MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable err) { NSLog(@"Reads the Application attribute Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - VerifyOrReturn(CheckConstraintType("application", "ApplicationBasicApplication", "ApplicationBasicApplication")); + VerifyOrReturn(CheckConstraintType("application", "ApplicationStruct", "ApplicationStruct")); NextTest(); }]; @@ -74437,17 +74437,17 @@ class TV_ApplicationBasicCluster : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeApplicationWithCompletion:^( - MTRApplicationBasicClusterApplicationBasicApplication * _Nullable value, NSError * _Nullable err) { + MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable err) { NSLog(@"Read attribute application status Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { id actualValue = value; - VerifyOrReturn(CheckValue("catalogVendorId", - ((MTRApplicationBasicClusterApplicationBasicApplication *) actualValue).catalogVendorId, 123U)); - VerifyOrReturn(CheckValueAsString("applicationId", - ((MTRApplicationBasicClusterApplicationBasicApplication *) actualValue).applicationId, @"applicationId")); + VerifyOrReturn(CheckValue( + "CatalogVendorID", ((MTRApplicationBasicClusterApplicationStruct *) actualValue).catalogVendorID, 123U)); + VerifyOrReturn(CheckValueAsString("ApplicationID", + ((MTRApplicationBasicClusterApplicationStruct *) actualValue).applicationID, @"applicationId")); } NextTest(); From f069a917f8ecf72d3c7a4afaa7bfef156f4df13b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 24 Jan 2023 16:04:20 +0100 Subject: [PATCH 07/10] [matter_yamltests] Add wait keyword supports (#24592) --- .../matter_yamltests/parser.py | 73 +++++++++++++++++-- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index 0a4bc23e104766..9e870019241eea 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -14,7 +14,7 @@ # limitations under the License. import copy -from enum import Enum +from enum import Enum, auto import yaml @@ -50,6 +50,7 @@ 'maxInterval', 'timedInteractionTimeoutMs', 'busyWaitMs', + 'wait', ] _TEST_ARGUMENTS_SECTION = [ @@ -91,11 +92,12 @@ class PostProcessCheckStatus(Enum): class PostProcessCheckType(Enum): '''Indicates the post processing check step type.''' - IM_STATUS = 'IMStatus', - CLUSTER_STATUS = 'ClusterStatus', - RESPONSE_VALIDATION = 'Response', - CONSTRAINT_VALIDATION = 'Constraints', - SAVE_AS_VARIABLE = 'SaveAs' + IM_STATUS = auto() + CLUSTER_STATUS = auto() + RESPONSE_VALIDATION = auto() + CONSTRAINT_VALIDATION = auto() + SAVE_AS_VARIABLE = auto() + WAIT_VALIDATION = auto() class PostProcessCheck: @@ -213,9 +215,10 @@ def __init__(self, test: dict, config: dict, definitions: SpecDefinitions, pics_ self.timed_interaction_timeout_ms = _value_or_none( test, 'timedInteractionTimeoutMs') self.busy_wait_ms = _value_or_none(test, 'busyWaitMs') + self.wait_for = _value_or_none(test, 'wait') - self.is_attribute = self.command in _ATTRIBUTE_COMMANDS - self.is_event = self.command in _EVENT_COMMANDS + self.is_attribute = self.command in _ATTRIBUTE_COMMANDS or self.wait_for in _ATTRIBUTE_COMMANDS + self.is_event = self.command in _EVENT_COMMANDS or self.wait_for in _EVENT_COMMANDS self.arguments_with_placeholders = _value_or_none(test, 'arguments') self.response_with_placeholders = _value_or_none(test, 'response') @@ -472,9 +475,17 @@ def timed_interaction_timeout_ms(self): def busy_wait_ms(self): return self._test.busy_wait_ms + @property + def wait_for(self): + return self._test.wait_for + def post_process_response(self, response: dict): result = PostProcessResponseResult() + if self.wait_for is not None: + self._response_cluster_wait_validation(response, result) + return result + if self._skip_post_processing(response, result): return result @@ -487,6 +498,52 @@ def post_process_response(self, response: dict): return result + def _response_cluster_wait_validation(self, response, result): + """Check if the response concrete path matches the configuration of the test step + and validate that the response type (e.g readAttribute/writeAttribute/...) matches + the expectation from the test step.""" + check_type = PostProcessCheckType.WAIT_VALIDATION + error_success = 'The test expectation "{wait_for}" for "{cluster}.{wait_type}" on endpoint {endpoint} is true' + error_failure = 'The test expectation "{expected} == {received}" is false' + + if self.is_attribute: + expected_wait_type = self.attribute + received_wait_type = response.get('attribute') + elif self.is_event: + expected_wait_type = self.event + received_wait_type = response.get('event') + else: + expected_wait_type = self.command + received_wait_type = response.get('command') + + expected_values = [ + self.wait_for, + self.endpoint, + # TODO The name in tests does not always use spaces + self.cluster.replace(' ', ''), + expected_wait_type + ] + + received_values = [ + response.get('wait_for'), + response.get('endpoint'), + response.get('cluster'), + received_wait_type + ] + + success = True + for expected_value in expected_values: + received_value = received_values.pop(0) + + if expected_value != received_value: + result.error(check_type, error_failure.format( + expected=expected_value, received=received_value)) + success = False + + if success: + result.success(check_type, error_success.format( + wait_for=self.wait_for, cluster=self.cluster, wait_type=expected_wait_type, endpoint=self.endpoint)) + def _skip_post_processing(self, response: dict, result) -> bool: '''Should we skip perform post processing. From 7eda58b81e822a0120e5b31c8ef3733deb0c7425 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 24 Jan 2023 20:34:38 +0530 Subject: [PATCH 08/10] [ESP32] Remove the zzz_generated app specific directories not containing (#24615) source files from CMakeLists.txt --- examples/all-clusters-app/esp32/main/CMakeLists.txt | 1 - examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt | 1 - examples/bridge-app/esp32/main/CMakeLists.txt | 1 - examples/light-switch-app/esp32/main/CMakeLists.txt | 1 - examples/lighting-app/esp32/main/CMakeLists.txt | 1 - examples/lock-app/esp32/main/CMakeLists.txt | 2 -- examples/ota-provider-app/esp32/main/CMakeLists.txt | 1 - examples/ota-requestor-app/esp32/main/CMakeLists.txt | 1 - examples/temperature-measurement-app/esp32/main/CMakeLists.txt | 1 - 9 files changed, 10 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index cb096a8c1e3262..e642a04553d7c0 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -26,7 +26,6 @@ set(PRIV_INCLUDE_DIRS_LIST ) set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index 4994beed15155e..b6528fb48e36e5 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -26,7 +26,6 @@ set(PRIV_INCLUDE_DIRS_LIST ) set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/all-clusters-minimal-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" diff --git a/examples/bridge-app/esp32/main/CMakeLists.txt b/examples/bridge-app/esp32/main/CMakeLists.txt index 62b57d8d3fb2e7..407037a0066d5c 100644 --- a/examples/bridge-app/esp32/main/CMakeLists.txt +++ b/examples/bridge-app/esp32/main/CMakeLists.txt @@ -20,7 +20,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" SRC_DIRS "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/bridge-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" diff --git a/examples/light-switch-app/esp32/main/CMakeLists.txt b/examples/light-switch-app/esp32/main/CMakeLists.txt index 9fecd318807163..8a5bd77d21c740 100644 --- a/examples/light-switch-app/esp32/main/CMakeLists.txt +++ b/examples/light-switch-app/esp32/main/CMakeLists.txt @@ -25,7 +25,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/light-switch-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" diff --git a/examples/lighting-app/esp32/main/CMakeLists.txt b/examples/lighting-app/esp32/main/CMakeLists.txt index c1f1e30767e455..e7ea6b0498bce4 100644 --- a/examples/lighting-app/esp32/main/CMakeLists.txt +++ b/examples/lighting-app/esp32/main/CMakeLists.txt @@ -28,7 +28,6 @@ set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lighting-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/lighting-app/lighting-common/src" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" diff --git a/examples/lock-app/esp32/main/CMakeLists.txt b/examples/lock-app/esp32/main/CMakeLists.txt index 8947b92a95c617..e15ee62a79f53b 100644 --- a/examples/lock-app/esp32/main/CMakeLists.txt +++ b/examples/lock-app/esp32/main/CMakeLists.txt @@ -41,7 +41,6 @@ idf_component_register(INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" @@ -152,7 +151,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/lock-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" diff --git a/examples/ota-provider-app/esp32/main/CMakeLists.txt b/examples/ota-provider-app/esp32/main/CMakeLists.txt index 8c58d0b4b4fc18..7bbf39d18ab0e3 100644 --- a/examples/ota-provider-app/esp32/main/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/main/CMakeLists.txt @@ -23,7 +23,6 @@ idf_component_register(PRIV_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" SRC_DIRS "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-provider-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" diff --git a/examples/ota-requestor-app/esp32/main/CMakeLists.txt b/examples/ota-requestor-app/esp32/main/CMakeLists.txt index cdd50a0b220c1b..f2320f4c3785f4 100644 --- a/examples/ota-requestor-app/esp32/main/CMakeLists.txt +++ b/examples/ota-requestor-app/esp32/main/CMakeLists.txt @@ -28,7 +28,6 @@ set(PRIV_INCLUDE_DIRS_LIST set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/ota-requestor-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" diff --git a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt index 43f968137df88f..526c2825e462e9 100644 --- a/examples/temperature-measurement-app/esp32/main/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/main/CMakeLists.txt @@ -26,7 +26,6 @@ set(PRIV_INCLUDE_DIRS_LIST ) set(SRC_DIRS_LIST "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/temperature-measurement-app/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" From 57cd02e9a2a5e4a525781243c2f6ff6211588281 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 24 Jan 2023 17:05:37 +0100 Subject: [PATCH 09/10] [HotFix/Android] data is an optional now. (#24618) --- .../ApplicationLauncherManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp index b1ef1d11c36a2c..cfc840ce1c83d3 100644 --- a/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp +++ b/examples/tv-app/android/include/application-launcher/ApplicationLauncherManager.cpp @@ -44,8 +44,8 @@ void ApplicationLauncherManager::HandleLaunchApp(CommandResponseHelper Date: Tue, 24 Jan 2023 17:14:10 +0100 Subject: [PATCH 10/10] Typos various tests with yaml tests parser attempt3 (#24599) * [matter_yamltests] Make definitions.py more strict about casing * Fix various typos in src/app/tests/suites/ yaml tests (#3 attempt) --- .../matter_yamltests/definitions.py | 41 +++++++++++----- .../test_spec_definitions.py | 38 +++++++-------- .../tests/suites/TV_AccountLoginCluster.yaml | 6 +-- .../suites/TV_ApplicationLauncherCluster.yaml | 6 +-- .../tests/suites/TV_AudioOutputCluster.yaml | 4 +- src/app/tests/suites/TV_ChannelCluster.yaml | 6 +-- .../suites/TV_ContentLauncherCluster.yaml | 4 +- .../tests/suites/TV_KeypadInputCluster.yaml | 2 +- src/app/tests/suites/TV_LowPowerCluster.yaml | 2 +- .../tests/suites/TV_MediaInputCluster.yaml | 8 ++-- .../tests/suites/TV_MediaPlaybackCluster.yaml | 20 ++++---- .../suites/TV_TargetNavigatorCluster.yaml | 2 +- .../tests/suites/TestBasicInformation.yaml | 8 ++-- src/app/tests/suites/TestBinding.yaml | 16 +++---- src/app/tests/suites/TestCluster.yaml | 48 +++++++++---------- .../tests/suites/TestClusterComplexTypes.yaml | 12 ++--- src/app/tests/suites/TestConfigVariables.yaml | 4 +- .../suites/TestGroupKeyManagementCluster.yaml | 4 +- src/app/tests/suites/TestGroupMessaging.yaml | 20 ++++---- src/app/tests/suites/TestIdentifyCluster.yaml | 2 +- .../tests/suites/TestModeSelectCluster.yaml | 14 +++--- src/app/tests/suites/TestSaveAs.yaml | 6 +-- .../suites/certification/Test_TC_CC_4_2.yaml | 2 +- .../certification/Test_TC_DGTHREAD_2_1.yaml | 4 +- 24 files changed, 149 insertions(+), 130 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/definitions.py b/scripts/py_matter_yamltests/matter_yamltests/definitions.py index 98599072f3c9a2..750fd676aa1a50 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/definitions.py +++ b/scripts/py_matter_yamltests/matter_yamltests/definitions.py @@ -64,25 +64,24 @@ def __init__(self, sources: List[ParseSource]): self.__clusters_by_name[name] = cluster.code self.__commands_by_name[name] = { - c.name.lower(): c.code for c in cluster.commands} + c.name: c.code for c in cluster.commands} self.__responses_by_name[name] = {} self.__attributes_by_name[name] = { - a.definition.name.lower(): a.definition.code for a in cluster.attributes} + a.definition.name: a.definition.code for a in cluster.attributes} self.__events_by_name[name] = { - e.name.lower(): e.code for e in cluster.events} + e.name: e.code for e in cluster.events} self.__bitmaps_by_name[name] = { - b.name.lower(): b for b in cluster.bitmaps} + b.name: b for b in cluster.bitmaps} self.__enums_by_name[name] = { - e.name.lower(): e for e in cluster.enums} + e.name: e for e in cluster.enums} self.__structs_by_name[name] = { - s.name.lower(): s for s in cluster.structs} + s.name: s for s in cluster.structs} for struct in cluster.structs: if struct.tag == StructTag.RESPONSE: self.__responses_by_id[code][struct.code] = struct - self.__responses_by_name[name][struct.name.lower( - )] = struct.code + self.__responses_by_name[name][struct.name] = struct.code def get_cluster_name(self, cluster_id: int) -> str: cluster = self.__clusters_by_id.get(cluster_id) @@ -153,9 +152,6 @@ def __get_by_name(self, cluster_name: str, target_name: str, target_type: _ItemT # The idl parser remove spaces cluster_name = cluster_name.replace(' ', '') - # Many YAML tests formats the name using camelCase despites that the spec mandates - # CamelCase. To be compatible with the current tests, everything is converted to lower case. - target_name = target_name.lower() cluster_id = self.__clusters_by_name.get(cluster_name) if cluster_id is None: @@ -164,26 +160,40 @@ def __get_by_name(self, cluster_name: str, target_name: str, target_type: _ItemT target = None if target_type == _ItemType.Request: + self.__enforce_casing( + target_name, self.__commands_by_name.get(cluster_name)) target_id = self.__commands_by_name.get( cluster_name).get(target_name) target = self.__get_by_id(cluster_id, target_id, target_type) elif target_type == _ItemType.Response: + self.__enforce_casing( + target_name, self.__responses_by_name.get(cluster_name)) target_id = self.__responses_by_name.get( cluster_name).get(target_name) target = self.__get_by_id(cluster_id, target_id, target_type) elif target_type == _ItemType.Event: + self.__enforce_casing( + target_name, self.__events_by_name.get(cluster_name)) target_id = self.__events_by_name.get( cluster_name).get(target_name) target = self.__get_by_id(cluster_id, target_id, target_type) elif target_type == _ItemType.Attribute: + self.__enforce_casing( + target_name, self.__attributes_by_name.get(cluster_name)) target_id = self.__attributes_by_name.get( cluster_name).get(target_name) target = self.__get_by_id(cluster_id, target_id, target_type) elif target_type == _ItemType.Bitmap: + self.__enforce_casing( + target_name, self.__bitmaps_by_name.get(cluster_name)) target = self.__bitmaps_by_name.get(cluster_name).get(target_name) elif target_type == _ItemType.Enum: + self.__enforce_casing( + target_name, self.__enums_by_name.get(cluster_name)) target = self.__enums_by_name.get(cluster_name).get(target_name) elif target_type == _ItemType.Struct: + self.__enforce_casing( + target_name, self.__structs_by_name.get(cluster_name)) target = self.__structs_by_name.get(cluster_name).get(target_name) return target @@ -204,3 +214,12 @@ def __get_by_id(self, cluster_id: int, target_id: int, target_type: str): return None return targets.get(target_id) + + def __enforce_casing(self, target_name: str, targets: list): + if targets.get(target_name) is not None: + return + + for name in targets: + if name.lower() == target_name.lower(): + raise KeyError( + f'Unknown target {target_name}. Did you mean {name} ?') diff --git a/scripts/py_matter_yamltests/test_spec_definitions.py b/scripts/py_matter_yamltests/test_spec_definitions.py index 35a2dcd29f911a..9065a5c0a182cd 100644 --- a/scripts/py_matter_yamltests/test_spec_definitions.py +++ b/scripts/py_matter_yamltests/test_spec_definitions.py @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from matter_yamltests.definitions import * - -import unittest import io +import unittest + +from matter_yamltests.definitions import * source_cluster = ''' @@ -215,8 +215,8 @@ def test_get_command_by_name(self): 'Test', 'TestCommand'), Command) self.assertIsNone( definitions.get_command_by_name('test', 'TestCommand')) - self.assertIsInstance(definitions.get_command_by_name( - 'Test', 'testcommand'), Command) + self.assertRaises(KeyError, definitions.get_command_by_name, + 'Test', 'testcommand') def test_get_response_by_name(self): definitions = SpecDefinitions( @@ -231,8 +231,8 @@ def test_get_response_by_name(self): 'Test', 'TestCommandResponse'), Struct) self.assertIsNone(definitions.get_response_by_name( 'test', 'TestCommandResponse')) - self.assertIsInstance(definitions.get_response_by_name( - 'Test', 'testcommandresponse'), Struct) + self.assertRaises(KeyError, definitions.get_response_by_name, + 'Test', 'testcommandresponse') def test_get_attribute_by_name(self): definitions = SpecDefinitions( @@ -251,10 +251,10 @@ def test_get_attribute_by_name(self): 'test', 'TestAttribute')) self.assertIsNone(definitions.get_attribute_by_name( 'test', 'TestGlobalAttribute')) - self.assertIsInstance(definitions.get_attribute_by_name( - 'Test', 'testattribute'), Attribute) - self.assertIsInstance(definitions.get_attribute_by_name( - 'Test', 'testglobalattribute'), Attribute) + self.assertRaises(KeyError, definitions.get_attribute_by_name, + 'Test', 'testattribute') + self.assertRaises(KeyError, definitions.get_attribute_by_name, + 'Test', 'testglobalattribute') def test_get_event_by_name(self): definitions = SpecDefinitions( @@ -266,8 +266,8 @@ def test_get_event_by_name(self): self.assertIsInstance( definitions.get_event_by_name('Test', 'TestEvent'), Event) self.assertIsNone(definitions.get_event_by_name('test', 'TestEvent')) - self.assertIsInstance( - definitions.get_event_by_name('Test', 'testevent'), Event) + self.assertRaises( + KeyError, definitions.get_event_by_name, 'Test', 'testevent') def test_get_bitmap_by_name(self): definitions = SpecDefinitions( @@ -279,8 +279,8 @@ def test_get_bitmap_by_name(self): self.assertIsInstance(definitions.get_bitmap_by_name( 'Test', 'TestBitmap'), Bitmap) self.assertIsNone(definitions.get_bitmap_by_name('test', 'TestBitmap')) - self.assertIsInstance(definitions.get_bitmap_by_name( - 'Test', 'testbitmap'), Bitmap) + self.assertRaises(KeyError, definitions.get_bitmap_by_name, + 'Test', 'testbitmap') def test_get_enum_by_name(self): definitions = SpecDefinitions( @@ -292,8 +292,8 @@ def test_get_enum_by_name(self): self.assertIsInstance( definitions.get_enum_by_name('Test', 'TestEnum'), Enum) self.assertIsNone(definitions.get_enum_by_name('test', 'TestEnum')) - self.assertIsInstance( - definitions.get_enum_by_name('Test', 'testenum'), Enum) + self.assertRaises( + KeyError, definitions.get_enum_by_name, 'Test', 'testenum') def test_get_struct_by_name(self): definitions = SpecDefinitions( @@ -305,8 +305,8 @@ def test_get_struct_by_name(self): self.assertIsInstance(definitions.get_struct_by_name( 'Test', 'TestStruct'), Struct) self.assertIsNone(definitions.get_struct_by_name('test', 'TestStruct')) - self.assertIsInstance(definitions.get_struct_by_name( - 'Test', 'teststruct'), Struct) + self.assertRaises( + KeyError, definitions.get_struct_by_name, 'Test', 'teststruct') def test_get_type_by_name(self): definitions = SpecDefinitions( diff --git a/src/app/tests/suites/TV_AccountLoginCluster.yaml b/src/app/tests/suites/TV_AccountLoginCluster.yaml index 1a1239189d4393..cc80a57f18636d 100644 --- a/src/app/tests/suites/TV_AccountLoginCluster.yaml +++ b/src/app/tests/suites/TV_AccountLoginCluster.yaml @@ -29,7 +29,7 @@ tests: value: nodeId - label: "Get Setup PIN Command" - command: "getSetupPIN" + command: "GetSetupPIN" timedInteractionTimeoutMs: 10000 arguments: values: @@ -40,7 +40,7 @@ tests: - name: "SetupPIN" value: "tempPin123" - label: "Login Command" - command: "login" + command: "Login" timedInteractionTimeoutMs: 10000 arguments: values: @@ -50,5 +50,5 @@ tests: value: "tempPin123" - label: "Logout Command" - command: "logout" + command: "Logout" timedInteractionTimeoutMs: 10000 diff --git a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml index d32c0e354e504d..3a9455cbf822b0 100644 --- a/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ApplicationLauncherCluster.yaml @@ -41,7 +41,7 @@ tests: value: null - label: "Launch App Command" - command: "launchApp" + command: "LaunchApp" arguments: values: - name: "Data" @@ -56,7 +56,7 @@ tests: value: 0 - label: "Stop App Command" - command: "stopApp" + command: "StopApp" arguments: values: - name: "Application" @@ -69,7 +69,7 @@ tests: value: 0 - label: "Hide App Command" - command: "hideApp" + command: "HideApp" arguments: values: - name: "Application" diff --git a/src/app/tests/suites/TV_AudioOutputCluster.yaml b/src/app/tests/suites/TV_AudioOutputCluster.yaml index a038c1cc4a2386..94d35564da1e68 100644 --- a/src/app/tests/suites/TV_AudioOutputCluster.yaml +++ b/src/app/tests/suites/TV_AudioOutputCluster.yaml @@ -46,14 +46,14 @@ tests: value: 1 - label: "Select Output Command" - command: "selectOutput" + command: "SelectOutput" arguments: values: - name: "Index" value: 1 - label: "Rename Output Command" - command: "renameOutput" + command: "RenameOutput" arguments: values: - name: "Index" diff --git a/src/app/tests/suites/TV_ChannelCluster.yaml b/src/app/tests/suites/TV_ChannelCluster.yaml index baebfac0fd45ec..93a01cdc207629 100644 --- a/src/app/tests/suites/TV_ChannelCluster.yaml +++ b/src/app/tests/suites/TV_ChannelCluster.yaml @@ -90,7 +90,7 @@ tests: } - label: "Change Channel Command" - command: "changeChannel" + command: "ChangeChannel" arguments: values: - name: "Match" @@ -103,7 +103,7 @@ tests: value: 0 - label: "Change Channel By Number Command" - command: "changeChannelByNumber" + command: "ChangeChannelByNumber" arguments: values: - name: "MajorNumber" @@ -112,7 +112,7 @@ tests: value: 0 - label: "Skip Channel Command" - command: "skipChannel" + command: "SkipChannel" arguments: values: - name: "Count" diff --git a/src/app/tests/suites/TV_ContentLauncherCluster.yaml b/src/app/tests/suites/TV_ContentLauncherCluster.yaml index efbd2082d12fd7..3ec333c6f2e61f 100644 --- a/src/app/tests/suites/TV_ContentLauncherCluster.yaml +++ b/src/app/tests/suites/TV_ContentLauncherCluster.yaml @@ -41,7 +41,7 @@ tests: value: 0 - label: "Launch Content Command" - command: "launchContent" + command: "LaunchContent" arguments: values: - name: "AutoPlay" @@ -69,7 +69,7 @@ tests: value: 0 - label: "Launch URL Command" - command: "launchURL" + command: "LaunchURL" arguments: values: - name: "ContentURL" diff --git a/src/app/tests/suites/TV_KeypadInputCluster.yaml b/src/app/tests/suites/TV_KeypadInputCluster.yaml index 99187210c5b3ec..f9aeea810a78e3 100644 --- a/src/app/tests/suites/TV_KeypadInputCluster.yaml +++ b/src/app/tests/suites/TV_KeypadInputCluster.yaml @@ -29,7 +29,7 @@ tests: value: nodeId - label: "Send Key Command" - command: "sendKey" + command: "SendKey" arguments: values: - name: "KeyCode" diff --git a/src/app/tests/suites/TV_LowPowerCluster.yaml b/src/app/tests/suites/TV_LowPowerCluster.yaml index e4ea3a8c2eddd9..14d65c22b008e2 100644 --- a/src/app/tests/suites/TV_LowPowerCluster.yaml +++ b/src/app/tests/suites/TV_LowPowerCluster.yaml @@ -29,4 +29,4 @@ tests: value: nodeId - label: "Sleep Input Status Command" - command: "sleep" + command: "Sleep" diff --git a/src/app/tests/suites/TV_MediaInputCluster.yaml b/src/app/tests/suites/TV_MediaInputCluster.yaml index b03dce843ed47e..eda207b2558cde 100644 --- a/src/app/tests/suites/TV_MediaInputCluster.yaml +++ b/src/app/tests/suites/TV_MediaInputCluster.yaml @@ -55,20 +55,20 @@ tests: value: 1 - label: "Select Input Command" - command: "selectInput" + command: "SelectInput" arguments: values: - name: "Index" value: 1 - label: "Hide Input Status Command" - command: "hideInputStatus" + command: "HideInputStatus" - label: "Show Input Status Command" - command: "showInputStatus" + command: "ShowInputStatus" - label: "Rename Input Command" - command: "renameInput" + command: "RenameInput" arguments: values: - name: "Index" diff --git a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml index 8ba1fd423eab61..5175551f06c625 100644 --- a/src/app/tests/suites/TV_MediaPlaybackCluster.yaml +++ b/src/app/tests/suites/TV_MediaPlaybackCluster.yaml @@ -71,7 +71,7 @@ tests: value: 0 - label: "Media Playback Play Command" - command: "play" + command: "Play" response: values: - name: "Data" @@ -80,7 +80,7 @@ tests: value: 0 - label: "Media Playback Pause Command" - command: "pause" + command: "Pause" response: values: - name: "Data" @@ -98,7 +98,7 @@ tests: value: 0 - label: "Media Playback Start Over Command" - command: "startOver" + command: "StartOver" response: values: - name: "Data" @@ -107,7 +107,7 @@ tests: value: 0 - label: "Media Playback Previous Command" - command: "previous" + command: "Previous" response: values: - name: "Data" @@ -116,7 +116,7 @@ tests: value: 0 - label: "Media Playback Next Command" - command: "next" + command: "Next" response: values: - name: "Data" @@ -125,7 +125,7 @@ tests: value: 0 - label: "Media Playback Rewind Command" - command: "rewind" + command: "Rewind" response: values: - name: "Data" @@ -134,7 +134,7 @@ tests: value: 0 - label: "Media Playback Fast Forward Command" - command: "fastForward" + command: "FastForward" response: values: - name: "Data" @@ -143,7 +143,7 @@ tests: value: 0 - label: "Media Playback Skip Forward Command" - command: "skipForward" + command: "SkipForward" arguments: values: - name: "DeltaPositionMilliseconds" @@ -162,7 +162,7 @@ tests: value: { UpdatedAt: 0, Position: 500 } - label: "Media Playback Skip Backward Command" - command: "skipBackward" + command: "SkipBackward" arguments: values: - name: "DeltaPositionMilliseconds" @@ -181,7 +181,7 @@ tests: value: { UpdatedAt: 0, Position: 400 } - label: "Media Playback Seek Command" - command: "seek" + command: "Seek" arguments: values: - name: "position" diff --git a/src/app/tests/suites/TV_TargetNavigatorCluster.yaml b/src/app/tests/suites/TV_TargetNavigatorCluster.yaml index de64e9d74db7e8..176f91cea94c0b 100644 --- a/src/app/tests/suites/TV_TargetNavigatorCluster.yaml +++ b/src/app/tests/suites/TV_TargetNavigatorCluster.yaml @@ -45,7 +45,7 @@ tests: value: 0 - label: "Navigate Target Request Command" - command: "navigateTarget" + command: "NavigateTarget" arguments: values: - name: "Target" diff --git a/src/app/tests/suites/TestBasicInformation.yaml b/src/app/tests/suites/TestBasicInformation.yaml index 340d6ddf2f3e36..8dce39f49b6d89 100644 --- a/src/app/tests/suites/TestBasicInformation.yaml +++ b/src/app/tests/suites/TestBasicInformation.yaml @@ -30,25 +30,25 @@ tests: - label: "Read location" command: "readAttribute" - attribute: "location" + attribute: "Location" response: value: "XX" - label: "Write location" command: "writeAttribute" - attribute: "location" + attribute: "Location" arguments: value: "US" - label: "Read back location" command: "readAttribute" - attribute: "location" + attribute: "Location" response: value: "US" - label: "Restore initial location value" command: "writeAttribute" - attribute: "location" + attribute: "Location" arguments: value: "XX" diff --git a/src/app/tests/suites/TestBinding.yaml b/src/app/tests/suites/TestBinding.yaml index cefb2023965942..6ca70ad3d9c330 100644 --- a/src/app/tests/suites/TestBinding.yaml +++ b/src/app/tests/suites/TestBinding.yaml @@ -30,19 +30,19 @@ tests: - label: "Write empty binding table" command: "writeAttribute" - attribute: "binding" + attribute: "Binding" arguments: value: [] - label: "Read empty binding table" command: "readAttribute" - attribute: "binding" + attribute: "Binding" response: value: [] - label: "Write invalid binding table" command: "writeAttribute" - attribute: "binding" + attribute: "Binding" arguments: value: [ @@ -60,7 +60,7 @@ tests: - label: "Write binding table (endpoint 1)" command: "writeAttribute" - attribute: "binding" + attribute: "Binding" arguments: value: [ @@ -71,7 +71,7 @@ tests: - label: "Read binding table (endpoint 1)" command: "readAttribute" - attribute: "binding" + attribute: "Binding" response: value: [ @@ -82,21 +82,21 @@ tests: - label: "Write binding table (endpoint 0)" command: "writeAttribute" - attribute: "binding" + attribute: "Binding" endpoint: 0 arguments: value: [{ FabricIndex: 0, Node: 3, Endpoint: 1 }] - label: "Read binding table (endpoint 0)" command: "readAttribute" - attribute: "binding" + attribute: "Binding" endpoint: 0 response: value: [{ FabricIndex: 1, Node: 3, Endpoint: 1 }] - label: "Verify endpoint 1 not changed" command: "readAttribute" - attribute: "binding" + attribute: "Binding" response: value: [ diff --git a/src/app/tests/suites/TestCluster.yaml b/src/app/tests/suites/TestCluster.yaml index e03a338a90e5fa..40a182c82b3fa1 100644 --- a/src/app/tests/suites/TestCluster.yaml +++ b/src/app/tests/suites/TestCluster.yaml @@ -29,22 +29,22 @@ tests: value: nodeId - label: "Send Test Command" - command: "test" + command: "Test" - label: "Send Test Not Handled Command" - command: "testNotHandled" + command: "TestNotHandled" response: error: INVALID_COMMAND - label: "Send Test Specific Command" - command: "testSpecific" + command: "TestSpecific" response: values: - name: "returnValue" value: 7 - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" @@ -57,7 +57,7 @@ tests: value: 20 - label: "Send failing Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" @@ -1007,13 +1007,13 @@ tests: value: 0 - label: "Send Test Command to unsupported endpoint" - command: "test" + command: "Test" endpoint: 200 response: error: UNSUPPORTED_ENDPOINT - label: "Send Test Command to unsupported cluster" - command: "test" + command: "Test" endpoint: 0 response: error: UNSUPPORTED_CLUSTER @@ -1045,7 +1045,7 @@ tests: value: 0 - label: "Send a command with a vendor_id and enum" - command: "testEnumsRequest" + command: "TestEnumsRequest" arguments: values: - name: "arg1" @@ -1077,7 +1077,7 @@ tests: # Tests for Struct - label: "Send Test Command With Struct Argument and arg1.b is true" - command: "testStructArgumentRequest" + command: "TestStructArgumentRequest" arguments: values: - name: "arg1" @@ -1098,7 +1098,7 @@ tests: value: true - label: "Send Test Command With Struct Argument and arg1.b is false" - command: "testStructArgumentRequest" + command: "TestStructArgumentRequest" arguments: values: - name: "arg1" @@ -1120,7 +1120,7 @@ tests: - label: "Send Test Command With Nested Struct Argument and arg1.c.b is true" - command: "testNestedStructArgumentRequest" + command: "TestNestedStructArgumentRequest" arguments: values: - name: "arg1" @@ -1146,7 +1146,7 @@ tests: value: true - label: "Send Test Command With Nested Struct Argument arg1.c.b is false" - command: "testNestedStructArgumentRequest" + command: "TestNestedStructArgumentRequest" arguments: values: - name: "arg1" @@ -1174,7 +1174,7 @@ tests: - label: "Send Test Command With Nested Struct List Argument and all fields b of arg1.d are true" - command: "testNestedStructListArgumentRequest" + command: "TestNestedStructListArgumentRequest" arguments: values: - name: "arg1" @@ -1233,7 +1233,7 @@ tests: - label: "Send Test Command With Nested Struct List Argument and some fields b of arg1.d are false" - command: "testNestedStructListArgumentRequest" + command: "TestNestedStructListArgumentRequest" arguments: values: - name: "arg1" @@ -1323,7 +1323,7 @@ tests: # Tests for List - label: "Send Test Command With List of INT8U and none of them is set to 0" - command: "testListInt8UArgumentRequest" + command: "TestListInt8UArgumentRequest" arguments: values: - name: "arg1" @@ -1334,7 +1334,7 @@ tests: value: true - label: "Send Test Command With List of INT8U and one of them is set to 0" - command: "testListInt8UArgumentRequest" + command: "TestListInt8UArgumentRequest" arguments: values: - name: "arg1" @@ -1345,7 +1345,7 @@ tests: value: false - label: "Send Test Command With List of INT8U and get it reversed" - command: "testListInt8UReverseRequest" + command: "TestListInt8UReverseRequest" arguments: values: - name: "arg1" @@ -1357,7 +1357,7 @@ tests: - label: "Send Test Command With empty List of INT8U and get an empty list back" - command: "testListInt8UReverseRequest" + command: "TestListInt8UReverseRequest" arguments: values: - name: "arg1" @@ -1370,7 +1370,7 @@ tests: - label: "Send Test Command With List of Struct Argument and arg1.b of first item is true" - command: "testListStructArgumentRequest" + command: "TestListStructArgumentRequest" arguments: values: - name: "arg1" @@ -1405,7 +1405,7 @@ tests: - label: "Send Test Command With List of Struct Argument and arg1.b of first item is false" - command: "testListStructArgumentRequest" + command: "TestListStructArgumentRequest" arguments: values: - name: "arg1" @@ -1440,7 +1440,7 @@ tests: - label: "Send Test Command With List of Nested Struct List Argument and all fields b of elements of arg1.d are true" - command: "testListNestedStructListArgumentRequest" + command: "TestListNestedStructListArgumentRequest" arguments: values: - name: "arg1" @@ -1501,7 +1501,7 @@ tests: - label: "Send Test Command With Nested Struct List Argument and some fields b of elements of arg1.d are false" - command: "testListNestedStructListArgumentRequest" + command: "TestListNestedStructListArgumentRequest" arguments: values: - name: "arg1" @@ -1611,7 +1611,7 @@ tests: # Tests for Nullables and Optionals - label: "Send Test Command with optional arg set." - command: "testNullableOptionalRequest" + command: "TestNullableOptionalRequest" arguments: values: - name: "arg1" @@ -1628,7 +1628,7 @@ tests: value: 5 - label: "Send Test Command without its optional arg." - command: "testNullableOptionalRequest" + command: "TestNullableOptionalRequest" response: values: - name: "wasPresent" diff --git a/src/app/tests/suites/TestClusterComplexTypes.yaml b/src/app/tests/suites/TestClusterComplexTypes.yaml index 2044bf8ca75796..e6dccc4d6c3493 100644 --- a/src/app/tests/suites/TestClusterComplexTypes.yaml +++ b/src/app/tests/suites/TestClusterComplexTypes.yaml @@ -34,7 +34,7 @@ tests: # field and some of the TestCluster consumers don't do # that... and it's not clear that it's ever needed outside of # tests. - command: "testNullableOptionalRequest" + command: "TestNullableOptionalRequest" arguments: values: - name: "arg1" @@ -52,19 +52,19 @@ tests: # SDK APIs have not been updated to do timed invoke properly yet. - label: "Send command that needs timed invoke without a timeout value" - command: "timedInvokeRequest" + command: "TimedInvokeRequest" response: # No timed interaction timeout provided, so not doing a timed interaction. error: NEEDS_TIMED_INTERACTION - label: "Send command that needs timed invoke with a long timeout value" # Expecting a success response here. - command: "timedInvokeRequest" + command: "TimedInvokeRequest" timedInteractionTimeoutMs: 10000 - label: "Send command that needs timed invoke with a too-short timeout value" - command: "timedInvokeRequest" + command: "TimedInvokeRequest" timedInteractionTimeoutMs: 1 # Try to ensure that we are unresponsive for long enough that the timeout # expires. @@ -76,13 +76,13 @@ tests: "Send command that does not need timed invoke with a long timeout value" # Expecting a success response here. - command: "test" + command: "Test" timedInteractionTimeoutMs: 10000 - label: "Send command that does not need timed invoke with a too-short timeout value" - command: "test" + command: "Test" timedInteractionTimeoutMs: 1 # Try to ensure that we are unresponsive for long enough that the timeout # expires. diff --git a/src/app/tests/suites/TestConfigVariables.yaml b/src/app/tests/suites/TestConfigVariables.yaml index b8cc8def2e39c3..8abbfcc6b339a0 100644 --- a/src/app/tests/suites/TestConfigVariables.yaml +++ b/src/app/tests/suites/TestConfigVariables.yaml @@ -35,7 +35,7 @@ tests: value: nodeId - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" @@ -49,7 +49,7 @@ tests: value: 20 - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" diff --git a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml index e6759dec28845e..eb89d57ae0dd40 100644 --- a/src/app/tests/suites/TestGroupKeyManagementCluster.yaml +++ b/src/app/tests/suites/TestGroupKeyManagementCluster.yaml @@ -30,14 +30,14 @@ tests: - label: "Read maxGroupsPerFabric" command: "readAttribute" - attribute: "maxGroupsPerFabric" + attribute: "MaxGroupsPerFabric" response: constraints: minValue: 4 - label: "Read maxGroupKeysPerFabric" command: "readAttribute" - attribute: "maxGroupKeysPerFabric" + attribute: "MaxGroupKeysPerFabric" response: constraints: minValue: 3 diff --git a/src/app/tests/suites/TestGroupMessaging.yaml b/src/app/tests/suites/TestGroupMessaging.yaml index b4806bedd3e5f3..74aeef605eef54 100644 --- a/src/app/tests/suites/TestGroupMessaging.yaml +++ b/src/app/tests/suites/TestGroupMessaging.yaml @@ -149,14 +149,14 @@ tests: # Test Pair 1 : Check initial value (ensure it's not the test value) - label: "Read initial Attribute value" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "" # Test Pair 2 : Sends a Group Write Attribute - label: "Group Write Attribute" command: "writeAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" groupId: 0x0102 arguments: value: "xyzzy" @@ -174,14 +174,14 @@ tests: # Test Pair 2 : Validates previous group write attribute with a unicast to read - label: "Read back Attribute" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "xyzzy" # Test Pair 3 : Sends a Group Write Attribute - label: "Restore initial Attribute value" command: "writeAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" groupId: 0x0102 arguments: value: "" @@ -199,7 +199,7 @@ tests: # Test Pair 3 : Validates previous group write attribute with a unicast to read - label: "Read back Attribute" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "" @@ -405,7 +405,7 @@ tests: - label: "Read initial Attribute value for gamma" identity: "gamma" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "" @@ -413,7 +413,7 @@ tests: - label: "Group Write Attribute for gamma" identity: "gamma" command: "writeAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" groupId: 0x0102 arguments: value: "xyzzy" @@ -433,7 +433,7 @@ tests: - label: "Read back Attribute for gamma" identity: "gamma" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "xyzzy" @@ -441,7 +441,7 @@ tests: - label: "Restore initial Attribute value for gamma" identity: "gamma" command: "writeAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" groupId: 0x0102 arguments: value: "" @@ -461,7 +461,7 @@ tests: - label: "Read back Attribute for gamma" identity: "gamma" command: "readAttribute" - attribute: "nodeLabel" + attribute: "NodeLabel" response: value: "" diff --git a/src/app/tests/suites/TestIdentifyCluster.yaml b/src/app/tests/suites/TestIdentifyCluster.yaml index fe0c3a68e811fc..52e667ce4d0329 100644 --- a/src/app/tests/suites/TestIdentifyCluster.yaml +++ b/src/app/tests/suites/TestIdentifyCluster.yaml @@ -29,7 +29,7 @@ tests: value: nodeId - label: "Send Identify command and expect success response" - command: "identify" + command: "Identify" arguments: values: - name: "IdentifyTime" diff --git a/src/app/tests/suites/TestModeSelectCluster.yaml b/src/app/tests/suites/TestModeSelectCluster.yaml index 43ae57d4e7097d..3df5462041b374 100644 --- a/src/app/tests/suites/TestModeSelectCluster.yaml +++ b/src/app/tests/suites/TestModeSelectCluster.yaml @@ -81,7 +81,7 @@ tests: value: null - label: "Change to Supported Mode" - command: "changeToMode" + command: "ChangeToMode" arguments: values: - name: "NewMode" @@ -95,7 +95,7 @@ tests: saveAs: currentModeBeforeToggle - label: "Change to Unsupported Mode" - command: "changeToMode" + command: "ChangeToMode" arguments: values: - name: "NewMode" @@ -105,11 +105,11 @@ tests: - label: "Toggle OnOff" cluster: "On/Off" - command: "off" + command: "Off" - label: "Toggle OnOff" cluster: "On/Off" - command: "on" + command: "On" - label: "Verify Current Mode does not change when OnMode is null" command: "readAttribute" @@ -140,11 +140,11 @@ tests: - label: "Toggle OnOff" cluster: "On/Off" - command: "off" + command: "Off" - label: "Toggle OnOff" cluster: "On/Off" - command: "on" + command: "On" - label: "Verify Current Mode Changes if OnMode is not null" command: "readAttribute" @@ -173,7 +173,7 @@ tests: value: 7 - label: "Change CurrentMode to another value" - command: "changeToMode" + command: "ChangeToMode" arguments: values: - name: "NewMode" diff --git a/src/app/tests/suites/TestSaveAs.yaml b/src/app/tests/suites/TestSaveAs.yaml index efafc4cb4594a6..47a648a4f384ea 100644 --- a/src/app/tests/suites/TestSaveAs.yaml +++ b/src/app/tests/suites/TestSaveAs.yaml @@ -29,7 +29,7 @@ tests: value: nodeId - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" @@ -43,7 +43,7 @@ tests: value: 20 - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" @@ -56,7 +56,7 @@ tests: value: TestAddArgumentDefaultValue - label: "Send Test Add Arguments Command" - command: "testAddArguments" + command: "TestAddArguments" arguments: values: - name: "arg1" diff --git a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml index 3cf08bac2e3e73..7172a24a1cf2f7 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_4_2.yaml @@ -347,7 +347,7 @@ tests: - label: "Turn off light that we turned on" PICS: OO.S.C00.Rsp cluster: "On/Off" - command: "off" + command: "Off" - label: "Check on/off attribute value is false after off command" cluster: "On/Off" diff --git a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml index eec8e097d4e3a2..fd7ba9158414f0 100644 --- a/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGTHREAD_2_1.yaml @@ -34,7 +34,7 @@ tests: - label: "TH reads Channel attribute value from DUT" PICS: DGTHREAD.S.A0000 command: "readAttribute" - attribute: "channel" + attribute: "Channel" response: constraints: type: int16u @@ -297,7 +297,7 @@ tests: - label: "TH reads Weighting attribute value from DUT" PICS: DGTHREAD.S.A000a command: "readAttribute" - attribute: "weighting" + attribute: "Weighting" response: constraints: type: int8u